From c6a72fc1d7636468a368073cc124fcc52e5e48e8 Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Mon, 16 Sep 2024 10:46:01 -0500 Subject: [PATCH] Release 1.6.1 --- .gitignore | 10 +- LICENSE | 2 +- README.md | 8 +- VERSION | 2 +- bin/gradle | 4 +- build.gradle | 9 +- build.sbt | 2 +- gradle.properties | 2 +- openapi-config.yaml | 10 +- pom.xml | 2 +- run-build | 1 + src/main/java/com/dropbox/sign/ApiClient.java | 2342 +++++----- .../java/com/dropbox/sign/ApiException.java | 45 +- .../java/com/dropbox/sign/ApiResponse.java | 1 - .../java/com/dropbox/sign/Configuration.java | 15 +- .../com/dropbox/sign/EventCallbackHelper.java | 36 +- src/main/java/com/dropbox/sign/JSON.java | 404 +- .../com/dropbox/sign/JavaTimeFormatter.java | 14 +- src/main/java/com/dropbox/sign/Pair.java | 7 +- .../com/dropbox/sign/RFC3339DateFormat.java | 68 +- .../com/dropbox/sign/ServerConfiguration.java | 27 +- .../java/com/dropbox/sign/ServerVariable.java | 12 +- .../java/com/dropbox/sign/StringUtil.java | 116 +- .../java/com/dropbox/sign/api/AccountApi.java | 633 +-- .../java/com/dropbox/sign/api/ApiAppApi.java | 822 ++-- .../com/dropbox/sign/api/BulkSendJobApi.java | 538 +-- .../com/dropbox/sign/api/EmbeddedApi.java | 359 +- .../java/com/dropbox/sign/api/FaxLineApi.java | 1331 +++--- .../java/com/dropbox/sign/api/OAuthApi.java | 309 +- .../java/com/dropbox/sign/api/ReportApi.java | 193 +- .../dropbox/sign/api/SignatureRequestApi.java | 2686 +++++++----- .../java/com/dropbox/sign/api/TeamApi.java | 1697 ++++---- .../com/dropbox/sign/api/TemplateApi.java | 1984 +++++---- .../dropbox/sign/api/UnclaimedDraftApi.java | 632 +-- .../com/dropbox/sign/auth/ApiKeyAuth.java | 105 +- .../com/dropbox/sign/auth/Authentication.java | 16 +- .../com/dropbox/sign/auth/HttpBasicAuth.java | 67 +- .../com/dropbox/sign/auth/HttpBearerAuth.java | 89 +- .../sign/model/AbstractOpenApiSchema.java | 42 +- .../sign/model/AccountCreateRequest.java | 554 ++- .../sign/model/AccountCreateResponse.java | 474 +- .../sign/model/AccountGetResponse.java | 384 +- .../dropbox/sign/model/AccountResponse.java | 1186 +++-- .../sign/model/AccountResponseQuotas.java | 760 ++-- .../sign/model/AccountResponseUsage.java | 271 +- .../sign/model/AccountUpdateRequest.java | 433 +- .../sign/model/AccountVerifyRequest.java | 272 +- .../sign/model/AccountVerifyResponse.java | 384 +- .../model/AccountVerifyResponseAccount.java | 274 +- .../sign/model/ApiAppCreateRequest.java | 854 ++-- .../dropbox/sign/model/ApiAppGetResponse.java | 384 +- .../sign/model/ApiAppListResponse.java | 488 +-- .../dropbox/sign/model/ApiAppResponse.java | 1124 +++-- .../sign/model/ApiAppResponseOAuth.java | 563 ++- .../sign/model/ApiAppResponseOptions.java | 277 +- .../model/ApiAppResponseOwnerAccount.java | 369 +- .../ApiAppResponseWhiteLabelingOptions.java | 1543 +++---- .../sign/model/ApiAppUpdateRequest.java | 852 ++-- .../sign/model/BulkSendJobGetResponse.java | 590 ++- ...lkSendJobGetResponseSignatureRequests.java | 2591 +++++------ .../sign/model/BulkSendJobListResponse.java | 491 +-- .../sign/model/BulkSendJobResponse.java | 549 ++- .../sign/model/BulkSendJobSendResponse.java | 387 +- .../sign/model/EmbeddedEditUrlRequest.java | 1152 +++-- .../sign/model/EmbeddedEditUrlResponse.java | 385 +- .../EmbeddedEditUrlResponseEmbedded.java | 368 +- .../sign/model/EmbeddedSignUrlResponse.java | 385 +- .../EmbeddedSignUrlResponseEmbedded.java | 368 +- .../com/dropbox/sign/model/ErrorResponse.java | 271 +- .../sign/model/ErrorResponseError.java | 435 +- .../sign/model/EventCallbackRequest.java | 550 ++- .../sign/model/EventCallbackRequestEvent.java | 698 ++- .../EventCallbackRequestEventMetadata.java | 570 +-- .../sign/model/FaxLineAddUserRequest.java | 433 +- .../model/FaxLineAreaCodeGetCountryEnum.java | 66 +- .../model/FaxLineAreaCodeGetProvinceEnum.java | 116 +- .../model/FaxLineAreaCodeGetResponse.java | 296 +- .../model/FaxLineAreaCodeGetStateEnum.java | 268 +- .../sign/model/FaxLineCreateRequest.java | 609 ++- .../sign/model/FaxLineDeleteRequest.java | 270 +- .../sign/model/FaxLineListResponse.java | 476 +- .../sign/model/FaxLineRemoveUserRequest.java | 434 +- .../dropbox/sign/model/FaxLineResponse.java | 367 +- .../sign/model/FaxLineResponseFaxLine.java | 565 ++- .../com/dropbox/sign/model/FileResponse.java | 368 +- .../sign/model/FileResponseDataUri.java | 270 +- .../dropbox/sign/model/ListInfoResponse.java | 549 ++- .../sign/model/OAuthTokenGenerateRequest.java | 648 ++- .../sign/model/OAuthTokenRefreshRequest.java | 371 +- .../sign/model/OAuthTokenResponse.java | 643 ++- .../sign/model/ReportCreateRequest.java | 525 ++- .../sign/model/ReportCreateResponse.java | 384 +- .../dropbox/sign/model/ReportResponse.java | 610 ++- ...BulkCreateEmbeddedWithTemplateRequest.java | 1513 +++---- ...ureRequestBulkSendWithTemplateRequest.java | 1485 +++---- ...SignatureRequestCreateEmbeddedRequest.java | 2604 +++++------ ...uestCreateEmbeddedWithTemplateRequest.java | 1688 +++---- .../model/SignatureRequestGetResponse.java | 388 +- .../model/SignatureRequestListResponse.java | 498 ++- .../model/SignatureRequestRemindRequest.java | 370 +- .../sign/model/SignatureRequestResponse.java | 2570 ++++++----- .../SignatureRequestResponseAttachment.java | 760 ++-- ...gnatureRequestResponseCustomFieldBase.java | 678 ++- ...ureRequestResponseCustomFieldCheckbox.java | 408 +- ...gnatureRequestResponseCustomFieldText.java | 406 +- ...ureRequestResponseCustomFieldTypeEnum.java | 73 +- .../SignatureRequestResponseDataBase.java | 707 ++- .../SignatureRequestResponseDataTypeEnum.java | 101 +- ...atureRequestResponseDataValueCheckbox.java | 402 +- ...RequestResponseDataValueCheckboxMerge.java | 408 +- ...ureRequestResponseDataValueDateSigned.java | 403 +- ...atureRequestResponseDataValueDropdown.java | 402 +- ...atureRequestResponseDataValueInitials.java | 402 +- ...ignatureRequestResponseDataValueRadio.java | 400 +- ...tureRequestResponseDataValueSignature.java | 403 +- ...SignatureRequestResponseDataValueText.java | 400 +- ...tureRequestResponseDataValueTextMerge.java | 403 +- .../SignatureRequestResponseSignatures.java | 1931 ++++----- .../model/SignatureRequestSendRequest.java | 2804 ++++++------ ...gnatureRequestSendWithTemplateRequest.java | 1873 ++++---- .../model/SignatureRequestUpdateRequest.java | 556 ++- .../com/dropbox/sign/model/SubAttachment.java | 550 ++- .../dropbox/sign/model/SubBulkSignerList.java | 401 +- .../model/SubBulkSignerListCustomField.java | 368 +- .../java/com/dropbox/sign/model/SubCC.java | 369 +- .../dropbox/sign/model/SubCustomField.java | 559 ++- .../dropbox/sign/model/SubEditorOptions.java | 371 +- .../dropbox/sign/model/SubFieldOptions.java | 352 +- .../dropbox/sign/model/SubFormFieldGroup.java | 440 +- .../dropbox/sign/model/SubFormFieldRule.java | 581 ++- .../sign/model/SubFormFieldRuleAction.java | 601 ++- .../sign/model/SubFormFieldRuleTrigger.java | 645 +-- .../model/SubFormFieldsPerDocumentBase.java | 1304 +++--- .../SubFormFieldsPerDocumentCheckbox.java | 490 +-- ...SubFormFieldsPerDocumentCheckboxMerge.java | 312 +- .../SubFormFieldsPerDocumentDateSigned.java | 604 ++- .../SubFormFieldsPerDocumentDropdown.java | 802 ++-- .../SubFormFieldsPerDocumentFontEnum.java | 128 +- .../SubFormFieldsPerDocumentHyperlink.java | 791 ++-- .../SubFormFieldsPerDocumentInitials.java | 308 +- .../model/SubFormFieldsPerDocumentRadio.java | 492 +-- .../SubFormFieldsPerDocumentSignature.java | 308 +- .../model/SubFormFieldsPerDocumentText.java | 1495 +++---- .../SubFormFieldsPerDocumentTextMerge.java | 604 ++- .../SubFormFieldsPerDocumentTypeEnum.java | 104 +- .../com/dropbox/sign/model/SubMergeField.java | 412 +- .../java/com/dropbox/sign/model/SubOAuth.java | 458 +- .../com/dropbox/sign/model/SubOptions.java | 275 +- .../SubSignatureRequestGroupedSigners.java | 476 +- .../sign/model/SubSignatureRequestSigner.java | 797 ++-- .../SubSignatureRequestTemplateSigner.java | 802 ++-- .../dropbox/sign/model/SubSigningOptions.java | 698 ++- .../dropbox/sign/model/SubTeamResponse.java | 364 +- .../dropbox/sign/model/SubTemplateRole.java | 365 +- .../sign/model/SubUnclaimedDraftSigner.java | 432 +- .../SubUnclaimedDraftTemplateSigner.java | 435 +- .../sign/model/SubWhiteLabelingOptions.java | 1673 +++---- .../sign/model/TeamAddMemberRequest.java | 525 ++- .../dropbox/sign/model/TeamCreateRequest.java | 269 +- .../sign/model/TeamGetInfoResponse.java | 384 +- .../dropbox/sign/model/TeamGetResponse.java | 385 +- .../dropbox/sign/model/TeamInfoResponse.java | 642 ++- .../sign/model/TeamInviteResponse.java | 733 ++-- .../sign/model/TeamInvitesResponse.java | 400 +- .../sign/model/TeamMemberResponse.java | 431 +- .../sign/model/TeamMembersResponse.java | 490 +-- .../sign/model/TeamParentResponse.java | 363 +- .../sign/model/TeamRemoveMemberRequest.java | 722 ++- .../com/dropbox/sign/model/TeamResponse.java | 590 ++- .../sign/model/TeamSubTeamsResponse.java | 490 +-- .../dropbox/sign/model/TeamUpdateRequest.java | 269 +- .../sign/model/TemplateAddUserRequest.java | 437 +- .../TemplateCreateEmbeddedDraftRequest.java | 2678 ++++++------ .../TemplateCreateEmbeddedDraftResponse.java | 388 +- ...teCreateEmbeddedDraftResponseTemplate.java | 581 ++- .../sign/model/TemplateCreateRequest.java | 2005 ++++----- .../sign/model/TemplateCreateResponse.java | 385 +- .../model/TemplateCreateResponseTemplate.java | 274 +- .../sign/model/TemplateEditResponse.java | 272 +- .../sign/model/TemplateGetResponse.java | 384 +- .../sign/model/TemplateListResponse.java | 490 +-- .../sign/model/TemplateRemoveUserRequest.java | 371 +- .../dropbox/sign/model/TemplateResponse.java | 1657 ++++--- .../sign/model/TemplateResponseAccount.java | 739 ++-- .../model/TemplateResponseAccountQuota.java | 569 +-- .../sign/model/TemplateResponseCCRole.java | 270 +- .../sign/model/TemplateResponseDocument.java | 815 ++-- ...mplateResponseDocumentCustomFieldBase.java | 1147 +++-- ...teResponseDocumentCustomFieldCheckbox.java | 319 +- ...mplateResponseDocumentCustomFieldText.java | 695 ++- .../TemplateResponseDocumentFieldGroup.java | 367 +- ...emplateResponseDocumentFieldGroupRule.java | 375 +- ...TemplateResponseDocumentFormFieldBase.java | 1187 +++-- ...lateResponseDocumentFormFieldCheckbox.java | 324 +- ...teResponseDocumentFormFieldDateSigned.java | 325 +- ...lateResponseDocumentFormFieldDropdown.java | 324 +- ...ateResponseDocumentFormFieldHyperlink.java | 704 +-- ...lateResponseDocumentFormFieldInitials.java | 324 +- ...emplateResponseDocumentFormFieldRadio.java | 319 +- ...ateResponseDocumentFormFieldSignature.java | 325 +- ...TemplateResponseDocumentFormFieldText.java | 895 ++-- ...mplateResponseDocumentStaticFieldBase.java | 1153 +++-- ...teResponseDocumentStaticFieldCheckbox.java | 325 +- ...ResponseDocumentStaticFieldDateSigned.java | 327 +- ...teResponseDocumentStaticFieldDropdown.java | 325 +- ...eResponseDocumentStaticFieldHyperlink.java | 325 +- ...teResponseDocumentStaticFieldInitials.java | 325 +- ...plateResponseDocumentStaticFieldRadio.java | 324 +- ...eResponseDocumentStaticFieldSignature.java | 325 +- ...mplateResponseDocumentStaticFieldText.java | 323 +- .../TemplateResponseFieldAvgTextLength.java | 371 +- .../model/TemplateResponseSignerRole.java | 365 +- .../model/TemplateUpdateFilesRequest.java | 772 ++-- .../model/TemplateUpdateFilesResponse.java | 273 +- .../TemplateUpdateFilesResponseTemplate.java | 396 +- .../UnclaimedDraftCreateEmbeddedRequest.java | 3860 +++++++++-------- ...raftCreateEmbeddedWithTemplateRequest.java | 3156 +++++++------- .../model/UnclaimedDraftCreateRequest.java | 2655 ++++++------ .../model/UnclaimedDraftCreateResponse.java | 389 +- .../UnclaimedDraftEditAndResendRequest.java | 974 +++-- .../sign/model/UnclaimedDraftResponse.java | 763 ++-- .../dropbox/sign/model/WarningResponse.java | 369 +- .../dropbox/sign/EventCallbackHelperTest.java | 55 +- .../java/com/dropbox/sign/FixtureTest.java | 74 +- .../sign/SubFormFieldsPerDocumentTest.java | 40 +- .../java/com/dropbox/sign/TestHelper.java | 59 +- .../com/dropbox/sign/api/AccountApiTest.java | 71 +- .../com/dropbox/sign/api/ApiAppApiTest.java | 41 +- .../dropbox/sign/api/BulkSendJobApiTest.java | 16 +- .../com/dropbox/sign/api/EmbeddedApiTest.java | 19 +- .../com/dropbox/sign/api/OAuthApiTest.java | 22 +- .../com/dropbox/sign/api/ReportApiTest.java | 13 +- .../sign/api/SignatureRequestApiTest.java | 319 +- .../com/dropbox/sign/api/TeamApiTest.java | 31 +- .../com/dropbox/sign/api/TemplateApiTest.java | 67 +- .../sign/api/UnclaimedDraftApiTest.java | 64 +- ...e => dropbox-EventCallbackHelper.mustache} | 0 templates/dropbox-LICENSE.mustache | 21 + ...SION.mustache => dropbox-VERSION.mustache} | 0 templates/gitignore.mustache | 10 +- templates/libraries/jersey2/api.mustache | 15 + .../libraries/jersey2/build.gradle.mustache | 13 +- 242 files changed, 67473 insertions(+), 67558 deletions(-) rename templates/{EventCallbackHelper.mustache => dropbox-EventCallbackHelper.mustache} (100%) create mode 100644 templates/dropbox-LICENSE.mustache rename templates/{VERSION.mustache => dropbox-VERSION.mustache} (100%) diff --git a/.gitignore b/.gitignore index 639e150..6d0a68e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,8 @@ target .gradle build -/.composer -/vendor -/.idea/ -/.openapi-generator -/.github/workflows/maven.yml +.composer +vendor +.idea/ +.openapi-generator +.github/workflows/maven.yml diff --git a/LICENSE b/LICENSE index 4025343..ef7ea60 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (C) 2023 dropbox.com +Copyright (c) 2024 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 diff --git a/README.md b/README.md index 8c1a7ad..4f76938 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 1.6.0 + 1.6.1 compile ``` @@ -71,7 +71,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:1.6.0" + implementation "com.dropbox.sign:dropbox-sign:1.6.1" } ``` @@ -85,7 +85,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-1.6.0.jar` +- `target/dropbox-sign-1.6.1.jar` - `target/lib/*.jar` ## Getting Started @@ -449,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.6.0` + - Package version: `1.6.1` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/VERSION b/VERSION index dc1e644..9c6d629 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 +1.6.1 diff --git a/bin/gradle b/bin/gradle index 3cc139f..33882f6 100755 --- a/bin/gradle +++ b/bin/gradle @@ -10,8 +10,8 @@ WORKING_DIR="/app/java" docker run --rm \ -v "${ROOT_DIR}:${WORKING_DIR}" \ - -v "dropbox-sign-sdk-gradle-cache:/home/gradle/.gradle" \ - -v "dropbox-sign-sdk-maven-cache:/root/.m2" \ + -v "dropbox-sign-sdk-v1-gradle-cache:/home/gradle/.gradle" \ + -v "dropbox-sign-sdk-v1-maven-cache:/root/.m2" \ -w "${WORKING_DIR}" \ -e GEN_DIR=/app \ gradle:7.6.1-jdk11 "$@" diff --git a/build.gradle b/build.gradle index ba1071a..8770be1 100644 --- a/build.gradle +++ b/build.gradle @@ -6,22 +6,22 @@ buildscript { 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' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' } } plugins { id 'com.vanniktech.maven.publish' version '0.24.0' + id 'com.diffplug.spotless' version '6.25.0' } apply plugin: 'java' apply plugin: 'maven-publish' -apply plugin: 'com.diffplug.spotless' apply plugin: 'signing' group = 'com.dropbox.sign' archivesBaseName = 'dropbox-sign' -version = '1.6.0' +version = '1.6.1' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -170,7 +170,8 @@ spotless { 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() + googleJavaFormat('1.23.0').aosp().reflowLongStrings() + formatAnnotations() removeUnusedImports() importOrder() } diff --git a/build.sbt b/build.sbt index cb4b33a..df03cf3 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "1.6.0", + version := "1.6.1", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/gradle.properties b/gradle.properties index 53d9dbe..16b83ff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=1.6.0 +VERSION_NAME=1.6.1 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/openapi-config.yaml b/openapi-config.yaml index a6ecfdc..8439e41 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -16,7 +16,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "1.6.0" + artifactVersion: "1.6.1" 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 @@ -25,11 +25,15 @@ additionalProperties: licenseName: MIT License licenseUrl: https://www.opensource.org/licenses/mit-license.php useCustomTemplateCode: true + licenseCopyrightYear: 2024 files: - EventCallbackHelper.mustache: + dropbox-EventCallbackHelper.mustache: templateType: SupportingFiles destinationFilename: src/main/java/com/dropbox/sign/EventCallbackHelper.java - VERSION.mustache: + dropbox-LICENSE.mustache: + templateType: SupportingFiles + destinationFilename: LICENSE + dropbox-VERSION.mustache: templateType: SupportingFiles destinationFilename: VERSION globalProperties: diff --git a/pom.xml b/pom.xml index 93887dd..63a2be0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 1.6.0 + 1.6.1 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! diff --git a/run-build b/run-build index 1e1cfec..44a8c55 100755 --- a/run-build +++ b/run-build @@ -51,6 +51,7 @@ fi rm -rf "${DIR}/api" printf "Building ...\n" +bash "${DIR}/bin/gradle" ./gradlew spotlessApply bash "${DIR}/bin/gradle" ./gradlew clean build printf "Success!\n" diff --git a/src/main/java/com/dropbox/sign/ApiClient.java b/src/main/java/com/dropbox/sign/ApiClient.java index 09041f2..84a8956 100644 --- a/src/main/java/com/dropbox/sign/ApiClient.java +++ b/src/main/java/com/dropbox/sign/ApiClient.java @@ -10,9 +10,44 @@ * Do not edit the class manually. */ - package com.dropbox.sign; +import com.dropbox.sign.auth.ApiKeyAuth; +import com.dropbox.sign.auth.Authentication; +import com.dropbox.sign.auth.HttpBasicAuth; +import com.dropbox.sign.auth.HttpBearerAuth; +import com.dropbox.sign.model.ErrorResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; @@ -23,1234 +58,1271 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; - 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.logging.LoggingFeature; 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; +/** ApiClient class. */ +@javax.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]*(;.*)?$"); + + 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 LinkedHashMap<>()))); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + 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<>())))); + operationServers.put( + "OAuthApi.oauthTokenRefresh", + new ArrayList<>( + Arrays.asList( + new ServerConfiguration( + "https://app.hellosign.com", + "No description provided", + new LinkedHashMap<>())))); + this.operationServers = operationServers; + } -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; -import java.time.OffsetDateTime; + 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; -import java.net.URLEncoder; + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; -import java.io.File; -import java.io.UnsupportedEncodingException; + protected Map authentications; + protected Map authenticationLookup; -import java.text.DateFormat; -import java.util.regex.Matcher; -import java.util.regex.Pattern; + protected DateFormat dateFormat; -import com.dropbox.sign.auth.Authentication; -import com.dropbox.sign.auth.HttpBasicAuth; -import com.dropbox.sign.auth.HttpBearerAuth; -import com.dropbox.sign.auth.ApiKeyAuth; -import com.dropbox.sign.model.ErrorResponse; + /** Constructs a new ApiClient with default parameters. */ + public ApiClient() { + this(null); + } -/** - *

ApiClient class.

- */ -@javax.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]*(;.*)?$"); - - 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 LinkedHashMap<>() - ) - )); - protected Integer serverIndex = 0; - protected Map serverVariables = null; - 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<>() - ) - ))); - operationServers.put("OAuthApi.oauthTokenRefresh", new ArrayList<>(Arrays.asList( - new ServerConfiguration( - "https://app.hellosign.com", - "No description provided", - new LinkedHashMap<>() - ) - ))); - this.operationServers = operationServers; - } - - 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("OpenAPI-Generator/1.6.0/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<>(); - Authentication auth = null; - if (authMap != null) { - auth = authMap.get("api_key"); + /** + * 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("OpenAPI-Generator/1.6.1/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + Authentication auth = null; + if (authMap != null) { + auth = authMap.get("api_key"); + } + if (auth instanceof HttpBasicAuth) { + authentications.put("api_key", auth); + } else { + authentications.put("api_key", new HttpBasicAuth()); + } + if (authMap != null) { + auth = authMap.get("oauth2"); + } + if (auth instanceof HttpBearerAuth) { + authentications.put("oauth2", auth); + } else { + authentications.put("oauth2", new HttpBearerAuth("bearer")); + } + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap<>(); } - if (auth instanceof HttpBasicAuth) { - authentications.put("api_key", auth); - } else { - authentications.put("api_key", new HttpBasicAuth()); + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; } - if (authMap != null) { - auth = authMap.get("oauth2"); + + /** + * Getter for the field httpClient. + * + * @return a {@link javax.ws.rs.client.Client} object. + */ + public Client getHttpClient() { + return httpClient; } - if (auth instanceof HttpBearerAuth) { - authentications.put("oauth2", auth); - } else { - authentications.put("oauth2", new HttpBearerAuth("bearer")); + + /** + * Setter for the field httpClient. + * + * @param httpClient a {@link javax.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. + */ + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; } - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - - // Setup authentication lookup (key: authentication alias, value: authentication name) - authenticationLookup = new HashMap<>(); - } - - /** - * 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 javax.ws.rs.client.Client} object. - */ - public Client getHttpClient() { - return httpClient; - } - - /** - *

Setter for the field httpClient.

- * - * @param httpClient a {@link javax.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; - 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)); + + /** + * 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; } - } - - /** - * 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); + + /** + * 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; 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; - } + + /** + * Getter for the field servers. + * + * @return a {@link java.util.List} of servers. + */ + public List getServers() { + return servers; } - 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 HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(apiKey); + + /** + * 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; - } else if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); + } + + /** + * 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; - } } - 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); + + /** + * 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; - } } - throw new RuntimeException("No Bearer authentication configured!"); - } - - /** - * 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); + + private void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); + } + } + + /** + * 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); } - } - - /** - * 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); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(','); + + /** + * 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; + } } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); + throw new RuntimeException("No HTTP basic authentication configured!"); } - } - - /* - * 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; + + /** + * 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!"); } - if (valueCollection.isEmpty()){ - return params; + /** + * 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 HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(apiKey); + return this; + } else if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); } - // get the collection format (default: csv) - String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + /** + * 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!"); + } - // create the params based on the collection format - if ("multi".equals(format)) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } + /** + * 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; + } - return params; + /** + * Get the User-Agent header's value. + * + * @return User-Agent string + */ + public String getUserAgent() { + return userAgent; } - String delimiter = ","; + /** + * 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; + } - if ("csv".equals(format)) { - delimiter = ","; - } else if ("ssv".equals(format)) { - delimiter = " "; - } else if ("tsv".equals(format)) { - delimiter = "\t"; - } else if ("pipes".equals(format)) { - delimiter = "|"; + /** + * 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; } - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); + /** + * Gets the client config. + * + * @return Client config + */ + public ClientConfig getClientConfig() { + return clientConfig; } - 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; + /** + * 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; } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; } - 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"; + + /** + * 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; } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } + + /** + * 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; } - 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; + + /** + * Set temp folder path + * + * @param tempFolderPath Temp folder path + * @return a {@link ApiClient} object. + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; } - } - - /** - * 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()))); + + /** + * 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); } - } - 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); + } + + /** + * 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); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } 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 { - entity = Entity.entity(obj == null ? "null" : obj, contentType); + return String.valueOf(param); } - } else { - if (obj instanceof String) { - entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } + + /* + * 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 { - entity = Entity.entity(obj == null ? "" : obj, contentType); + params.add(new Pair(name, parameterToString(value))); + return params; } - } - } - 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 (valueCollection.isEmpty()) { + return params; } - if (formString.length() == 0) { // empty string - return formString; - } else { - return formString.substring(0, formString.length() - 1); + // 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; } - } else { - if (isBodyNullable) { - return obj == null ? "null" : json.getMapper().writeValueAsString(obj); - } else { - return obj == null ? "" : json.getMapper().writeValueAsString(obj); + + 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 = "|"; } - } - } 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; + + 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; } - 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; + /** + * 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()); } - // 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); + /** + * 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, ","); } - } - - /** - *

Prepare the file for download from the response.

- * - * @param response a {@link javax.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); + + /** + * 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]; } - 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-"; + /** + * 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; + } } - 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; + /** + * 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; } - // 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())); + + /** + * 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()); } - } } - Invocation.Builder invocationBuilder = target.request(); + /** + * 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 (accept != null) { - invocationBuilder = invocationBuilder.accept(accept); - } + 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; + } - for (Entry entry : cookieParams.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); - } - } + // read the entity stream multiple times + response.bufferEntity(); - for (Entry entry : defaultCookieMap.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); - } + return response.readEntity(returnType); } - 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, - null, - method, - target.getUri()); + /** + * 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); + } } - for (Entry entry : allHeaderParams.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(entry.getKey(), value); - } + /** + * Prepare the file for download from the response. + * + * @param response a {@link javax.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(); } - Response response = null; + /** + * 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())); + } + } + } - try { - response = sendRequest(method, invocationBuilder, entity); + Invocation.Builder invocationBuilder = target.request(); - final int statusCode = response.getStatusInfo().getStatusCode(); + if (accept != null) { + invocationBuilder = invocationBuilder.accept(accept); + } - Map> responseHeaders = buildResponseHeaders(response); + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } - 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)); + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } } - } 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; + + 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, + null, + 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(); + + 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 { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; + 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; + } + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody, + errorResponse); + } + } 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 } - } catch (RuntimeException e) { - // e.printStackTrace(); - } } - throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody, errorResponse); - } - } 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); + + 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; } - 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); + + /** + * @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); } - 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 javax.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 javax.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) { + /** + * 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); } - @Override - public void checkServerTrusted(X509Certificate[] certs, String authType) { + + 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 javax.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 javax.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 javax.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); } - } - }; - SSLContext sslContext = SSLContext.getInstance("TLS"); - sslContext.init(null, trustAllCerts, new SecureRandom()); - clientBuilder.sslContext(sslContext); - } - - /** - *

Build the response headers.

- * - * @param response a {@link javax.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; } - 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); + + /** + * 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/src/main/java/com/dropbox/sign/ApiException.java b/src/main/java/com/dropbox/sign/ApiException.java index 92ae80e..28ae24f 100644 --- a/src/main/java/com/dropbox/sign/ApiException.java +++ b/src/main/java/com/dropbox/sign/ApiException.java @@ -10,17 +10,16 @@ * Do not edit the class manually. */ - package com.dropbox.sign; -import java.util.Map; -import java.util.List; import com.dropbox.sign.model.ErrorResponse; +import java.util.List; +import java.util.Map; -/** - * API Exception - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** API Exception */ +@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; @@ -39,18 +38,31 @@ public ApiException(String message) { super(message); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders, + String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(String message, int code, Map> responseHeaders, String 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) { + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders) { this(message, throwable, code, responseHeaders, null); } @@ -63,13 +75,22 @@ public ApiException(int code, String message) { this.code = code; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + public ApiException( + int code, + String message, + Map> responseHeaders, + String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody, ErrorResponse errorResponse) { + public ApiException( + int code, + String message, + Map> responseHeaders, + String responseBody, + ErrorResponse errorResponse) { this(code, message, responseHeaders, responseBody); this.errorResponse = errorResponse; } diff --git a/src/main/java/com/dropbox/sign/ApiResponse.java b/src/main/java/com/dropbox/sign/ApiResponse.java index 7105de6..7f5f370 100644 --- a/src/main/java/com/dropbox/sign/ApiResponse.java +++ b/src/main/java/com/dropbox/sign/ApiResponse.java @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.dropbox.sign; import java.util.List; diff --git a/src/main/java/com/dropbox/sign/Configuration.java b/src/main/java/com/dropbox/sign/Configuration.java index 4b06232..5abb0ba 100644 --- a/src/main/java/com/dropbox/sign/Configuration.java +++ b/src/main/java/com/dropbox/sign/Configuration.java @@ -10,18 +10,19 @@ * Do not edit the class manually. */ - package com.dropbox.sign; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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.0"; + public static final String VERSION = "1.6.1"; private static ApiClient defaultApiClient = new ApiClient(); /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. + * Get the default API client, which would be used when creating API instances without providing + * an API client. * * @return Default API client */ @@ -30,8 +31,8 @@ public static ApiClient getDefaultApiClient() { } /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. + * Set the default API client, which would be used when creating API instances without providing + * an API client. * * @param apiClient API client */ diff --git a/src/main/java/com/dropbox/sign/EventCallbackHelper.java b/src/main/java/com/dropbox/sign/EventCallbackHelper.java index 39eb4b7..aa9ef43 100644 --- a/src/main/java/com/dropbox/sign/EventCallbackHelper.java +++ b/src/main/java/com/dropbox/sign/EventCallbackHelper.java @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.dropbox.sign; import com.dropbox.sign.model.EventCallbackRequest; @@ -18,7 +17,9 @@ import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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"; @@ -27,34 +28,33 @@ public class EventCallbackHelper { private EventCallbackHelper() {} /** - * Verify that a callback came from HelloSign.com - * - * @param apiKey - * @param eventCallback - * @return a boolean value indicating whether the callback event is valid - */ + * Verify that a callback came from HelloSign.com + * + * @param apiKey + * @param eventCallback + * @return a boolean value indicating whether the callback event is valid + */ public static boolean isValid(String apiKey, EventCallbackRequest eventCallback) { return new HmacUtils(HmacAlgorithms.HMAC_SHA_256, apiKey) - .hmacHex(eventCallback.getEvent().getEventTime() + eventCallback.getEvent().getEventType()) - .equals(eventCallback.getEvent().getEventHash()); + .hmacHex( + eventCallback.getEvent().getEventTime() + + eventCallback.getEvent().getEventType()) + .equals(eventCallback.getEvent().getEventHash()); } /** - * Identifies the callback type, one of "account_callback" or - * "app_callback". + * Identifies the callback type, one of "account_callback" or "app_callback". * - * "app_callback" will always include a value for "reported_for_app_id" + *

"app_callback" will always include a value for "reported_for_app_id" * * @param eventCallback */ public static String getCallbackType(EventCallbackRequest eventCallback) { EventCallbackRequestEventMetadata metadata = eventCallback.getEvent().getEventMetadata(); - if ( - metadata == null || - metadata.getReportedForAppId() == null || - metadata.getReportedForAppId().isEmpty() - ) { + if (metadata == null + || metadata.getReportedForAppId() == null + || metadata.getReportedForAppId().isEmpty()) { return EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK; } diff --git a/src/main/java/com/dropbox/sign/JSON.java b/src/main/java/com/dropbox/sign/JSON.java index 638c43f..5bcb473 100644 --- a/src/main/java/com/dropbox/sign/JSON.java +++ b/src/main/java/com/dropbox/sign/JSON.java @@ -10,15 +10,13 @@ * Do not edit the class manually. */ - package com.dropbox.sign; +import com.dropbox.sign.model.*; 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.dropbox.sign.model.*; - import java.text.DateFormat; import java.util.HashMap; import java.util.HashSet; @@ -27,233 +25,237 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.ext.ContextResolver; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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 = 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(); - } - - /** - * 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; - } + private ObjectMapper 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<>()); + public JSON() { + 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(); } - 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); - } + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); } - // Return the name of the discriminator property for this model class. - String getDiscriminatorPropertyName() { - return discriminatorName; + @Override + public ObjectMapper getContext(Class type) { + return mapper; } - // 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; + /** + * 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. - * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. - * The discriminator mappings are used to determine the target model class. + * 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 visitedClasses The set of classes that have already been visited. + * @param modelClass The class that contains the discriminator mappings. */ - 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) { + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } 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; + } + + /** 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); + } } - if (!discriminatorName.equals(childCdm.discriminatorName)) { - discrValue = getDiscriminatorValue(node); - if (discrValue == null) { - continue; - } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; } - if (childCdm != null) { - // Recursively traverse the discriminator mappings. - Class childDiscr = childCdm.getClassForElement(node, visitedClasses); - if (childDiscr != null) { - return childDiscr; - } + + // 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; } - } - 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)) { - return true; - } - if (visitedClasses.contains(modelClass)) { - // This is to prevent infinite recursion when the composed schemas have - // a circular dependency. - return false; + /** + * 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; + } } - 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; + /** + * 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)) { + 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; } - return false; - } - /** - * A map of discriminators for all model classes. - */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + /** 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<>(); + /** 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 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); - } + /** + * 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; + private static JSON json; - static - { - json = new JSON(); - } + static { + json = new JSON(); + } - /** - * Get the default JSON instance. - * - * @return the default JSON instance - */ - public static JSON getDefault() { - return 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; - } + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } } diff --git a/src/main/java/com/dropbox/sign/JavaTimeFormatter.java b/src/main/java/com/dropbox/sign/JavaTimeFormatter.java index 5458541..caf886a 100644 --- a/src/main/java/com/dropbox/sign/JavaTimeFormatter.java +++ b/src/main/java/com/dropbox/sign/JavaTimeFormatter.java @@ -17,16 +17,20 @@ 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}. + * 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", comments = "Generator version: 7.8.0") +@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; /** * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * * @return DateTimeFormatter */ public DateTimeFormatter getOffsetDateTimeFormatter() { @@ -35,6 +39,7 @@ public DateTimeFormatter getOffsetDateTimeFormatter() { /** * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * * @param offsetDateTimeFormatter {@code DateTimeFormatter} */ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { @@ -43,6 +48,7 @@ public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter /** * Parse the given string into {@code OffsetDateTime} object. + * * @param str String * @return {@code OffsetDateTime} */ @@ -53,8 +59,10 @@ public OffsetDateTime parseOffsetDateTime(String str) { throw new RuntimeException(e); } } + /** * Format the given {@code OffsetDateTime} object into string. + * * @param offsetDateTime {@code OffsetDateTime} * @return {@code OffsetDateTime} in string format */ diff --git a/src/main/java/com/dropbox/sign/Pair.java b/src/main/java/com/dropbox/sign/Pair.java index 93293ef..d653856 100644 --- a/src/main/java/com/dropbox/sign/Pair.java +++ b/src/main/java/com/dropbox/sign/Pair.java @@ -10,15 +10,16 @@ * Do not edit the class manually. */ - package com.dropbox.sign; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class Pair { private String name = ""; private String value = ""; - public Pair (String name, String value) { + public Pair(String name, String value) { setName(name); setValue(value); } diff --git a/src/main/java/com/dropbox/sign/RFC3339DateFormat.java b/src/main/java/com/dropbox/sign/RFC3339DateFormat.java index 6c3ae75..ae19756 100644 --- a/src/main/java/com/dropbox/sign/RFC3339DateFormat.java +++ b/src/main/java/com/dropbox/sign/RFC3339DateFormat.java @@ -13,46 +13,46 @@ package com.dropbox.sign; import com.fasterxml.jackson.databind.util.StdDateFormat; - import java.text.DateFormat; +import java.text.DecimalFormat; 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") +@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"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - this.numberFormat = new DecimalFormat(); - } - - @Override - public Date parse(String source) { - return parse(source, new ParsePosition(0)); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return super.clone(); - } + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = + new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } } diff --git a/src/main/java/com/dropbox/sign/ServerConfiguration.java b/src/main/java/com/dropbox/sign/ServerConfiguration.java index 3d10c64..dca021d 100644 --- a/src/main/java/com/dropbox/sign/ServerConfiguration.java +++ b/src/main/java/com/dropbox/sign/ServerConfiguration.java @@ -10,15 +10,14 @@ * Do not edit the class manually. */ - package com.dropbox.sign; import java.util.Map; -/** - * Representing a Server configuration. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** 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; @@ -27,9 +26,11 @@ public class ServerConfiguration { /** * @param URL A URL to the target host. * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. */ - public ServerConfiguration(String URL, String description, Map variables) { + public ServerConfiguration( + String URL, String description, Map variables) { this.URL = URL; this.description = description; this.variables = variables; @@ -45,15 +46,21 @@ public String URL(Map variables) { String url = this.URL; // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { + for (Map.Entry variable : this.variables.entrySet()) { String name = variable.getKey(); ServerVariable serverVariable = variable.getValue(); String value = serverVariable.defaultValue; if (variables != null && variables.containsKey(name)) { value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + if (serverVariable.enumValues.size() > 0 + && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + + name + + " in the server URL has invalid value " + + value + + "."); } } url = url.replace("{" + name + "}", value); diff --git a/src/main/java/com/dropbox/sign/ServerVariable.java b/src/main/java/com/dropbox/sign/ServerVariable.java index 39b0850..4a32ae6 100644 --- a/src/main/java/com/dropbox/sign/ServerVariable.java +++ b/src/main/java/com/dropbox/sign/ServerVariable.java @@ -10,15 +10,14 @@ * Do not edit the class manually. */ - package com.dropbox.sign; import java.util.HashSet; -/** - * Representing a Server Variable for server URL template substitution. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** 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; @@ -27,7 +26,8 @@ public class ServerVariable { /** * @param description A description for the server variable. * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. */ public ServerVariable(String description, String defaultValue, HashSet enumValues) { this.description = description; diff --git a/src/main/java/com/dropbox/sign/StringUtil.java b/src/main/java/com/dropbox/sign/StringUtil.java index b71b4c2..00a83e8 100644 --- a/src/main/java/com/dropbox/sign/StringUtil.java +++ b/src/main/java/com/dropbox/sign/StringUtil.java @@ -10,74 +10,74 @@ * Do not edit the class manually. */ - package com.dropbox.sign; import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; } - return false; - } - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } + /** + * Join an array of strings with the given separator. + * + *

Note: This might be replaced by utility method from commons-lang or guava someday if one + * of those libraries is added as dependency. + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); } - return out.toString(); - } - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); } - return out.toString(); - } } diff --git a/src/main/java/com/dropbox/sign/api/AccountApi.java b/src/main/java/com/dropbox/sign/api/AccountApi.java index 7417244..f460b47 100644 --- a/src/main/java/com/dropbox/sign/api/AccountApi.java +++ b/src/main/java/com/dropbox/sign/api/AccountApi.java @@ -1,345 +1,372 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.AccountCreateRequest; import com.dropbox.sign.model.AccountCreateResponse; import com.dropbox.sign.model.AccountGetResponse; import com.dropbox.sign.model.AccountUpdateRequest; import com.dropbox.sign.model.AccountVerifyRequest; import com.dropbox.sign.model.AccountVerifyResponse; -import com.dropbox.sign.model.ErrorResponse; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class AccountApi { - private ApiClient apiClient; - - public AccountApi() { - this(Configuration.getDefaultApiClient()); - } + private ApiClient apiClient; - public AccountApi(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; - } - - /** - * Create Account - * Creates a new Dropbox Sign Account that is associated with the specified `email_address`. - * @param accountCreateRequest (required) - * @return AccountCreateResponse - * @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 AccountCreateResponse accountCreate(AccountCreateRequest accountCreateRequest) throws ApiException { - return accountCreateWithHttpInfo(accountCreateRequest).getData(); - } - - - /** - * Create Account - * Creates a new Dropbox Sign Account that is associated with the specified `email_address`. - * @param accountCreateRequest (required) - * @return ApiResponse<AccountCreateResponse> - * @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 accountCreateWithHttpInfo(AccountCreateRequest accountCreateRequest) throws ApiException { - - // Check required parameters - if (accountCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'accountCreateRequest' when calling accountCreate"); + public AccountApi() { + this(Configuration.getDefaultApiClient()); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Get Account - * Returns the properties and settings of your Account. - * @param accountId `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param emailAddress `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @return AccountGetResponse - * @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 AccountGetResponse accountGet(String accountId, String emailAddress) throws ApiException { - return accountGetWithHttpInfo(accountId, emailAddress).getData(); - } - - - /** - * @see AccountApi#accountGet(String, String) - */ - public AccountGetResponse accountGet() throws ApiException { - String accountId = null; - String emailAddress = null; + public AccountApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - return accountGetWithHttpInfo(accountId, emailAddress).getData(); - } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - /** - * @see AccountApi#accountGetWithHttpInfo(String, String) - */ - public ApiResponse accountGetWithHttpInfo() throws ApiException { - String accountId = null; - String emailAddress = null; + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } - return accountGetWithHttpInfo(accountId, emailAddress); - } + /** + * Create Account. Creates a new Dropbox Sign Account that is associated with the specified + * `email_address`. + * + * @param accountCreateRequest (required) + * @return AccountCreateResponse + * @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 AccountCreateResponse accountCreate(AccountCreateRequest accountCreateRequest) + throws ApiException { + return accountCreateWithHttpInfo(accountCreateRequest).getData(); + } - /** - * @see AccountApi#accountGet(String, String) - */ - public AccountGetResponse accountGet(String accountId) throws ApiException { - String emailAddress = null; + /** + * Create Account. Creates a new Dropbox Sign Account that is associated with the specified + * `email_address`. + * + * @param accountCreateRequest (required) + * @return ApiResponse<AccountCreateResponse> + * @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 accountCreateWithHttpInfo( + AccountCreateRequest accountCreateRequest) throws ApiException { + + // Check required parameters + if (accountCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'accountCreateRequest' when calling" + + " accountCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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 accountGetWithHttpInfo(accountId, emailAddress).getData(); - } + /** + * Get Account. Returns the properties and settings of your Account. + * + * @param accountId `account_id` or `email_address` is required. If both are + * provided, the account id prevails. The ID of the Account. (optional) + * @param emailAddress `account_id` or `email_address` is required, If both + * are provided, the account id prevails. The email address of the Account. (optional) + * @return AccountGetResponse + * @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 AccountGetResponse accountGet(String accountId, String emailAddress) + throws ApiException { + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } - /** - * @see AccountApi#accountGetWithHttpInfo(String, String) - */ - public ApiResponse accountGetWithHttpInfo(String accountId) throws ApiException { - String emailAddress = null; + /** + * @see AccountApi#accountGet(String, String) + */ + public AccountGetResponse accountGet() throws ApiException { + String accountId = null; + String emailAddress = null; - return accountGetWithHttpInfo(accountId, emailAddress); - } + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } + /** + * @see AccountApi#accountGetWithHttpInfo(String, String) + */ + public ApiResponse accountGetWithHttpInfo() throws ApiException { + String accountId = null; + String emailAddress = null; - /** - * Get Account - * Returns the properties and settings of your Account. - * @param accountId `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. (optional) - * @param emailAddress `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) - * @return ApiResponse<AccountGetResponse> - * @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 accountGetWithHttpInfo(String accountId, String emailAddress) throws ApiException { - - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "account_id", accountId) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); + return accountGetWithHttpInfo(accountId, emailAddress); + } - 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"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "AccountApi.accountGet", - "/account", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); + /** + * @see AccountApi#accountGet(String, String) + */ + public AccountGetResponse accountGet(String accountId) throws ApiException { + String emailAddress = null; - } - /** - * 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 accountUpdateRequest (required) - * @return AccountGetResponse - * @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 AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateRequest) throws ApiException { - return accountUpdateWithHttpInfo(accountUpdateRequest).getData(); - } + return accountGetWithHttpInfo(accountId, emailAddress).getData(); + } + /** + * @see AccountApi#accountGetWithHttpInfo(String, String) + */ + public ApiResponse accountGetWithHttpInfo(String accountId) + throws ApiException { + String emailAddress = null; - /** - * 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 accountUpdateRequest (required) - * @return ApiResponse<AccountGetResponse> - * @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 accountUpdateWithHttpInfo(AccountUpdateRequest accountUpdateRequest) throws ApiException { - - // Check required parameters - if (accountUpdateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'accountUpdateRequest' when calling accountUpdate"); + return accountGetWithHttpInfo(accountId, emailAddress); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Verify Account - * Verifies whether an Dropbox Sign Account exists for the given email address. - * @param accountVerifyRequest (required) - * @return AccountVerifyResponse - * @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 AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyRequest) throws ApiException { - return accountVerifyWithHttpInfo(accountVerifyRequest).getData(); - } + /** + * Get Account. Returns the properties and settings of your Account. + * + * @param accountId `account_id` or `email_address` is required. If both are + * provided, the account id prevails. The ID of the Account. (optional) + * @param emailAddress `account_id` or `email_address` is required, If both + * are provided, the account id prevails. The email address of the Account. (optional) + * @return ApiResponse<AccountGetResponse> + * @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 accountGetWithHttpInfo( + String accountId, String emailAddress) throws ApiException { + + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "email_address", emailAddress)); + + 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"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "AccountApi.accountGet", + "/account", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + /** + * 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 accountUpdateRequest (required) + * @return AccountGetResponse + * @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 AccountGetResponse accountUpdate(AccountUpdateRequest accountUpdateRequest) + throws ApiException { + return accountUpdateWithHttpInfo(accountUpdateRequest).getData(); + } - /** - * Verify Account - * Verifies whether an Dropbox Sign Account exists for the given email address. - * @param accountVerifyRequest (required) - * @return ApiResponse<AccountVerifyResponse> - * @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 accountVerifyWithHttpInfo(AccountVerifyRequest accountVerifyRequest) throws ApiException { - - // Check required parameters - if (accountVerifyRequest == null) { - throw new ApiException(400, "Missing the required parameter 'accountVerifyRequest' when calling accountVerify"); + /** + * 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 accountUpdateRequest (required) + * @return ApiResponse<AccountGetResponse> + * @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 accountUpdateWithHttpInfo( + AccountUpdateRequest accountUpdateRequest) throws ApiException { + + // Check required parameters + if (accountUpdateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'accountUpdateRequest' when calling" + + " accountUpdate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = accountVerifyRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * Verify Account. Verifies whether an Dropbox Sign Account exists for the given email address. + * + * @param accountVerifyRequest (required) + * @return AccountVerifyResponse + * @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 AccountVerifyResponse accountVerify(AccountVerifyRequest accountVerifyRequest) + throws ApiException { + return accountVerifyWithHttpInfo(accountVerifyRequest).getData(); + } - } -} \ No newline at end of file + /** + * Verify Account. Verifies whether an Dropbox Sign Account exists for the given email address. + * + * @param accountVerifyRequest (required) + * @return ApiResponse<AccountVerifyResponse> + * @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 accountVerifyWithHttpInfo( + AccountVerifyRequest accountVerifyRequest) throws ApiException { + + // Check required parameters + if (accountVerifyRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'accountVerifyRequest' when calling" + + " accountVerify"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = accountVerifyRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/ApiAppApi.java b/src/main/java/com/dropbox/sign/api/ApiAppApi.java index 2ca807e..2c5ed44 100644 --- a/src/main/java/com/dropbox/sign/api/ApiAppApi.java +++ b/src/main/java/com/dropbox/sign/api/ApiAppApi.java @@ -1,426 +1,452 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.ApiAppCreateRequest; import com.dropbox.sign.model.ApiAppGetResponse; import com.dropbox.sign.model.ApiAppListResponse; import com.dropbox.sign.model.ApiAppUpdateRequest; -import com.dropbox.sign.model.ErrorResponse; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class ApiAppApi { - private ApiClient apiClient; - - public ApiAppApi() { - this(Configuration.getDefaultApiClient()); - } - - public ApiAppApi(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; - } - - /** - * Create API App - * Creates a new API App. - * @param apiAppCreateRequest (required) - * @return ApiAppGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - return apiAppCreateWithHttpInfo(apiAppCreateRequest).getData(); - } - - - /** - * Create API App - * Creates a new API App. - * @param apiAppCreateRequest (required) - * @return ApiResponse<ApiAppGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppCreateWithHttpInfo(ApiAppCreateRequest apiAppCreateRequest) throws ApiException { - - // Check required parameters - if (apiAppCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'apiAppCreateRequest' when calling apiAppCreate"); + private ApiClient apiClient; + + public ApiAppApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiAppApi(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; + } + + /** + * Create API App. Creates a new API App. + * + * @param apiAppCreateRequest (required) + * @return ApiAppGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiAppGetResponse apiAppCreate(ApiAppCreateRequest apiAppCreateRequest) + throws ApiException { + return apiAppCreateWithHttpInfo(apiAppCreateRequest).getData(); + } + + /** + * Create API App. Creates a new API App. + * + * @param apiAppCreateRequest (required) + * @return ApiResponse<ApiAppGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppCreateWithHttpInfo( + ApiAppCreateRequest apiAppCreateRequest) throws ApiException { + + // Check required parameters + if (apiAppCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'apiAppCreateRequest' when calling" + + " apiAppCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = apiAppCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = apiAppCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Delete API App - * Deletes an API App. Can only be invoked for apps you own. - * @param clientId The client id of the API App to delete. (required) - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public void apiAppDelete(String clientId) throws ApiException { - apiAppDeleteWithHttpInfo(clientId); - } - - - /** - * Delete API App - * Deletes an API App. Can only be invoked for apps you own. - * @param clientId The client id of the API App to delete. (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppDelete"); + /** + * Delete API App. Deletes an API App. Can only be invoked for apps you own. + * + * @param clientId The client id of the API App to delete. (required) + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public void apiAppDelete(String clientId) throws ApiException { + apiAppDeleteWithHttpInfo(clientId); } - // 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(); - 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 - * Returns an object with information about an API App. - * @param clientId The client id of the API App to retrieve. (required) - * @return ApiAppGetResponse - * @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 ApiAppGetResponse apiAppGet(String clientId) throws ApiException { - return apiAppGetWithHttpInfo(clientId).getData(); - } - - - /** - * Get API App - * Returns an object with information about an API App. - * @param clientId The client id of the API App to retrieve. (required) - * @return ApiResponse<ApiAppGetResponse> - * @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 apiAppGetWithHttpInfo(String clientId) throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppGet"); + /** + * Delete API App. Deletes an API App. Can only be invoked for apps you own. + * + * @param clientId The client id of the API App to delete. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
204 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse apiAppDeleteWithHttpInfo(String clientId) throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientId' when calling apiAppDelete"); + } + + // 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(); + 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); } - // 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(); - 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 - ); - - } - /** - * 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`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return ApiAppListResponse - * @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 ApiAppListResponse apiAppList(Integer page, Integer pageSize) throws ApiException { - return apiAppListWithHttpInfo(page, pageSize).getData(); - } - - - /** - * @see ApiAppApi#apiAppList(Integer, Integer) - */ - public ApiAppListResponse apiAppList() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) - */ - public ApiResponse apiAppListWithHttpInfo() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize); - } - - /** - * @see ApiAppApi#apiAppList(Integer, Integer) - */ - public ApiAppListResponse apiAppList(Integer page) throws ApiException { - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) - */ - public ApiResponse apiAppListWithHttpInfo(Integer page) throws ApiException { - Integer pageSize = 20; - - return apiAppListWithHttpInfo(page, pageSize); - } - - - /** - * 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`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<ApiAppListResponse> - * @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 apiAppListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; + /** + * Get API App. Returns an object with information about an API App. + * + * @param clientId The client id of the API App to retrieve. (required) + * @return ApiAppGetResponse + * @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 ApiAppGetResponse apiAppGet(String clientId) throws ApiException { + return apiAppGetWithHttpInfo(clientId).getData(); } - if (pageSize == null) { - pageSize = 20; + + /** + * Get API App. Returns an object with information about an API App. + * + * @param clientId The client id of the API App to retrieve. (required) + * @return ApiResponse<ApiAppGetResponse> + * @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 apiAppGetWithHttpInfo(String clientId) + throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientId' when calling apiAppGet"); + } + + // 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(); + 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); + } + + /** + * 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`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return ApiAppListResponse + * @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 ApiAppListResponse apiAppList(Integer page, Integer pageSize) throws ApiException { + return apiAppListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see ApiAppApi#apiAppList(Integer, Integer) + */ + public ApiAppListResponse apiAppList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) + */ + public ApiResponse apiAppListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize); } - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "page", page) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "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 - ); - - } - /** - * 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 clientId The client id of the API App to update. (required) - * @param apiAppUpdateRequest (required) - * @return ApiAppGetResponse - * @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 ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - return apiAppUpdateWithHttpInfo(clientId, apiAppUpdateRequest).getData(); - } - - - /** - * 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 clientId The client id of the API App to update. (required) - * @param apiAppUpdateRequest (required) - * @return ApiResponse<ApiAppGetResponse> - * @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 apiAppUpdateWithHttpInfo(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { - - // Check required parameters - if (clientId == null) { - throw new ApiException(400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); + + /** + * @see ApiAppApi#apiAppList(Integer, Integer) + */ + public ApiAppListResponse apiAppList(Integer page) throws ApiException { + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize).getData(); } - if (apiAppUpdateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'apiAppUpdateRequest' when calling apiAppUpdate"); + + /** + * @see ApiAppApi#apiAppListWithHttpInfo(Integer, Integer) + */ + public ApiResponse apiAppListWithHttpInfo(Integer page) + throws ApiException { + Integer pageSize = 20; + + return apiAppListWithHttpInfo(page, pageSize); } - // 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(); - 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 - ); - - } -} \ No newline at end of file + /** + * 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`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<ApiAppListResponse> + * @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 apiAppListWithHttpInfo(Integer page, Integer pageSize) + throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "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); + } + + /** + * 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 clientId The client id of the API App to update. (required) + * @param apiAppUpdateRequest (required) + * @return ApiAppGetResponse + * @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 ApiAppGetResponse apiAppUpdate(String clientId, ApiAppUpdateRequest apiAppUpdateRequest) + throws ApiException { + return apiAppUpdateWithHttpInfo(clientId, apiAppUpdateRequest).getData(); + } + + /** + * 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 clientId The client id of the API App to update. (required) + * @param apiAppUpdateRequest (required) + * @return ApiResponse<ApiAppGetResponse> + * @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 apiAppUpdateWithHttpInfo( + String clientId, ApiAppUpdateRequest apiAppUpdateRequest) throws ApiException { + + // Check required parameters + if (clientId == null) { + throw new ApiException( + 400, "Missing the required parameter 'clientId' when calling apiAppUpdate"); + } + if (apiAppUpdateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'apiAppUpdateRequest' when calling" + + " apiAppUpdate"); + } + + // 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(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java b/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java index 5657327..07cbd6a 100644 --- a/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java +++ b/src/main/java/com/dropbox/sign/api/BulkSendJobApi.java @@ -1,282 +1,298 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.BulkSendJobGetResponse; import com.dropbox.sign.model.BulkSendJobListResponse; -import com.dropbox.sign.model.ErrorResponse; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class BulkSendJobApi { - private ApiClient apiClient; - - public BulkSendJobApi() { - this(Configuration.getDefaultApiClient()); - } - - public BulkSendJobApi(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; - } - - /** - * Get Bulk Send Job - * Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. - * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) - * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @return BulkSendJobGetResponse - * @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 BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); - } - - - /** - * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) - */ - public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); - } - - /** - * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) - */ - public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId, Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); - } - - - /** - * Get Bulk Send Job - * Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. - * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) - * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @return ApiResponse<BulkSendJobGetResponse> - * @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 bulkSendJobGetWithHttpInfo(String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; + private ApiClient apiClient; + + public BulkSendJobApi() { + this(Configuration.getDefaultApiClient()); } - if (pageSize == null) { - pageSize = 20; + + public BulkSendJobApi(ApiClient apiClient) { + this.apiClient = apiClient; } - // Check required parameters - if (bulkSendJobId == null) { - throw new ApiException(400, "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; } - // Path parameters - String localVarPath = "/bulk_send_job/{bulk_send_job_id}" - .replaceAll("\\{bulk_send_job_id}", apiClient.escapeString(bulkSendJobId.toString())); - - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "page", page) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "BulkSendJobApi.bulkSendJobGet", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - 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`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @return BulkSendJobListResponse - * @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 BulkSendJobListResponse bulkSendJobList(Integer page, Integer pageSize) throws ApiException { - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - - /** - * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) - */ - public BulkSendJobListResponse bulkSendJobList() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) - */ - public ApiResponse bulkSendJobListWithHttpInfo() throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize); - } - - /** - * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) - */ - public BulkSendJobListResponse bulkSendJobList(Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize).getData(); - } - - /** - * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) - */ - public ApiResponse bulkSendJobListWithHttpInfo(Integer page) throws ApiException { - Integer pageSize = 20; - - return bulkSendJobListWithHttpInfo(page, pageSize); - } - - - /** - * 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`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) - * @return ApiResponse<BulkSendJobListResponse> - * @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 bulkSendJobListWithHttpInfo(Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get Bulk Send Job. Returns the status of the BulkSendJob and its SignatureRequests specified + * by the `bulk_send_job_id` parameter. + * + * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) + * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is 20. (optional, default to 20) + * @return BulkSendJobGetResponse + * @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 BulkSendJobGetResponse bulkSendJobGet( + String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) + */ + public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse bulkSendJobGetWithHttpInfo(String bulkSendJobId) + throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); + } + + /** + * @see BulkSendJobApi#bulkSendJobGet(String, Integer, Integer) + */ + public BulkSendJobGetResponse bulkSendJobGet(String bulkSendJobId, Integer page) + throws ApiException { + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize).getData(); } - if (pageSize == null) { - pageSize = 20; + + /** + * @see BulkSendJobApi#bulkSendJobGetWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse bulkSendJobGetWithHttpInfo( + String bulkSendJobId, Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); + } + + /** + * Get Bulk Send Job. Returns the status of the BulkSendJob and its SignatureRequests specified + * by the `bulk_send_job_id` parameter. + * + * @param bulkSendJobId The id of the BulkSendJob to retrieve. (required) + * @param page Which page number of the BulkSendJob list to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is 20. (optional, default to 20) + * @return ApiResponse<BulkSendJobGetResponse> + * @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 bulkSendJobGetWithHttpInfo( + String bulkSendJobId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Check required parameters + if (bulkSendJobId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'bulkSendJobId' when calling bulkSendJobGet"); + } + + // Path parameters + String localVarPath = + "/bulk_send_job/{bulk_send_job_id}" + .replaceAll( + "\\{bulk_send_job_id}", + apiClient.escapeString(bulkSendJobId.toString())); + + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "BulkSendJobApi.bulkSendJobGet", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + 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`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is 20. (optional, default to 20) + * @return BulkSendJobListResponse + * @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 BulkSendJobListResponse bulkSendJobList(Integer page, Integer pageSize) + throws ApiException { + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) + */ + public BulkSendJobListResponse bulkSendJobList() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) + */ + public ApiResponse bulkSendJobListWithHttpInfo() throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize); + } + + /** + * @see BulkSendJobApi#bulkSendJobList(Integer, Integer) + */ + public BulkSendJobListResponse bulkSendJobList(Integer page) throws ApiException { + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize).getData(); + } + + /** + * @see BulkSendJobApi#bulkSendJobListWithHttpInfo(Integer, Integer) + */ + public ApiResponse bulkSendJobListWithHttpInfo(Integer page) + throws ApiException { + Integer pageSize = 20; + + return bulkSendJobListWithHttpInfo(page, pageSize); + } + + /** + * 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`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is 20. (optional, default to 20) + * @return ApiResponse<BulkSendJobListResponse> + * @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 bulkSendJobListWithHttpInfo( + Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "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); } - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "page", page) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "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 - ); - - } -} \ No newline at end of file +} diff --git a/src/main/java/com/dropbox/sign/api/EmbeddedApi.java b/src/main/java/com/dropbox/sign/api/EmbeddedApi.java index 536cb71..fd04f5b 100644 --- a/src/main/java/com/dropbox/sign/api/EmbeddedApi.java +++ b/src/main/java/com/dropbox/sign/api/EmbeddedApi.java @@ -1,189 +1,208 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; -import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.EmbeddedEditUrlRequest; import com.dropbox.sign.model.EmbeddedEditUrlResponse; import com.dropbox.sign.model.EmbeddedSignUrlResponse; -import com.dropbox.sign.model.ErrorResponse; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class EmbeddedApi { - private ApiClient apiClient; - - public EmbeddedApi() { - this(Configuration.getDefaultApiClient()); - } - - public EmbeddedApi(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; - } - - /** - * 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 templateId The id of the template to edit. (required) - * @param embeddedEditUrlRequest (required) - * @return EmbeddedEditUrlResponse - * @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 EmbeddedEditUrlResponse embeddedEditUrl(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - return embeddedEditUrlWithHttpInfo(templateId, embeddedEditUrlRequest).getData(); - } - - - /** - * 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 templateId The id of the template to edit. (required) - * @param embeddedEditUrlRequest (required) - * @return ApiResponse<EmbeddedEditUrlResponse> - * @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 embeddedEditUrlWithHttpInfo(String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling embeddedEditUrl"); + private ApiClient apiClient; + + public EmbeddedApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmbeddedApi(ApiClient apiClient) { + this.apiClient = apiClient; } - if (embeddedEditUrlRequest == null) { - throw new ApiException(400, "Missing the required parameter 'embeddedEditUrlRequest' when calling embeddedEditUrl"); + + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; } - // 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(); - 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 - ); - - } - /** - * 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 signatureId The id of the signature to get a signature url for. (required) - * @return EmbeddedSignUrlResponse - * @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 EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiException { - return embeddedSignUrlWithHttpInfo(signatureId).getData(); - } - - - /** - * 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 signatureId The id of the signature to get a signature url for. (required) - * @return ApiResponse<EmbeddedSignUrlResponse> - * @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 embeddedSignUrlWithHttpInfo(String signatureId) throws ApiException { - - // Check required parameters - if (signatureId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; } - // 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(); - 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 - ); - - } -} \ No newline at end of file + /** + * 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 templateId The id of the template to edit. (required) + * @param embeddedEditUrlRequest (required) + * @return EmbeddedEditUrlResponse + * @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 EmbeddedEditUrlResponse embeddedEditUrl( + String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { + return embeddedEditUrlWithHttpInfo(templateId, embeddedEditUrlRequest).getData(); + } + + /** + * 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 templateId The id of the template to edit. (required) + * @param embeddedEditUrlRequest (required) + * @return ApiResponse<EmbeddedEditUrlResponse> + * @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 embeddedEditUrlWithHttpInfo( + String templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling embeddedEditUrl"); + } + if (embeddedEditUrlRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'embeddedEditUrlRequest' when calling" + + " embeddedEditUrl"); + } + + // 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(); + 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); + } + + /** + * 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 signatureId The id of the signature to get a signature url for. (required) + * @return EmbeddedSignUrlResponse + * @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 EmbeddedSignUrlResponse embeddedSignUrl(String signatureId) throws ApiException { + return embeddedSignUrlWithHttpInfo(signatureId).getData(); + } + + /** + * 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 signatureId The id of the signature to get a signature url for. (required) + * @return ApiResponse<EmbeddedSignUrlResponse> + * @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 embeddedSignUrlWithHttpInfo(String signatureId) + throws ApiException { + + // Check required parameters + if (signatureId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureId' when calling embeddedSignUrl"); + } + + // 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(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/FaxLineApi.java b/src/main/java/com/dropbox/sign/api/FaxLineApi.java index 8bc5356..8d67ba4 100644 --- a/src/main/java/com/dropbox/sign/api/FaxLineApi.java +++ b/src/main/java/com/dropbox/sign/api/FaxLineApi.java @@ -1,14 +1,10 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import 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; @@ -16,653 +12,692 @@ 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; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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 + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/OAuthApi.java b/src/main/java/com/dropbox/sign/api/OAuthApi.java index be563cb..f9e6d08 100644 --- a/src/main/java/com/dropbox/sign/api/OAuthApi.java +++ b/src/main/java/com/dropbox/sign/api/OAuthApi.java @@ -1,169 +1,186 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; -import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.OAuthTokenGenerateRequest; import com.dropbox.sign.model.OAuthTokenRefreshRequest; import com.dropbox.sign.model.OAuthTokenResponse; - import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class OAuthApi { - private ApiClient apiClient; - - public OAuthApi() { - this(Configuration.getDefaultApiClient()); - } - - public OAuthApi(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; - } - - /** - * 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 oauthTokenGenerateRequest (required) - * @return OAuthTokenResponse - * @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 -
- */ - public OAuthTokenResponse oauthTokenGenerate(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - return oauthTokenGenerateWithHttpInfo(oauthTokenGenerateRequest).getData(); - } + private ApiClient apiClient; + public OAuthApi() { + this(Configuration.getDefaultApiClient()); + } - /** - * 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 oauthTokenGenerateRequest (required) - * @return ApiResponse<OAuthTokenResponse> - * @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 -
- */ - public ApiResponse oauthTokenGenerateWithHttpInfo(OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { - - // Check required parameters - if (oauthTokenGenerateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'oauthTokenGenerateRequest' when calling oauthTokenGenerate"); + public OAuthApi(ApiClient apiClient) { + this.apiClient = apiClient; } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = oauthTokenGenerateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - } - /** - * 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 oauthTokenRefreshRequest (required) - * @return OAuthTokenResponse - * @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 -
- */ - public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - return oauthTokenRefreshWithHttpInfo(oauthTokenRefreshRequest).getData(); - } + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * 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 oauthTokenGenerateRequest (required) + * @return OAuthTokenResponse + * @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 -
+ */ + public OAuthTokenResponse oauthTokenGenerate( + OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { + return oauthTokenGenerateWithHttpInfo(oauthTokenGenerateRequest).getData(); + } - /** - * 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 oauthTokenRefreshRequest (required) - * @return ApiResponse<OAuthTokenResponse> - * @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 -
- */ - public ApiResponse oauthTokenRefreshWithHttpInfo(OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { - - // Check required parameters - if (oauthTokenRefreshRequest == null) { - throw new ApiException(400, "Missing the required parameter 'oauthTokenRefreshRequest' when calling oauthTokenRefresh"); + /** + * 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 oauthTokenGenerateRequest (required) + * @return ApiResponse<OAuthTokenResponse> + * @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 -
+ */ + public ApiResponse oauthTokenGenerateWithHttpInfo( + OAuthTokenGenerateRequest oauthTokenGenerateRequest) throws ApiException { + + // Check required parameters + if (oauthTokenGenerateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'oauthTokenGenerateRequest' when calling" + + " oauthTokenGenerate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = oauthTokenGenerateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = oauthTokenRefreshRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * 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 oauthTokenRefreshRequest (required) + * @return OAuthTokenResponse + * @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 -
+ */ + public OAuthTokenResponse oauthTokenRefresh(OAuthTokenRefreshRequest oauthTokenRefreshRequest) + throws ApiException { + return oauthTokenRefreshWithHttpInfo(oauthTokenRefreshRequest).getData(); + } - } -} \ No newline at end of file + /** + * 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 oauthTokenRefreshRequest (required) + * @return ApiResponse<OAuthTokenResponse> + * @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 -
+ */ + public ApiResponse oauthTokenRefreshWithHttpInfo( + OAuthTokenRefreshRequest oauthTokenRefreshRequest) throws ApiException { + + // Check required parameters + if (oauthTokenRefreshRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'oauthTokenRefreshRequest' when calling" + + " oauthTokenRefresh"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = oauthTokenRefreshRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/ReportApi.java b/src/main/java/com/dropbox/sign/api/ReportApi.java index b6fbf56..5fa6c0f 100644 --- a/src/main/java/com/dropbox/sign/api/ReportApi.java +++ b/src/main/java/com/dropbox/sign/api/ReportApi.java @@ -1,113 +1,120 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; -import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - -import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.ReportCreateRequest; import com.dropbox.sign.model.ReportCreateResponse; - import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class ReportApi { - private ApiClient apiClient; - - public ReportApi() { - this(Configuration.getDefaultApiClient()); - } + private ApiClient apiClient; - public ReportApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + public ReportApi() { + this(Configuration.getDefaultApiClient()); + } - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } + public ReportApi(ApiClient apiClient) { + this.apiClient = apiClient; + } - /** - * 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 reportCreateRequest (required) - * @return ReportCreateResponse - * @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 ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest) throws ApiException { - return reportCreateWithHttpInfo(reportCreateRequest).getData(); - } + /** + * 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; + } - /** - * 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 reportCreateRequest (required) - * @return ApiResponse<ReportCreateResponse> - * @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 reportCreateWithHttpInfo(ReportCreateRequest reportCreateRequest) throws ApiException { - - // Check required parameters - if (reportCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'reportCreateRequest' when calling reportCreate"); + /** + * 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 reportCreateRequest (required) + * @return ReportCreateResponse + * @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 ReportCreateResponse reportCreate(ReportCreateRequest reportCreateRequest) + throws ApiException { + return reportCreateWithHttpInfo(reportCreateRequest).getData(); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = reportCreateRequest.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( - "ReportApi.reportCreate", - "/report/create", - "POST", - new ArrayList<>(), - isFileTypeFound ? null : reportCreateRequest, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - 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 reportCreateRequest (required) + * @return ApiResponse<ReportCreateResponse> + * @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 reportCreateWithHttpInfo( + ReportCreateRequest reportCreateRequest) throws ApiException { + + // Check required parameters + if (reportCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'reportCreateRequest' when calling" + + " reportCreate"); + } - } -} \ No newline at end of file + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = reportCreateRequest.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( + "ReportApi.reportCreate", + "/report/create", + "POST", + new ArrayList<>(), + isFileTypeFound ? null : reportCreateRequest, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } +} diff --git a/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java b/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java index 7fc3cc6..8474ef7 100644 --- a/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java +++ b/src/main/java/com/dropbox/sign/api/SignatureRequestApi.java @@ -1,16 +1,11 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - import com.dropbox.sign.model.BulkSendJobSendResponse; -import com.dropbox.sign.model.ErrorResponse; -import java.io.File; import com.dropbox.sign.model.FileResponse; import com.dropbox.sign.model.FileResponseDataUri; import com.dropbox.sign.model.SignatureRequestBulkCreateEmbeddedWithTemplateRequest; @@ -23,1233 +18,1538 @@ import com.dropbox.sign.model.SignatureRequestSendRequest; import com.dropbox.sign.model.SignatureRequestSendWithTemplateRequest; import com.dropbox.sign.model.SignatureRequestUpdateRequest; - +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class SignatureRequestApi { - private ApiClient apiClient; - - public SignatureRequestApi() { - this(Configuration.getDefaultApiClient()); - } - - public SignatureRequestApi(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; - } - - /** - * 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 signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) - * @return BulkSendJobSendResponse - * @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 BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { - return signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestBulkCreateEmbeddedWithTemplateRequest).getData(); - } - - - /** - * 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 signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<BulkSendJobSendResponse> - * @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 signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) throws ApiException { - - // Check required parameters - if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling signatureRequestBulkCreateEmbeddedWithTemplate"); + private ApiClient apiClient; + + public SignatureRequestApi() { + this(Configuration.getDefaultApiClient()); + } + + public SignatureRequestApi(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; + } + + /** + * 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 signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) + * @return BulkSendJobSendResponse + * @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 BulkSendJobSendResponse signatureRequestBulkCreateEmbeddedWithTemplate( + SignatureRequestBulkCreateEmbeddedWithTemplateRequest + signatureRequestBulkCreateEmbeddedWithTemplateRequest) + throws ApiException { + return signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo( + signatureRequestBulkCreateEmbeddedWithTemplateRequest) + .getData(); + } + + /** + * 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 signatureRequestBulkCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<BulkSendJobSendResponse> + * @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 + signatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfo( + SignatureRequestBulkCreateEmbeddedWithTemplateRequest + signatureRequestBulkCreateEmbeddedWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter" + + " 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' when calling" + + " signatureRequestBulkCreateEmbeddedWithTemplate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound + ? "multipart/form-data" + : apiClient.selectHeaderContentType( + "application/json", "multipart/form-data"); + String[] localVarAuthNames = new String[] {"api_key"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "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. 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 signatureRequestBulkSendWithTemplateRequest (required) + * @return BulkSendJobSendResponse + * @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 BulkSendJobSendResponse signatureRequestBulkSendWithTemplate( + SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) + throws ApiException { + return signatureRequestBulkSendWithTemplateWithHttpInfo( + signatureRequestBulkSendWithTemplateRequest) + .getData(); + } + + /** + * 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 signatureRequestBulkSendWithTemplateRequest (required) + * @return ApiResponse<BulkSendJobSendResponse> + * @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 signatureRequestBulkSendWithTemplateWithHttpInfo( + SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestBulkSendWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest'" + + " when calling signatureRequestBulkSendWithTemplate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * 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 signatureRequestId The id of the incomplete SignatureRequest to cancel. (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 signatureRequestCancel(String signatureRequestId) throws ApiException { + signatureRequestCancelWithHttpInfo(signatureRequestId); + } + + /** + * 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 signatureRequestId The id of the incomplete SignatureRequest to cancel. (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 signatureRequestCancelWithHttpInfo(String signatureRequestId) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestCancel"); + } + + // 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); + } + + /** + * 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 signatureRequestCreateEmbeddedRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestCreateEmbedded( + SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) + throws ApiException { + return signatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest) + .getData(); + } + + /** + * 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 signatureRequestCreateEmbeddedRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestCreateEmbeddedWithHttpInfo( + SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestCreateEmbeddedRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when" + + " calling signatureRequestCreateEmbedded"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * 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 signatureRequestCreateEmbeddedWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate( + SignatureRequestCreateEmbeddedWithTemplateRequest + signatureRequestCreateEmbeddedWithTemplateRequest) + throws ApiException { + return signatureRequestCreateEmbeddedWithTemplateWithHttpInfo( + signatureRequestCreateEmbeddedWithTemplateRequest) + .getData(); + } + + /** + * 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 signatureRequestCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 + signatureRequestCreateEmbeddedWithTemplateWithHttpInfo( + SignatureRequestCreateEmbeddedWithTemplateRequest + signatureRequestCreateEmbeddedWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter" + + " 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling" + + " signatureRequestCreateEmbeddedWithTemplate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a + * collection of individual documents. (optional, default to pdf) + * @return File + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public File signatureRequestFiles(String signatureRequestId, String fileType) + throws ApiException { + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFiles(String, String) + */ + public File signatureRequestFiles(String signatureRequestId) throws ApiException { + String fileType = "pdf"; + + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFilesWithHttpInfo(String, String) + */ + public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId) + throws ApiException { + String fileType = "pdf"; + + return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a + * collection of individual documents. (optional, default to pdf) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse signatureRequestFilesWithHttpInfo( + String signatureRequestId, String fileType) throws ApiException { + + if (fileType == null) { + fileType = "pdf"; + } + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestFiles"); + } + + // Path parameters + String localVarPath = + "/signature_request/files/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + // 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(); + 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); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return FileResponseDataUri + * @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 FileResponseDataUri signatureRequestFilesAsDataUri(String signatureRequestId) + throws ApiException { + return signatureRequestFilesAsDataUriWithHttpInfo(signatureRequestId).getData(); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return ApiResponse<FileResponseDataUri> + * @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 signatureRequestFilesAsDataUriWithHttpInfo( + String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestFilesAsDataUri"); + } + + // 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(); + 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); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param forceDownload 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) + * @return FileResponse + * @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 FileResponse signatureRequestFilesAsFileUrl( + String signatureRequestId, Integer forceDownload) throws ApiException { + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload) + .getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFilesAsFileUrl(String, Integer) + */ + public FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId) + throws ApiException { + Integer forceDownload = 1; + + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload) + .getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestFilesAsFileUrlWithHttpInfo(String, Integer) + */ + public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo( + String signatureRequestId) throws ApiException { + Integer forceDownload = 1; + + return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload); + } + + /** + * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @param forceDownload 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) + * @return ApiResponse<FileResponse> + * @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 signatureRequestFilesAsFileUrlWithHttpInfo( + String signatureRequestId, Integer forceDownload) throws ApiException { + + if (forceDownload == null) { + forceDownload = 1; + } + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestFilesAsFileUrl"); + } + + // Path parameters + String localVarPath = + "/signature_request/files_as_file_url/{signature_request_id}" + .replaceAll( + "\\{signature_request_id}", + apiClient.escapeString(signatureRequestId.toString())); + + // 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(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestBulkCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType("application/json", "multipart/form-data"); - String[] localVarAuthNames = new String[] {"api_key"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "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 - * 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 signatureRequestBulkSendWithTemplateRequest (required) - * @return BulkSendJobSendResponse - * @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 BulkSendJobSendResponse signatureRequestBulkSendWithTemplate(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { - return signatureRequestBulkSendWithTemplateWithHttpInfo(signatureRequestBulkSendWithTemplateRequest).getData(); - } - - - /** - * 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 signatureRequestBulkSendWithTemplateRequest (required) - * @return ApiResponse<BulkSendJobSendResponse> - * @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 signatureRequestBulkSendWithTemplateWithHttpInfo(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) throws ApiException { - - // Check required parameters - if (signatureRequestBulkSendWithTemplateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestBulkSendWithTemplateRequest' when calling signatureRequestBulkSendWithTemplate"); + /** + * Get Signature Request. Returns the status of the SignatureRequest specified by the + * `signature_request_id` parameter. + * + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestGet(String signatureRequestId) + throws ApiException { + return signatureRequestGetWithHttpInfo(signatureRequestId).getData(); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestBulkSendWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the incomplete SignatureRequest to cancel. (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 signatureRequestCancel(String signatureRequestId) throws ApiException { - signatureRequestCancelWithHttpInfo(signatureRequestId); - } - - - /** - * 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 signatureRequestId The id of the incomplete SignatureRequest to cancel. (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 signatureRequestCancelWithHttpInfo(String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestCancel"); + /** + * Get Signature Request. Returns the status of the SignatureRequest specified by the + * `signature_request_id` parameter. + * + * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestGetWithHttpInfo( + String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestGet"); + } + + // 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(); + 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); } - // 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 - ); - - } - /** - * 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 signatureRequestCreateEmbeddedRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestCreateEmbedded(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { - return signatureRequestCreateEmbeddedWithHttpInfo(signatureRequestCreateEmbeddedRequest).getData(); - } - - - /** - * 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 signatureRequestCreateEmbeddedRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestCreateEmbeddedWithHttpInfo(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) throws ApiException { - - // Check required parameters - if (signatureRequestCreateEmbeddedRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedRequest' when calling signatureRequestCreateEmbedded"); + /** + * 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 accountId Which account to return SignatureRequests for. Must be a team member. Use + * `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the SignatureRequest List to return. Defaults to + * `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the + * SignatureRequest objects. (optional) + * @return SignatureRequestListResponse + * @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 SignatureRequestListResponse signatureRequestList( + String accountId, Integer page, Integer pageSize, String query) throws ApiException { + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestCreateEmbeddedRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * 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 signatureRequestCreateEmbeddedWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestCreateEmbeddedWithTemplate(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { - return signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(signatureRequestCreateEmbeddedWithTemplateRequest).getData(); - } - - - /** - * 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 signatureRequestCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestCreateEmbeddedWithTemplateWithHttpInfo(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) throws ApiException { - - // Check required parameters - if (signatureRequestCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' when calling signatureRequestCreateEmbeddedWithTemplate"); + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo() + throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) - * @return File - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public File signatureRequestFiles(String signatureRequestId, String fileType) throws ApiException { - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); - } - - - /** - * @see SignatureRequestApi#signatureRequestFiles(String, String) - */ - public File signatureRequestFiles(String signatureRequestId) throws ApiException { - String fileType = "pdf"; - - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFilesWithHttpInfo(String, String) - */ - public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId) throws ApiException { - String fileType = "pdf"; - - return signatureRequestFilesWithHttpInfo(signatureRequestId, fileType); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) - * @return ApiResponse<File> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse signatureRequestFilesWithHttpInfo(String signatureRequestId, String fileType) throws ApiException { - - if (fileType == null) { - fileType = "pdf"; + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo( + String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList(String accountId, Integer page) + throws ApiException { + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); } - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFiles"); + + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo( + String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); } - // Path parameters - String localVarPath = "/signature_request/files/{signature_request_id}" - .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - - // 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(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return FileResponseDataUri - * @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 FileResponseDataUri signatureRequestFilesAsDataUri(String signatureRequestId) throws ApiException { - return signatureRequestFilesAsDataUriWithHttpInfo(signatureRequestId).getData(); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return ApiResponse<FileResponseDataUri> - * @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 signatureRequestFilesAsDataUriWithHttpInfo(String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsDataUri"); + /** + * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) + */ + public SignatureRequestListResponse signatureRequestList( + String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); } - // 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(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param forceDownload 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) - * @return FileResponse - * @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 FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId, Integer forceDownload) throws ApiException { - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload).getData(); - } - - - /** - * @see SignatureRequestApi#signatureRequestFilesAsFileUrl(String, Integer) - */ - public FileResponse signatureRequestFilesAsFileUrl(String signatureRequestId) throws ApiException { - Integer forceDownload = 1; - - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestFilesAsFileUrlWithHttpInfo(String, Integer) - */ - public ApiResponse signatureRequestFilesAsFileUrlWithHttpInfo(String signatureRequestId) throws ApiException { - Integer forceDownload = 1; - - return signatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @param forceDownload 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) - * @return ApiResponse<FileResponse> - * @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 signatureRequestFilesAsFileUrlWithHttpInfo(String signatureRequestId, Integer forceDownload) throws ApiException { - - if (forceDownload == null) { - forceDownload = 1; + /** + * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse signatureRequestListWithHttpInfo( + String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); } - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestFilesAsFileUrl"); + + /** + * 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 accountId Which account to return SignatureRequests for. Must be a team member. Use + * `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the SignatureRequest List to return. Defaults to + * `1`. (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the + * SignatureRequest objects. (optional) + * @return ApiResponse<SignatureRequestListResponse> + * @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 signatureRequestListWithHttpInfo( + String accountId, Integer page, Integer pageSize, String query) 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("", "query", query)); + + 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"}; + 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); } - // Path parameters - String localVarPath = "/signature_request/files_as_file_url/{signature_request_id}" - .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); - - // 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(); - 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 - ); - - } - /** - * Get Signature Request - * Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestGet(String signatureRequestId) throws ApiException { - return signatureRequestGetWithHttpInfo(signatureRequestId).getData(); - } - - - /** - * Get Signature Request - * Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. - * @param signatureRequestId The id of the SignatureRequest to retrieve. (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestGetWithHttpInfo(String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestGet"); + /** + * 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 signatureRequestId The id of the SignatureRequest to release. (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestReleaseHold(String signatureRequestId) + throws ApiException { + return signatureRequestReleaseHoldWithHttpInfo(signatureRequestId).getData(); } - // 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(); - 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 - ); - - } - /** - * 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 accountId Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @return SignatureRequestListResponse - * @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 SignatureRequestListResponse signatureRequestList(String accountId, Integer page, Integer pageSize, String query) throws ApiException { - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see SignatureRequestApi#signatureRequestList(String, Integer, Integer, String) - */ - public SignatureRequestListResponse signatureRequestList(String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see SignatureRequestApi#signatureRequestListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse signatureRequestListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return signatureRequestListWithHttpInfo(accountId, page, pageSize, query); - } - - - /** - * 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 accountId Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the SignatureRequest List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) - * @return ApiResponse<SignatureRequestListResponse> - * @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 signatureRequestListWithHttpInfo(String accountId, Integer page, Integer pageSize, String query) throws ApiException { - - if (page == null) { - page = 1; + /** + * 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 signatureRequestId The id of the SignatureRequest to release. (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestReleaseHoldWithHttpInfo( + String signatureRequestId) throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestReleaseHold"); + } + + // 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(); + 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); } - if (pageSize == null) { - pageSize = 20; + + /** + * 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 signatureRequestId The id of the SignatureRequest to send a reminder for. (required) + * @param signatureRequestRemindRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestRemind( + String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) + throws ApiException { + return signatureRequestRemindWithHttpInfo(signatureRequestId, signatureRequestRemindRequest) + .getData(); } - // 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)); - - 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"}; - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to release. (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestReleaseHold(String signatureRequestId) throws ApiException { - return signatureRequestReleaseHoldWithHttpInfo(signatureRequestId).getData(); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to release. (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestReleaseHoldWithHttpInfo(String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestReleaseHold"); + + /** + * 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 signatureRequestId The id of the SignatureRequest to send a reminder for. (required) + * @param signatureRequestRemindRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestRemindWithHttpInfo( + String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestRemind"); + } + if (signatureRequestRemindRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestRemindRequest' when calling" + + " signatureRequestRemind"); + } + + // 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(); + 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); } - // 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(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to send a reminder for. (required) - * @param signatureRequestRemindRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestRemind(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { - return signatureRequestRemindWithHttpInfo(signatureRequestId, signatureRequestRemindRequest).getData(); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to send a reminder for. (required) - * @param signatureRequestRemindRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestRemindWithHttpInfo(String signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemind"); + /** + * 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 signatureRequestId The id of the SignatureRequest to remove. (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 signatureRequestRemove(String signatureRequestId) throws ApiException { + signatureRequestRemoveWithHttpInfo(signatureRequestId); } - if (signatureRequestRemindRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestRemindRequest' when calling signatureRequestRemind"); + + /** + * 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 signatureRequestId The id of the SignatureRequest to remove. (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 signatureRequestRemoveWithHttpInfo(String signatureRequestId) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestRemove"); + } + + // 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); } - // 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(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to remove. (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 signatureRequestRemove(String signatureRequestId) throws ApiException { - signatureRequestRemoveWithHttpInfo(signatureRequestId); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to remove. (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 signatureRequestRemoveWithHttpInfo(String signatureRequestId) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestRemove"); + /** + * 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 signatureRequestSendRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestSend( + SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { + return signatureRequestSendWithHttpInfo(signatureRequestSendRequest).getData(); } - // 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 - ); - - } - /** - * 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 signatureRequestSendRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestSend(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - return signatureRequestSendWithHttpInfo(signatureRequestSendRequest).getData(); - } - - - /** - * 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 signatureRequestSendRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestSendWithHttpInfo(SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { - - // Check required parameters - if (signatureRequestSendRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestSendRequest' when calling signatureRequestSend"); + /** + * 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 signatureRequestSendRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestSendWithHttpInfo( + SignatureRequestSendRequest signatureRequestSendRequest) throws ApiException { + + // Check required parameters + if (signatureRequestSendRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestSendRequest' when calling" + + " signatureRequestSend"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestSendRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestSendRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Send with Template - * Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. - * @param signatureRequestSendWithTemplateRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestSendWithTemplate(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { - return signatureRequestSendWithTemplateWithHttpInfo(signatureRequestSendWithTemplateRequest).getData(); - } - - - /** - * Send with Template - * Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. - * @param signatureRequestSendWithTemplateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestSendWithTemplateWithHttpInfo(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) throws ApiException { - - // Check required parameters - if (signatureRequestSendWithTemplateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when calling signatureRequestSendWithTemplate"); + /** + * Send with Template. Creates and sends a new SignatureRequest based off of the Template(s) + * specified with the `template_ids` parameter. + * + * @param signatureRequestSendWithTemplateRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestSendWithTemplate( + SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) + throws ApiException { + return signatureRequestSendWithTemplateWithHttpInfo(signatureRequestSendWithTemplateRequest) + .getData(); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * 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 signatureRequestId The id of the SignatureRequest to update. (required) - * @param signatureRequestUpdateRequest (required) - * @return SignatureRequestGetResponse - * @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 SignatureRequestGetResponse signatureRequestUpdate(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { - return signatureRequestUpdateWithHttpInfo(signatureRequestId, signatureRequestUpdateRequest).getData(); - } - - - /** - * 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 signatureRequestId The id of the SignatureRequest to update. (required) - * @param signatureRequestUpdateRequest (required) - * @return ApiResponse<SignatureRequestGetResponse> - * @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 signatureRequestUpdateWithHttpInfo(String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling signatureRequestUpdate"); + /** + * Send with Template. Creates and sends a new SignatureRequest based off of the Template(s) + * specified with the `template_ids` parameter. + * + * @param signatureRequestSendWithTemplateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestSendWithTemplateWithHttpInfo( + SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestSendWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestSendWithTemplateRequest' when" + + " calling signatureRequestSendWithTemplate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = signatureRequestSendWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - if (signatureRequestUpdateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestUpdateRequest' when calling signatureRequestUpdate"); + + /** + * 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 signatureRequestId The id of the SignatureRequest to update. (required) + * @param signatureRequestUpdateRequest (required) + * @return SignatureRequestGetResponse + * @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 SignatureRequestGetResponse signatureRequestUpdate( + String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) + throws ApiException { + return signatureRequestUpdateWithHttpInfo(signatureRequestId, signatureRequestUpdateRequest) + .getData(); } - // 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(); - 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 - ); - - } -} \ No newline at end of file + /** + * 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 signatureRequestId The id of the SignatureRequest to update. (required) + * @param signatureRequestUpdateRequest (required) + * @return ApiResponse<SignatureRequestGetResponse> + * @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 signatureRequestUpdateWithHttpInfo( + String signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) + throws ApiException { + + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " signatureRequestUpdate"); + } + if (signatureRequestUpdateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestUpdateRequest' when calling" + + " signatureRequestUpdate"); + } + + // 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(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/TeamApi.java b/src/main/java/com/dropbox/sign/api/TeamApi.java index c894e07..cf3167a 100644 --- a/src/main/java/com/dropbox/sign/api/TeamApi.java +++ b/src/main/java/com/dropbox/sign/api/TeamApi.java @@ -1,14 +1,10 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - -import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.TeamAddMemberRequest; import com.dropbox.sign.model.TeamCreateRequest; import com.dropbox.sign.model.TeamGetInfoResponse; @@ -18,827 +14,884 @@ import com.dropbox.sign.model.TeamRemoveMemberRequest; import com.dropbox.sign.model.TeamSubTeamsResponse; import com.dropbox.sign.model.TeamUpdateRequest; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class TeamApi { - private ApiClient apiClient; - - public TeamApi() { - this(Configuration.getDefaultApiClient()); - } - - public TeamApi(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 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 teamAddMemberRequest (required) - * @param teamId The id of the team. (optional) - * @return TeamGetResponse - * @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 TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); - } - - - /** - * @see TeamApi#teamAddMember(TeamAddMemberRequest, String) - */ - public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest) throws ApiException { - String teamId = null; - - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); - } - - /** - * @see TeamApi#teamAddMemberWithHttpInfo(TeamAddMemberRequest, String) - */ - public ApiResponse teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest) throws ApiException { - String teamId = null; - - return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId); - } - - - /** - * 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 teamAddMemberRequest (required) - * @param teamId The id of the team. (optional) - * @return ApiResponse<TeamGetResponse> - * @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 teamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { - - // Check required parameters - if (teamAddMemberRequest == null) { - throw new ApiException(400, "Missing the required parameter 'teamAddMemberRequest' when calling teamAddMember"); - } - - // 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(); - 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 - ); - - } - /** - * Create Team - * Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. - * @param teamCreateRequest (required) - * @return TeamGetResponse - * @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 TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws ApiException { - return teamCreateWithHttpInfo(teamCreateRequest).getData(); - } - - - /** - * Create Team - * Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. - * @param teamCreateRequest (required) - * @return ApiResponse<TeamGetResponse> - * @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 teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) throws ApiException { - - // Check required parameters - if (teamCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Delete Team - * Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). - * @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 teamDelete() throws ApiException { - teamDeleteWithHttpInfo(); - } - - - /** - * Delete Team - * Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). - * @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 teamDeleteWithHttpInfo() throws ApiException { - - 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 - ); - - } - /** - * 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. - * @return TeamGetResponse - * @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 TeamGetResponse teamGet() throws ApiException { - return teamGetWithHttpInfo().getData(); - } - - - /** - * 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. - * @return ApiResponse<TeamGetResponse> - * @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 teamGetWithHttpInfo() throws ApiException { - - 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"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamGet", - "/team", - "GET", - new ArrayList<>(), - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); - - } - /** - * Get Team Info - * Provides information about a team. - * @param teamId The id of the team. (optional) - * @return TeamGetInfoResponse - * @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 TeamGetInfoResponse teamInfo(String teamId) throws ApiException { - return teamInfoWithHttpInfo(teamId).getData(); - } - - - /** - * @see TeamApi#teamInfo(String) - */ - public TeamGetInfoResponse teamInfo() throws ApiException { - String teamId = null; - - return teamInfoWithHttpInfo(teamId).getData(); - } - - /** - * @see TeamApi#teamInfoWithHttpInfo(String) - */ - public ApiResponse teamInfoWithHttpInfo() throws ApiException { - String teamId = null; - - return teamInfoWithHttpInfo(teamId); - } - - - /** - * Get Team Info - * Provides information about a team. - * @param teamId The id of the team. (optional) - * @return ApiResponse<TeamGetInfoResponse> - * @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 teamInfoWithHttpInfo(String teamId) throws ApiException { - - // 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(); - 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 - ); - - } - /** - * List Team Invites - * Provides a list of team invites (and their roles). - * @param emailAddress The email address for which to display the team invites. (optional) - * @return TeamInvitesResponse - * @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 TeamInvitesResponse teamInvites(String emailAddress) throws ApiException { - return teamInvitesWithHttpInfo(emailAddress).getData(); - } - - - /** - * @see TeamApi#teamInvites(String) - */ - public TeamInvitesResponse teamInvites() throws ApiException { - String emailAddress = null; - - return teamInvitesWithHttpInfo(emailAddress).getData(); - } - - /** - * @see TeamApi#teamInvitesWithHttpInfo(String) - */ - public ApiResponse teamInvitesWithHttpInfo() throws ApiException { - String emailAddress = null; - - return teamInvitesWithHttpInfo(emailAddress); - } - - - /** - * List Team Invites - * Provides a list of team invites (and their roles). - * @param emailAddress The email address for which to display the team invites. (optional) - * @return ApiResponse<TeamInvitesResponse> - * @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 teamInvitesWithHttpInfo(String emailAddress) throws ApiException { - - // 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(); - 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 - ); - - } - /** - * List Team Members - * Provides a paginated list of members (and their roles) that belong to a given team. - * @param teamId The id of the team that a member list is being requested from. (required) - * @param page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return TeamMembersResponse - * @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 TeamMembersResponse teamMembers(String teamId, Integer page, Integer pageSize) throws ApiException { - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - - /** - * @see TeamApi#teamMembers(String, Integer, Integer) - */ - public TeamMembersResponse teamMembers(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamMembersWithHttpInfo(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize); - } - - /** - * @see TeamApi#teamMembers(String, Integer, Integer) - */ - public TeamMembersResponse teamMembers(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamMembersWithHttpInfo(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamMembersWithHttpInfo(teamId, page, pageSize); - } - - - /** - * List Team Members - * Provides a paginated list of members (and their roles) that belong to a given team. - * @param teamId The id of the team that a member list is being requested from. (required) - * @param page Which page number of the team member list to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<TeamMembersResponse> - * @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 teamMembersWithHttpInfo(String teamId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Check required parameters - if (teamId == null) { - throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamMembers"); - } - - // Path parameters - String localVarPath = "/team/members/{team_id}" - .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "page", page) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamMembers", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); - - } - /** - * 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 teamRemoveMemberRequest (required) - * @return TeamGetResponse - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - return teamRemoveMemberWithHttpInfo(teamRemoveMemberRequest).getData(); - } - - - /** - * 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 teamRemoveMemberRequest (required) - * @return ApiResponse<TeamGetResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse teamRemoveMemberWithHttpInfo(TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { - - // Check required parameters - if (teamRemoveMemberRequest == null) { - throw new ApiException(400, "Missing the required parameter 'teamRemoveMemberRequest' when calling teamRemoveMember"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamRemoveMemberRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * List Sub Teams - * Provides a paginated list of sub teams that belong to a given team. - * @param teamId The id of the parent Team. (required) - * @param page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return TeamSubTeamsResponse - * @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 TeamSubTeamsResponse teamSubTeams(String teamId, Integer page, Integer pageSize) throws ApiException { - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - - /** - * @see TeamApi#teamSubTeams(String, Integer, Integer) - */ - public TeamSubTeamsResponse teamSubTeams(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamSubTeamsWithHttpInfo(String teamId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize); - } - - /** - * @see TeamApi#teamSubTeams(String, Integer, Integer) - */ - public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); - } - - /** - * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) - */ - public ApiResponse teamSubTeamsWithHttpInfo(String teamId, Integer page) throws ApiException { - Integer pageSize = 20; - - return teamSubTeamsWithHttpInfo(teamId, page, pageSize); - } - - - /** - * List Sub Teams - * Provides a paginated list of sub teams that belong to a given team. - * @param teamId The id of the parent Team. (required) - * @param page Which page number of the SubTeam List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @return ApiResponse<TeamSubTeamsResponse> - * @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 teamSubTeamsWithHttpInfo(String teamId, Integer page, Integer pageSize) throws ApiException { - - if (page == null) { - page = 1; - } - if (pageSize == null) { - pageSize = 20; - } - // Check required parameters - if (teamId == null) { - throw new ApiException(400, "Missing the required parameter 'teamId' when calling teamSubTeams"); - } - - // Path parameters - String localVarPath = "/team/sub_teams/{team_id}" - .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); - - // Query parameters - List localVarQueryParams = new ArrayList<>( - apiClient.parameterToPairs("", "page", page) - ); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = new HashMap(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - String localVarContentType = isFileTypeFound? "multipart/form-data" : apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TeamApi.teamSubTeams", - localVarPath, - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); - - } - /** - * Update Team - * Updates the name of your Team. - * @param teamUpdateRequest (required) - * @return TeamGetResponse - * @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 TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws ApiException { - return teamUpdateWithHttpInfo(teamUpdateRequest).getData(); - } - - - /** - * Update Team - * Updates the name of your Team. - * @param teamUpdateRequest (required) - * @return ApiResponse<TeamGetResponse> - * @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 teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) throws ApiException { - - // Check required parameters - if (teamUpdateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = teamUpdateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } -} \ No newline at end of file + private ApiClient apiClient; + + public TeamApi() { + this(Configuration.getDefaultApiClient()); + } + + public TeamApi(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 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 teamAddMemberRequest (required) + * @param teamId The id of the team. (optional) + * @return TeamGetResponse + * @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 TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest, String teamId) + throws ApiException { + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); + } + + /** + * @see TeamApi#teamAddMember(TeamAddMemberRequest, String) + */ + public TeamGetResponse teamAddMember(TeamAddMemberRequest teamAddMemberRequest) + throws ApiException { + String teamId = null; + + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId).getData(); + } + + /** + * @see TeamApi#teamAddMemberWithHttpInfo(TeamAddMemberRequest, String) + */ + public ApiResponse teamAddMemberWithHttpInfo( + TeamAddMemberRequest teamAddMemberRequest) throws ApiException { + String teamId = null; + + return teamAddMemberWithHttpInfo(teamAddMemberRequest, teamId); + } + + /** + * 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 teamAddMemberRequest (required) + * @param teamId The id of the team. (optional) + * @return ApiResponse<TeamGetResponse> + * @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 teamAddMemberWithHttpInfo( + TeamAddMemberRequest teamAddMemberRequest, String teamId) throws ApiException { + + // Check required parameters + if (teamAddMemberRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'teamAddMemberRequest' when calling" + + " teamAddMember"); + } + + // 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(); + 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); + } + + /** + * Create Team. Creates a new Team and makes you a member. You must not currently belong to a + * Team to invoke. + * + * @param teamCreateRequest (required) + * @return TeamGetResponse + * @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 TeamGetResponse teamCreate(TeamCreateRequest teamCreateRequest) throws ApiException { + return teamCreateWithHttpInfo(teamCreateRequest).getData(); + } + + /** + * Create Team. Creates a new Team and makes you a member. You must not currently belong to a + * Team to invoke. + * + * @param teamCreateRequest (required) + * @return ApiResponse<TeamGetResponse> + * @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 teamCreateWithHttpInfo(TeamCreateRequest teamCreateRequest) + throws ApiException { + + // Check required parameters + if (teamCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'teamCreateRequest' when calling teamCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * Delete Team. Deletes your Team. Can only be invoked when you have a Team with only one member + * (yourself). + * + * @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 teamDelete() throws ApiException { + teamDeleteWithHttpInfo(); + } + + /** + * Delete Team. Deletes your Team. Can only be invoked when you have a Team with only one member + * (yourself). + * + * @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 teamDeleteWithHttpInfo() throws ApiException { + + 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); + } + + /** + * 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. + * + * @return TeamGetResponse + * @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 TeamGetResponse teamGet() throws ApiException { + return teamGetWithHttpInfo().getData(); + } + + /** + * 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. + * + * @return ApiResponse<TeamGetResponse> + * @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 teamGetWithHttpInfo() throws ApiException { + + 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"}; + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamGet", + "/team", + "GET", + new ArrayList<>(), + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Get Team Info. Provides information about a team. + * + * @param teamId The id of the team. (optional) + * @return TeamGetInfoResponse + * @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 TeamGetInfoResponse teamInfo(String teamId) throws ApiException { + return teamInfoWithHttpInfo(teamId).getData(); + } + + /** + * @see TeamApi#teamInfo(String) + */ + public TeamGetInfoResponse teamInfo() throws ApiException { + String teamId = null; + + return teamInfoWithHttpInfo(teamId).getData(); + } + + /** + * @see TeamApi#teamInfoWithHttpInfo(String) + */ + public ApiResponse teamInfoWithHttpInfo() throws ApiException { + String teamId = null; + + return teamInfoWithHttpInfo(teamId); + } + + /** + * Get Team Info. Provides information about a team. + * + * @param teamId The id of the team. (optional) + * @return ApiResponse<TeamGetInfoResponse> + * @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 teamInfoWithHttpInfo(String teamId) + throws ApiException { + + // 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(); + 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); + } + + /** + * List Team Invites. Provides a list of team invites (and their roles). + * + * @param emailAddress The email address for which to display the team invites. (optional) + * @return TeamInvitesResponse + * @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 TeamInvitesResponse teamInvites(String emailAddress) throws ApiException { + return teamInvitesWithHttpInfo(emailAddress).getData(); + } + + /** + * @see TeamApi#teamInvites(String) + */ + public TeamInvitesResponse teamInvites() throws ApiException { + String emailAddress = null; + + return teamInvitesWithHttpInfo(emailAddress).getData(); + } + + /** + * @see TeamApi#teamInvitesWithHttpInfo(String) + */ + public ApiResponse teamInvitesWithHttpInfo() throws ApiException { + String emailAddress = null; + + return teamInvitesWithHttpInfo(emailAddress); + } + + /** + * List Team Invites. Provides a list of team invites (and their roles). + * + * @param emailAddress The email address for which to display the team invites. (optional) + * @return ApiResponse<TeamInvitesResponse> + * @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 teamInvitesWithHttpInfo(String emailAddress) + throws ApiException { + + // 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(); + 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); + } + + /** + * List Team Members. Provides a paginated list of members (and their roles) that belong to a + * given team. + * + * @param teamId The id of the team that a member list is being requested from. (required) + * @param page Which page number of the team member list to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return TeamMembersResponse + * @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 TeamMembersResponse teamMembers(String teamId, Integer page, Integer pageSize) + throws ApiException { + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamMembers(String, Integer, Integer) + */ + public TeamMembersResponse teamMembers(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamMembersWithHttpInfo(String teamId) + throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize); + } + + /** + * @see TeamApi#teamMembers(String, Integer, Integer) + */ + public TeamMembersResponse teamMembers(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamMembersWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamMembersWithHttpInfo(String teamId, Integer page) + throws ApiException { + Integer pageSize = 20; + + return teamMembersWithHttpInfo(teamId, page, pageSize); + } + + /** + * List Team Members. Provides a paginated list of members (and their roles) that belong to a + * given team. + * + * @param teamId The id of the team that a member list is being requested from. (required) + * @param page Which page number of the team member list to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<TeamMembersResponse> + * @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 teamMembersWithHttpInfo( + String teamId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Check required parameters + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling teamMembers"); + } + + // Path parameters + String localVarPath = + "/team/members/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); + + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamMembers", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * 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 teamRemoveMemberRequest (required) + * @return TeamGetResponse + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public TeamGetResponse teamRemoveMember(TeamRemoveMemberRequest teamRemoveMemberRequest) + throws ApiException { + return teamRemoveMemberWithHttpInfo(teamRemoveMemberRequest).getData(); + } + + /** + * 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 teamRemoveMemberRequest (required) + * @return ApiResponse<TeamGetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
201 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse teamRemoveMemberWithHttpInfo( + TeamRemoveMemberRequest teamRemoveMemberRequest) throws ApiException { + + // Check required parameters + if (teamRemoveMemberRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'teamRemoveMemberRequest' when calling" + + " teamRemoveMember"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamRemoveMemberRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * List Sub Teams. Provides a paginated list of sub teams that belong to a given team. + * + * @param teamId The id of the parent Team. (required) + * @param page Which page number of the SubTeam List to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return TeamSubTeamsResponse + * @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 TeamSubTeamsResponse teamSubTeams(String teamId, Integer page, Integer pageSize) + throws ApiException { + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamSubTeams(String, Integer, Integer) + */ + public TeamSubTeamsResponse teamSubTeams(String teamId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamSubTeamsWithHttpInfo(String teamId) + throws ApiException { + Integer page = 1; + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize); + } + + /** + * @see TeamApi#teamSubTeams(String, Integer, Integer) + */ + public TeamSubTeamsResponse teamSubTeams(String teamId, Integer page) throws ApiException { + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize).getData(); + } + + /** + * @see TeamApi#teamSubTeamsWithHttpInfo(String, Integer, Integer) + */ + public ApiResponse teamSubTeamsWithHttpInfo(String teamId, Integer page) + throws ApiException { + Integer pageSize = 20; + + return teamSubTeamsWithHttpInfo(teamId, page, pageSize); + } + + /** + * List Sub Teams. Provides a paginated list of sub teams that belong to a given team. + * + * @param teamId The id of the parent Team. (required) + * @param page Which page number of the SubTeam List to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @return ApiResponse<TeamSubTeamsResponse> + * @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 teamSubTeamsWithHttpInfo( + String teamId, Integer page, Integer pageSize) throws ApiException { + + if (page == null) { + page = 1; + } + if (pageSize == null) { + pageSize = 20; + } + // Check required parameters + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling teamSubTeams"); + } + + // Path parameters + String localVarPath = + "/team/sub_teams/{team_id}" + .replaceAll("\\{team_id}", apiClient.escapeString(teamId.toString())); + + // Query parameters + List localVarQueryParams = + new ArrayList<>(apiClient.parameterToPairs("", "page", page)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize)); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = new HashMap(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + String localVarContentType = + isFileTypeFound ? "multipart/form-data" : apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key", "oauth2"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "TeamApi.teamSubTeams", + localVarPath, + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Update Team. Updates the name of your Team. + * + * @param teamUpdateRequest (required) + * @return TeamGetResponse + * @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 TeamGetResponse teamUpdate(TeamUpdateRequest teamUpdateRequest) throws ApiException { + return teamUpdateWithHttpInfo(teamUpdateRequest).getData(); + } + + /** + * Update Team. Updates the name of your Team. + * + * @param teamUpdateRequest (required) + * @return ApiResponse<TeamGetResponse> + * @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 teamUpdateWithHttpInfo(TeamUpdateRequest teamUpdateRequest) + throws ApiException { + + // Check required parameters + if (teamUpdateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'teamUpdateRequest' when calling teamUpdate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = teamUpdateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/TemplateApi.java b/src/main/java/com/dropbox/sign/api/TemplateApi.java index 3779ff5..bee010c 100644 --- a/src/main/java/com/dropbox/sign/api/TemplateApi.java +++ b/src/main/java/com/dropbox/sign/api/TemplateApi.java @@ -1,15 +1,10 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - -import com.dropbox.sign.model.ErrorResponse; -import java.io.File; import com.dropbox.sign.model.FileResponse; import com.dropbox.sign.model.FileResponseDataUri; import com.dropbox.sign.model.TemplateAddUserRequest; @@ -22,923 +17,1074 @@ import com.dropbox.sign.model.TemplateRemoveUserRequest; import com.dropbox.sign.model.TemplateUpdateFilesRequest; import com.dropbox.sign.model.TemplateUpdateFilesResponse; - +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class TemplateApi { - private ApiClient apiClient; - - public TemplateApi() { - this(Configuration.getDefaultApiClient()); - } - - public TemplateApi(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 User to Template - * Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. - * @param templateId The id of the Template to give the Account access to. (required) - * @param templateAddUserRequest (required) - * @return TemplateGetResponse - * @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 TemplateGetResponse templateAddUser(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - return templateAddUserWithHttpInfo(templateId, templateAddUserRequest).getData(); - } - - - /** - * Add User to Template - * Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. - * @param templateId The id of the Template to give the Account access to. (required) - * @param templateAddUserRequest (required) - * @return ApiResponse<TemplateGetResponse> - * @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 templateAddUserWithHttpInfo(String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateAddUser"); - } - if (templateAddUserRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateAddUserRequest' when calling templateAddUser"); - } - - // 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(); - 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 - ); - - } - /** - * Create Template - * Creates a template that can then be used. - * @param templateCreateRequest (required) - * @return TemplateCreateResponse - * @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 TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreateRequest) throws ApiException { - return templateCreateWithHttpInfo(templateCreateRequest).getData(); - } - - - /** - * Create Template - * Creates a template that can then be used. - * @param templateCreateRequest (required) - * @return ApiResponse<TemplateCreateResponse> - * @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 templateCreateWithHttpInfo(TemplateCreateRequest templateCreateRequest) throws ApiException { - - // Check required parameters - if (templateCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateCreateRequest' when calling templateCreate"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * 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 templateCreateEmbeddedDraftRequest (required) - * @return TemplateCreateEmbeddedDraftResponse - * @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 TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { - return templateCreateEmbeddedDraftWithHttpInfo(templateCreateEmbeddedDraftRequest).getData(); - } - - - /** - * 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 templateCreateEmbeddedDraftRequest (required) - * @return ApiResponse<TemplateCreateEmbeddedDraftResponse> - * @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 templateCreateEmbeddedDraftWithHttpInfo(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) throws ApiException { - - // Check required parameters - if (templateCreateEmbeddedDraftRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when calling templateCreateEmbeddedDraft"); - } - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); - - } - /** - * Delete Template - * Completely deletes the template specified from the account. - * @param templateId The id of the Template to delete. (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 templateDelete(String templateId) throws ApiException { - templateDeleteWithHttpInfo(templateId); - } - - - /** - * Delete Template - * Completely deletes the template specified from the account. - * @param templateId The id of the Template to delete. (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 templateDeleteWithHttpInfo(String templateId) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateDelete"); - } - - // 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 - ); - - } - /** - * 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 templateId The id of the template files to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @return File - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public File templateFiles(String templateId, String fileType) throws ApiException { - return templateFilesWithHttpInfo(templateId, fileType).getData(); - } - - - /** - * @see TemplateApi#templateFiles(String, String) - */ - public File templateFiles(String templateId) throws ApiException { - String fileType = null; - - return templateFilesWithHttpInfo(templateId, fileType).getData(); - } - - /** - * @see TemplateApi#templateFilesWithHttpInfo(String, String) - */ - public ApiResponse templateFilesWithHttpInfo(String templateId) throws ApiException { - String fileType = null; - - return templateFilesWithHttpInfo(templateId, fileType); - } - - - /** - * 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 templateId The id of the template files to retrieve. (required) - * @param fileType Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) - * @return ApiResponse<File> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
- */ - public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFiles"); - } - - // Path parameters - String localVarPath = "/template/files/{template_id}" - .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - - // 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(); - 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 - ); - - } - /** - * 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 templateId The id of the template files to retrieve. (required) - * @return FileResponseDataUri - * @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 FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiException { - return templateFilesAsDataUriWithHttpInfo(templateId).getData(); - } - - - /** - * 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 templateId The id of the template files to retrieve. (required) - * @return ApiResponse<FileResponseDataUri> - * @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 templateFilesAsDataUriWithHttpInfo(String templateId) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsDataUri"); - } - - // 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(); - 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 - ); - - } - /** - * 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 templateId The id of the template files to retrieve. (required) - * @param forceDownload 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) - * @return FileResponse - * @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 FileResponse templateFilesAsFileUrl(String templateId, Integer forceDownload) throws ApiException { - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); - } - - - /** - * @see TemplateApi#templateFilesAsFileUrl(String, Integer) - */ - public FileResponse templateFilesAsFileUrl(String templateId) throws ApiException { - Integer forceDownload = 1; - - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); - } - - /** - * @see TemplateApi#templateFilesAsFileUrlWithHttpInfo(String, Integer) - */ - public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templateId) throws ApiException { - Integer forceDownload = 1; - - return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload); - } - - - /** - * 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 templateId The id of the template files to retrieve. (required) - * @param forceDownload 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) - * @return ApiResponse<FileResponse> - * @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 templateFilesAsFileUrlWithHttpInfo(String templateId, Integer forceDownload) throws ApiException { - - if (forceDownload == null) { - forceDownload = 1; - } - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateFilesAsFileUrl"); - } - - // Path parameters - String localVarPath = "/template/files_as_file_url/{template_id}" - .replaceAll("\\{template_id}", apiClient.escapeString(templateId.toString())); - - // 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(); - 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 - ); - - } - /** - * Get Template - * Returns the Template specified by the `template_id` parameter. - * @param templateId The id of the Template to retrieve. (required) - * @return TemplateGetResponse - * @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 TemplateGetResponse templateGet(String templateId) throws ApiException { - return templateGetWithHttpInfo(templateId).getData(); - } - - - /** - * Get Template - * Returns the Template specified by the `template_id` parameter. - * @param templateId The id of the Template to retrieve. (required) - * @return ApiResponse<TemplateGetResponse> - * @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 templateGetWithHttpInfo(String templateId) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateGet"); - } - - // 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(); - 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 - ); - - } - /** - * 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 accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @return TemplateListResponse - * @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 TemplateListResponse templateList(String accountId, Integer page, Integer pageSize, String query) throws ApiException { - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo() throws ApiException { - String accountId = null; - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo(String accountId) throws ApiException { - Integer page = 1; - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo(String accountId, Integer page) throws ApiException { - Integer pageSize = 20; - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); - } - - /** - * @see TemplateApi#templateList(String, Integer, Integer, String) - */ - public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); - } - - /** - * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) - */ - public ApiResponse templateListWithHttpInfo(String accountId, Integer page, Integer pageSize) throws ApiException { - String query = null; - - return templateListWithHttpInfo(accountId, page, pageSize, query); - } - - - /** - * 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 accountId Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. (optional) - * @param page Which page number of the Template List to return. Defaults to `1`. (optional, default to 1) - * @param pageSize Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) - * @param query String that includes search terms and/or fields to be used to filter the Template objects. (optional) - * @return ApiResponse<TemplateListResponse> - * @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 templateListWithHttpInfo(String accountId, Integer page, Integer pageSize, String query) 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("", "query", query)); - - 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"}; - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI( - "TemplateApi.templateList", - "/template/list", - "GET", - localVarQueryParams, - null, - new LinkedHashMap<>(), - new LinkedHashMap<>(), - localVarFormParams, - localVarAccept, - localVarContentType, - localVarAuthNames, - localVarReturnType, - false - ); - - } - /** - * Remove User from Template - * Removes the specified Account's access to the specified Template. - * @param templateId The id of the Template to remove the Account's access to. (required) - * @param templateRemoveUserRequest (required) - * @return TemplateGetResponse - * @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 TemplateGetResponse templateRemoveUser(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { - return templateRemoveUserWithHttpInfo(templateId, templateRemoveUserRequest).getData(); - } - - - /** - * Remove User from Template - * Removes the specified Account's access to the specified Template. - * @param templateId The id of the Template to remove the Account's access to. (required) - * @param templateRemoveUserRequest (required) - * @return ApiResponse<TemplateGetResponse> - * @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 templateRemoveUserWithHttpInfo(String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateRemoveUser"); - } - if (templateRemoveUserRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateRemoveUserRequest' when calling templateRemoveUser"); - } - - // 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(); - 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 - ); - - } - /** - * 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 templateId The ID of the template whose files to update. (required) - * @param templateUpdateFilesRequest (required) - * @return TemplateUpdateFilesResponse - * @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 TemplateUpdateFilesResponse templateUpdateFiles(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { - return templateUpdateFilesWithHttpInfo(templateId, templateUpdateFilesRequest).getData(); - } - - - /** - * 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 templateId The ID of the template whose files to update. (required) - * @param templateUpdateFilesRequest (required) - * @return ApiResponse<TemplateUpdateFilesResponse> - * @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 templateUpdateFilesWithHttpInfo(String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) throws ApiException { - - // Check required parameters - if (templateId == null) { - throw new ApiException(400, "Missing the required parameter 'templateId' when calling templateUpdateFiles"); - } - if (templateUpdateFilesRequest == null) { - throw new ApiException(400, "Missing the required parameter 'templateUpdateFilesRequest' when calling templateUpdateFiles"); - } - - // 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(); - 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 - ); - - } -} \ No newline at end of file + private ApiClient apiClient; + + public TemplateApi() { + this(Configuration.getDefaultApiClient()); + } + + public TemplateApi(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 User to Template. Gives the specified Account access to the specified Template. The + * specified Account must be a part of your Team. + * + * @param templateId The id of the Template to give the Account access to. (required) + * @param templateAddUserRequest (required) + * @return TemplateGetResponse + * @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 TemplateGetResponse templateAddUser( + String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { + return templateAddUserWithHttpInfo(templateId, templateAddUserRequest).getData(); + } + + /** + * Add User to Template. Gives the specified Account access to the specified Template. The + * specified Account must be a part of your Team. + * + * @param templateId The id of the Template to give the Account access to. (required) + * @param templateAddUserRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @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 templateAddUserWithHttpInfo( + String templateId, TemplateAddUserRequest templateAddUserRequest) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling templateAddUser"); + } + if (templateAddUserRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateAddUserRequest' when calling" + + " templateAddUser"); + } + + // 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(); + 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); + } + + /** + * Create Template. Creates a template that can then be used. + * + * @param templateCreateRequest (required) + * @return TemplateCreateResponse + * @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 TemplateCreateResponse templateCreate(TemplateCreateRequest templateCreateRequest) + throws ApiException { + return templateCreateWithHttpInfo(templateCreateRequest).getData(); + } + + /** + * Create Template. Creates a template that can then be used. + * + * @param templateCreateRequest (required) + * @return ApiResponse<TemplateCreateResponse> + * @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 templateCreateWithHttpInfo( + TemplateCreateRequest templateCreateRequest) throws ApiException { + + // Check required parameters + if (templateCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateCreateRequest' when calling" + + " templateCreate"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * 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 templateCreateEmbeddedDraftRequest (required) + * @return TemplateCreateEmbeddedDraftResponse + * @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 TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraft( + TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) + throws ApiException { + return templateCreateEmbeddedDraftWithHttpInfo(templateCreateEmbeddedDraftRequest) + .getData(); + } + + /** + * 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 templateCreateEmbeddedDraftRequest (required) + * @return ApiResponse<TemplateCreateEmbeddedDraftResponse> + * @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 templateCreateEmbeddedDraftWithHttpInfo( + TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) + throws ApiException { + + // Check required parameters + if (templateCreateEmbeddedDraftRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateCreateEmbeddedDraftRequest' when" + + " calling templateCreateEmbeddedDraft"); + } + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = templateCreateEmbeddedDraftRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); + } + + /** + * Delete Template. Completely deletes the template specified from the account. + * + * @param templateId The id of the Template to delete. (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 templateDelete(String templateId) throws ApiException { + templateDeleteWithHttpInfo(templateId); + } + + /** + * Delete Template. Completely deletes the template specified from the account. + * + * @param templateId The id of the Template to delete. (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 templateDeleteWithHttpInfo(String templateId) throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling templateDelete"); + } + + // 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); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a + * collection of individual documents. (optional) + * @return File + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public File templateFiles(String templateId, String fileType) throws ApiException { + return templateFilesWithHttpInfo(templateId, fileType).getData(); + } + + /** + * @see TemplateApi#templateFiles(String, String) + */ + public File templateFiles(String templateId) throws ApiException { + String fileType = null; + + return templateFilesWithHttpInfo(templateId, fileType).getData(); + } + + /** + * @see TemplateApi#templateFilesWithHttpInfo(String, String) + */ + public ApiResponse templateFilesWithHttpInfo(String templateId) throws ApiException { + String fileType = null; + + return templateFilesWithHttpInfo(templateId, fileType); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @param fileType Set to `pdf` for a single merged document or `zip` for a + * collection of individual documents. (optional) + * @return ApiResponse<File> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + *
Status Code Description Response Headers
200 successful operation * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
4XX failed_operation -
+ */ + public ApiResponse templateFilesWithHttpInfo(String templateId, String fileType) + throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling templateFiles"); + } + + // Path parameters + String localVarPath = + "/template/files/{template_id}" + .replaceAll( + "\\{template_id}", apiClient.escapeString(templateId.toString())); + + // 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(); + 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); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @return FileResponseDataUri + * @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 FileResponseDataUri templateFilesAsDataUri(String templateId) throws ApiException { + return templateFilesAsDataUriWithHttpInfo(templateId).getData(); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @return ApiResponse<FileResponseDataUri> + * @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 templateFilesAsDataUriWithHttpInfo(String templateId) + throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " templateFilesAsDataUri"); + } + + // 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(); + 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); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @param forceDownload 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) + * @return FileResponse + * @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 FileResponse templateFilesAsFileUrl(String templateId, Integer forceDownload) + throws ApiException { + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); + } + + /** + * @see TemplateApi#templateFilesAsFileUrl(String, Integer) + */ + public FileResponse templateFilesAsFileUrl(String templateId) throws ApiException { + Integer forceDownload = 1; + + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload).getData(); + } + + /** + * @see TemplateApi#templateFilesAsFileUrlWithHttpInfo(String, Integer) + */ + public ApiResponse templateFilesAsFileUrlWithHttpInfo(String templateId) + throws ApiException { + Integer forceDownload = 1; + + return templateFilesAsFileUrlWithHttpInfo(templateId, forceDownload); + } + + /** + * 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 templateId The id of the template files to retrieve. (required) + * @param forceDownload 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) + * @return ApiResponse<FileResponse> + * @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 templateFilesAsFileUrlWithHttpInfo( + String templateId, Integer forceDownload) throws ApiException { + + if (forceDownload == null) { + forceDownload = 1; + } + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling" + + " templateFilesAsFileUrl"); + } + + // Path parameters + String localVarPath = + "/template/files_as_file_url/{template_id}" + .replaceAll( + "\\{template_id}", apiClient.escapeString(templateId.toString())); + + // 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(); + 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); + } + + /** + * Get Template. Returns the Template specified by the `template_id` parameter. + * + * @param templateId The id of the Template to retrieve. (required) + * @return TemplateGetResponse + * @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 TemplateGetResponse templateGet(String templateId) throws ApiException { + return templateGetWithHttpInfo(templateId).getData(); + } + + /** + * Get Template. Returns the Template specified by the `template_id` parameter. + * + * @param templateId The id of the Template to retrieve. (required) + * @return ApiResponse<TemplateGetResponse> + * @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 templateGetWithHttpInfo(String templateId) + throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, "Missing the required parameter 'templateId' when calling templateGet"); + } + + // 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(); + 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); + } + + /** + * 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 accountId Which account to return Templates for. Must be a team member. Use + * `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the Template List to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the + * Template objects. (optional) + * @return TemplateListResponse + * @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 TemplateListResponse templateList( + String accountId, Integer page, Integer pageSize, String query) throws ApiException { + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo() throws ApiException { + String accountId = null; + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId) throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo(String accountId) + throws ApiException { + Integer page = 1; + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo( + String accountId, Integer page) throws ApiException { + Integer pageSize = 20; + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * @see TemplateApi#templateList(String, Integer, Integer, String) + */ + public TemplateListResponse templateList(String accountId, Integer page, Integer pageSize) + throws ApiException { + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query).getData(); + } + + /** + * @see TemplateApi#templateListWithHttpInfo(String, Integer, Integer, String) + */ + public ApiResponse templateListWithHttpInfo( + String accountId, Integer page, Integer pageSize) throws ApiException { + String query = null; + + return templateListWithHttpInfo(accountId, page, pageSize, query); + } + + /** + * 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 accountId Which account to return Templates for. Must be a team member. Use + * `all` to indicate all team members. Defaults to your account. (optional) + * @param page Which page number of the Template List to return. Defaults to `1`. + * (optional, default to 1) + * @param pageSize Number of objects to be returned per page. Must be between `1` and + * `100`. Default is `20`. (optional, default to 20) + * @param query String that includes search terms and/or fields to be used to filter the + * Template objects. (optional) + * @return ApiResponse<TemplateListResponse> + * @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 templateListWithHttpInfo( + String accountId, Integer page, Integer pageSize, String query) 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("", "query", query)); + + 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"}; + GenericType localVarReturnType = + new GenericType() {}; + return apiClient.invokeAPI( + "TemplateApi.templateList", + "/template/list", + "GET", + localVarQueryParams, + null, + new LinkedHashMap<>(), + new LinkedHashMap<>(), + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); + } + + /** + * Remove User from Template. Removes the specified Account's access to the specified + * Template. + * + * @param templateId The id of the Template to remove the Account's access to. (required) + * @param templateRemoveUserRequest (required) + * @return TemplateGetResponse + * @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 TemplateGetResponse templateRemoveUser( + String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) + throws ApiException { + return templateRemoveUserWithHttpInfo(templateId, templateRemoveUserRequest).getData(); + } + + /** + * Remove User from Template. Removes the specified Account's access to the specified + * Template. + * + * @param templateId The id of the Template to remove the Account's access to. (required) + * @param templateRemoveUserRequest (required) + * @return ApiResponse<TemplateGetResponse> + * @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 templateRemoveUserWithHttpInfo( + String templateId, TemplateRemoveUserRequest templateRemoveUserRequest) + throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling templateRemoveUser"); + } + if (templateRemoveUserRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateRemoveUserRequest' when calling" + + " templateRemoveUser"); + } + + // 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(); + 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); + } + + /** + * 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 templateId The ID of the template whose files to update. (required) + * @param templateUpdateFilesRequest (required) + * @return TemplateUpdateFilesResponse + * @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 TemplateUpdateFilesResponse templateUpdateFiles( + String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) + throws ApiException { + return templateUpdateFilesWithHttpInfo(templateId, templateUpdateFilesRequest).getData(); + } + + /** + * 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 templateId The ID of the template whose files to update. (required) + * @param templateUpdateFilesRequest (required) + * @return ApiResponse<TemplateUpdateFilesResponse> + * @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 templateUpdateFilesWithHttpInfo( + String templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) + throws ApiException { + + // Check required parameters + if (templateId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateId' when calling templateUpdateFiles"); + } + if (templateUpdateFilesRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'templateUpdateFilesRequest' when calling" + + " templateUpdateFiles"); + } + + // 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(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java b/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java index 7d84200..6219c4a 100644 --- a/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java +++ b/src/main/java/com/dropbox/sign/api/UnclaimedDraftApi.java @@ -1,311 +1,399 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiClient; +import com.dropbox.sign.ApiException; import com.dropbox.sign.ApiResponse; import com.dropbox.sign.Configuration; -import com.dropbox.sign.Pair; - -import javax.ws.rs.core.GenericType; - -import com.dropbox.sign.model.ErrorResponse; import com.dropbox.sign.model.UnclaimedDraftCreateEmbeddedRequest; import com.dropbox.sign.model.UnclaimedDraftCreateEmbeddedWithTemplateRequest; import com.dropbox.sign.model.UnclaimedDraftCreateRequest; import com.dropbox.sign.model.UnclaimedDraftCreateResponse; import com.dropbox.sign.model.UnclaimedDraftEditAndResendRequest; - import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") public class UnclaimedDraftApi { - private ApiClient apiClient; - - public UnclaimedDraftApi() { - this(Configuration.getDefaultApiClient()); - } - - public UnclaimedDraftApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Get the API client - * - * @return API client - */ - public ApiClient getApiClient() { - return apiClient; - } + private ApiClient apiClient; - /** - * Set the API client - * - * @param apiClient an instance of API client - */ - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } + public UnclaimedDraftApi() { + this(Configuration.getDefaultApiClient()); + } - /** - * 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 unclaimedDraftCreateRequest (required) - * @return UnclaimedDraftCreateResponse - * @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 UnclaimedDraftCreateResponse unclaimedDraftCreate(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - return unclaimedDraftCreateWithHttpInfo(unclaimedDraftCreateRequest).getData(); - } + public UnclaimedDraftApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * Get the API client + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } - /** - * 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 unclaimedDraftCreateRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @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 unclaimedDraftCreateWithHttpInfo(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { - - // Check required parameters - if (unclaimedDraftCreateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateRequest' when calling unclaimedDraftCreate"); + /** + * Set the API client + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * 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 unclaimedDraftCreateRequest (required) + * @return UnclaimedDraftCreateResponse + * @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 UnclaimedDraftCreateResponse unclaimedDraftCreate( + UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { + return unclaimedDraftCreateWithHttpInfo(unclaimedDraftCreateRequest).getData(); + } - } - /** - * 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 unclaimedDraftCreateEmbeddedRequest (required) - * @return UnclaimedDraftCreateResponse - * @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 UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { - return unclaimedDraftCreateEmbeddedWithHttpInfo(unclaimedDraftCreateEmbeddedRequest).getData(); - } + /** + * 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 unclaimedDraftCreateRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @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 unclaimedDraftCreateWithHttpInfo( + UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) throws ApiException { + // Check required parameters + if (unclaimedDraftCreateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'unclaimedDraftCreateRequest' when calling" + + " unclaimedDraftCreate"); + } - /** - * 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 unclaimedDraftCreateEmbeddedRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @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 unclaimedDraftCreateEmbeddedWithHttpInfo(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) throws ApiException { - - // Check required parameters - if (unclaimedDraftCreateEmbeddedRequest == null) { - throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when calling unclaimedDraftCreateEmbedded"); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * 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 unclaimedDraftCreateEmbeddedRequest (required) + * @return UnclaimedDraftCreateResponse + * @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 UnclaimedDraftCreateResponse unclaimedDraftCreateEmbedded( + UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) + throws ApiException { + return unclaimedDraftCreateEmbeddedWithHttpInfo(unclaimedDraftCreateEmbeddedRequest) + .getData(); + } - } - /** - * 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 unclaimedDraftCreateEmbeddedWithTemplateRequest (required) - * @return UnclaimedDraftCreateResponse - * @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 UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { - return unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(unclaimedDraftCreateEmbeddedWithTemplateRequest).getData(); - } + /** + * 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 unclaimedDraftCreateEmbeddedRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @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 unclaimedDraftCreateEmbeddedWithHttpInfo( + UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) + throws ApiException { + // Check required parameters + if (unclaimedDraftCreateEmbeddedRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'unclaimedDraftCreateEmbeddedRequest' when" + + " calling unclaimedDraftCreateEmbedded"); + } - /** - * 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 unclaimedDraftCreateEmbeddedWithTemplateRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @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 unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) throws ApiException { - - // Check required parameters - if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { - throw new ApiException(400, "Missing the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling unclaimedDraftCreateEmbeddedWithTemplate"); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateEmbeddedRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + /** + * 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 unclaimedDraftCreateEmbeddedWithTemplateRequest (required) + * @return UnclaimedDraftCreateResponse + * @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 UnclaimedDraftCreateResponse unclaimedDraftCreateEmbeddedWithTemplate( + UnclaimedDraftCreateEmbeddedWithTemplateRequest + unclaimedDraftCreateEmbeddedWithTemplateRequest) + throws ApiException { + return unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo( + unclaimedDraftCreateEmbeddedWithTemplateRequest) + .getData(); + } - } - /** - * 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 signatureRequestId The ID of the signature request to edit and resend. (required) - * @param unclaimedDraftEditAndResendRequest (required) - * @return UnclaimedDraftCreateResponse - * @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 UnclaimedDraftCreateResponse unclaimedDraftEditAndResend(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { - return unclaimedDraftEditAndResendWithHttpInfo(signatureRequestId, unclaimedDraftEditAndResendRequest).getData(); - } + /** + * 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 unclaimedDraftCreateEmbeddedWithTemplateRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @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 + unclaimedDraftCreateEmbeddedWithTemplateWithHttpInfo( + UnclaimedDraftCreateEmbeddedWithTemplateRequest + unclaimedDraftCreateEmbeddedWithTemplateRequest) + throws ApiException { + // Check required parameters + if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter" + + " 'unclaimedDraftCreateEmbeddedWithTemplateRequest' when calling" + + " unclaimedDraftCreateEmbeddedWithTemplate"); + } - /** - * 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 signatureRequestId The ID of the signature request to edit and resend. (required) - * @param unclaimedDraftEditAndResendRequest (required) - * @return ApiResponse<UnclaimedDraftCreateResponse> - * @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 unclaimedDraftEditAndResendWithHttpInfo(String signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) throws ApiException { - - // Check required parameters - if (signatureRequestId == null) { - throw new ApiException(400, "Missing the required parameter 'signatureRequestId' when calling unclaimedDraftEditAndResend"); + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + Map localVarFormParams = new LinkedHashMap<>(); + localVarFormParams = unclaimedDraftCreateEmbeddedWithTemplateRequest.createFormData(); + boolean isFileTypeFound = !localVarFormParams.isEmpty(); + 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); } - if (unclaimedDraftEditAndResendRequest == null) { - throw new ApiException(400, "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when calling unclaimedDraftEditAndResend"); + + /** + * 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 signatureRequestId The ID of the signature request to edit and resend. (required) + * @param unclaimedDraftEditAndResendRequest (required) + * @return UnclaimedDraftCreateResponse + * @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 UnclaimedDraftCreateResponse unclaimedDraftEditAndResend( + String signatureRequestId, + UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) + throws ApiException { + return unclaimedDraftEditAndResendWithHttpInfo( + signatureRequestId, unclaimedDraftEditAndResendRequest) + .getData(); } - // Path parameters - String localVarPath = "/unclaimed_draft/edit_and_resend/{signature_request_id}" - .replaceAll("\\{signature_request_id}", apiClient.escapeString(signatureRequestId.toString())); + /** + * 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 signatureRequestId The ID of the signature request to edit and resend. (required) + * @param unclaimedDraftEditAndResendRequest (required) + * @return ApiResponse<UnclaimedDraftCreateResponse> + * @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 unclaimedDraftEditAndResendWithHttpInfo( + String signatureRequestId, + UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) + throws ApiException { - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - Map localVarFormParams = new LinkedHashMap<>(); - localVarFormParams = unclaimedDraftEditAndResendRequest.createFormData(); - boolean isFileTypeFound = !localVarFormParams.isEmpty(); - 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 - ); + // Check required parameters + if (signatureRequestId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signatureRequestId' when calling" + + " unclaimedDraftEditAndResend"); + } + if (unclaimedDraftEditAndResendRequest == null) { + throw new ApiException( + 400, + "Missing the required parameter 'unclaimedDraftEditAndResendRequest' when" + + " calling unclaimedDraftEditAndResend"); + } - } -} \ No newline at end of file + // 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(); + 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); + } +} diff --git a/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java b/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java index 912c621..b066e13 100644 --- a/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java +++ b/src/main/java/com/dropbox/sign/auth/ApiKeyAuth.java @@ -10,70 +10,77 @@ * Do not edit the class manually. */ - package com.dropbox.sign.auth; -import com.dropbox.sign.Pair; import com.dropbox.sign.ApiException; - +import com.dropbox.sign.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } + private final String location; + private final String paramName; - public String getLocation() { - return location; - } + private String apiKey; + private String apiKeyPrefix; - public String getParamName() { - return paramName; - } + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } - public String getApiKey() { - return apiKey; - } + public String getLocation() { + return location; + } - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } + public String getParamName() { + return paramName; + } - public String getApiKeyPrefix() { - return apiKeyPrefix; - } + public String getApiKey() { + return apiKey; + } - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { - if (apiKey == null) { - return; + public String getApiKeyPrefix() { + return apiKeyPrefix; } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; } - 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); + + @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/src/main/java/com/dropbox/sign/auth/Authentication.java b/src/main/java/com/dropbox/sign/auth/Authentication.java index c5dc49d..9d18334 100644 --- a/src/main/java/com/dropbox/sign/auth/Authentication.java +++ b/src/main/java/com/dropbox/sign/auth/Authentication.java @@ -10,15 +10,13 @@ * Do not edit the class manually. */ - package com.dropbox.sign.auth; -import com.dropbox.sign.Pair; import com.dropbox.sign.ApiException; - +import com.dropbox.sign.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; public interface Authentication { /** @@ -28,6 +26,12 @@ public interface Authentication { * @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; - + void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException; } diff --git a/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java b/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java index e6da24f..d8c229c 100644 --- a/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java +++ b/src/main/java/com/dropbox/sign/auth/HttpBasicAuth.java @@ -10,46 +10,55 @@ * Do not edit the class manually. */ - package com.dropbox.sign.auth; -import com.dropbox.sign.Pair; import com.dropbox.sign.ApiException; - -import java.util.Base64; -import java.nio.charset.StandardCharsets; - +import com.dropbox.sign.Pair; import java.net.URI; -import java.util.Map; +import java.nio.charset.StandardCharsets; +import java.util.Base64; import java.util.List; +import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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; + private String username; + private String password; - public String getUsername() { - return username; - } + public String getUsername() { + return username; + } - public void setUsername(String username) { - this.username = username; - } + public void setUsername(String username) { + this.username = username; + } - public String getPassword() { - return password; - } + public String getPassword() { + return password; + } - public void setPassword(String password) { - this.password = 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; + @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))); } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); - } } diff --git a/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java b/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java index 1212c21..22500f2 100644 --- a/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java +++ b/src/main/java/com/dropbox/sign/auth/HttpBearerAuth.java @@ -10,53 +10,64 @@ * Do not edit the class manually. */ - package com.dropbox.sign.auth; -import com.dropbox.sign.Pair; import com.dropbox.sign.ApiException; - +import com.dropbox.sign.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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; - - 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; + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; } - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } + /** + * 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; + } - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } + headerParams.put( + "Authorization", + (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } } diff --git a/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java b/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java index 7c7b3b9..0081f2a 100644 --- a/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/dropbox/sign/model/AbstractOpenApiSchema.java @@ -10,21 +10,17 @@ * Do not edit the class manually. */ - package com.dropbox.sign.model; -import com.dropbox.sign.ApiException; -import java.util.Objects; -import java.lang.reflect.Type; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.Map; +import java.util.Objects; import javax.ws.rs.core.GenericType; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +@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 @@ -54,17 +50,22 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * @return an instance of the actual schema/object */ @JsonValue - public Object getActualInstance() {return instance;} + 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;} + 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 + * 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 */ @@ -76,7 +77,7 @@ private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { if (object.getActualInstance() == null) { return null; } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); } else { return object.getActualInstance(); } @@ -103,8 +104,8 @@ public String toString() { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * 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) { @@ -121,9 +122,9 @@ public boolean equals(Object o) { 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); + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); } @Override @@ -143,7 +144,4 @@ public Boolean isNullable() { return Boolean.FALSE; } } - - - } diff --git a/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java b/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java index e214889..fc3c308 100644 --- a/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountCreateRequest.java @@ -10,319 +10,307 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountCreateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountCreateRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; - - public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; - private String clientSecret; - - public static final String JSON_PROPERTY_LOCALE = "locale"; - private String locale; - - public AccountCreateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountCreateRequest.class); - } - - static public AccountCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountCreateRequest.class - ); - } - - public AccountCreateRequest emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address which will be associated with the new Account. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - public AccountCreateRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public AccountCreateRequest clientSecret(String clientSecret) { - this.clientSecret = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientSecret() { - return clientSecret; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - - public AccountCreateRequest locale(String locale) { - this.locale = 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 - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLocale() { - return locale; - } - - - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(String locale) { - this.locale = locale; - } - - - /** - * Return true if this AccountCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + private String clientSecret; + + public static final String JSON_PROPERTY_LOCALE = "locale"; + private String locale; + + public AccountCreateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountCreateRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static AccountCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountCreateRequest.class); } - AccountCreateRequest accountCreateRequest = (AccountCreateRequest) o; - return Objects.equals(this.emailAddress, accountCreateRequest.emailAddress) && - Objects.equals(this.clientId, accountCreateRequest.clientId) && - Objects.equals(this.clientSecret, accountCreateRequest.clientSecret) && - Objects.equals(this.locale, accountCreateRequest.locale); - } - - @Override - public int hashCode() { - return Objects.hash(emailAddress, clientId, clientSecret, locale); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountCreateRequest {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - 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)); - } + public AccountCreateRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + /** + * The email address which will be associated with the new Account. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; } - if (clientSecret != null) { - if (isFileTypeOrListOfFiles(clientSecret)) { - fileTypeFound = true; - } - if (clientSecret.getClass().equals(java.io.File.class) || - clientSecret.getClass().equals(Integer.class) || - clientSecret.getClass().equals(String.class) || - clientSecret.getClass().isEnum()) { - map.put("client_secret", clientSecret); - } else if (isListOfFile(clientSecret)) { - for(int i = 0; i< getListSize(clientSecret); i++) { - map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); - } - } - else { - map.put("client_secret", JSON.getDefault().getMapper().writeValueAsString(clientSecret)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - if (locale.getClass().equals(java.io.File.class) || - locale.getClass().equals(Integer.class) || - locale.getClass().equals(String.class) || - locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for(int i = 0; i< getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } + public AccountCreateRequest clientId(String clientId) { + this.clientId = 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public AccountCreateRequest clientSecret(String clientSecret) { + this.clientSecret = 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 @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientSecret() { + return clientSecret; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public AccountCreateRequest locale(String locale) { + this.locale = 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 @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocale() { + return locale; + } + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(String locale) { + this.locale = locale; + } + + /** Return true if this AccountCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountCreateRequest accountCreateRequest = (AccountCreateRequest) o; + return Objects.equals(this.emailAddress, accountCreateRequest.emailAddress) + && Objects.equals(this.clientId, accountCreateRequest.clientId) + && Objects.equals(this.clientSecret, accountCreateRequest.clientSecret) + && Objects.equals(this.locale, accountCreateRequest.locale); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(emailAddress, clientId, clientSecret, locale); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCreateRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (clientSecret != null) { + if (isFileTypeOrListOfFiles(clientSecret)) { + fileTypeFound = true; + } + + if (clientSecret.getClass().equals(java.io.File.class) + || clientSecret.getClass().equals(Integer.class) + || clientSecret.getClass().equals(String.class) + || clientSecret.getClass().isEnum()) { + map.put("client_secret", clientSecret); + } else if (isListOfFile(clientSecret)) { + for (int i = 0; i < getListSize(clientSecret); i++) { + map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); + } + } else { + map.put( + "client_secret", + JSON.getDefault().getMapper().writeValueAsString(clientSecret)); + } + } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } + + if (locale.getClass().equals(java.io.File.class) + || locale.getClass().equals(Integer.class) + || locale.getClass().equals(String.class) + || locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for (int i = 0; i < getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); + } + } else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java b/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java index 173433d..be4f950 100644 --- a/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountCreateResponse.java @@ -10,282 +10,264 @@ * 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.dropbox.sign.model.OAuthTokenResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountCreateResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountCreateResponse { - public static final String JSON_PROPERTY_ACCOUNT = "account"; - private AccountResponse account; - - public static final String JSON_PROPERTY_OAUTH_DATA = "oauth_data"; - private OAuthTokenResponse oauthData; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings = null; - - public AccountCreateResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountCreateResponse.class); - } - - static public AccountCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountCreateResponse.class - ); - } - - public AccountCreateResponse account(AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * @return account - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public AccountResponse getAccount() { - return account; - } - - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAccount(AccountResponse account) { - this.account = account; - } - - - public AccountCreateResponse oauthData(OAuthTokenResponse oauthData) { - this.oauthData = oauthData; - return this; - } - - /** - * Get oauthData - * @return oauthData - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OAUTH_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OAuthTokenResponse getOauthData() { - return oauthData; - } - - - @JsonProperty(JSON_PROPERTY_OAUTH_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauthData(OAuthTokenResponse oauthData) { - this.oauthData = oauthData; - } - - - public AccountCreateResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_ACCOUNT = "account"; + private AccountResponse account; + + public static final String JSON_PROPERTY_OAUTH_DATA = "oauth_data"; + private OAuthTokenResponse oauthData; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public AccountCreateResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountCreateResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this AccountCreateResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static AccountCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), AccountCreateResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public AccountCreateResponse account(AccountResponse account) { + this.account = account; + return this; } - AccountCreateResponse accountCreateResponse = (AccountCreateResponse) o; - return Objects.equals(this.account, accountCreateResponse.account) && - Objects.equals(this.oauthData, accountCreateResponse.oauthData) && - Objects.equals(this.warnings, accountCreateResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(account, oauthData, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountCreateResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" oauthData: ").append(toIndentedString(oauthData)).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 (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - if (account.getClass().equals(java.io.File.class) || - account.getClass().equals(Integer.class) || - account.getClass().equals(String.class) || - account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for(int i = 0; i< getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } - else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } + /** + * Get account + * + * @return account + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AccountResponse getAccount() { + return account; } - if (oauthData != null) { - if (isFileTypeOrListOfFiles(oauthData)) { - fileTypeFound = true; - } - if (oauthData.getClass().equals(java.io.File.class) || - oauthData.getClass().equals(Integer.class) || - oauthData.getClass().equals(String.class) || - oauthData.getClass().isEnum()) { - map.put("oauth_data", oauthData); - } else if (isListOfFile(oauthData)) { - for(int i = 0; i< getListSize(oauthData); i++) { - map.put("oauth_data[" + i + "]", getFromList(oauthData, i)); - } - } - else { - map.put("oauth_data", JSON.getDefault().getMapper().writeValueAsString(oauthData)); - } + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAccount(AccountResponse account) { + this.account = account; + } + + public AccountCreateResponse oauthData(OAuthTokenResponse oauthData) { + this.oauthData = oauthData; + return this; + } + + /** + * Get oauthData + * + * @return oauthData + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OAuthTokenResponse getOauthData() { + return oauthData; + } + + @JsonProperty(JSON_PROPERTY_OAUTH_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauthData(OAuthTokenResponse oauthData) { + this.oauthData = oauthData; + } + + public AccountCreateResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public AccountCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this AccountCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountCreateResponse accountCreateResponse = (AccountCreateResponse) o; + return Objects.equals(this.account, accountCreateResponse.account) + && Objects.equals(this.oauthData, accountCreateResponse.oauthData) + && Objects.equals(this.warnings, accountCreateResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(account, oauthData, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountCreateResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" oauthData: ").append(toIndentedString(oauthData)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; + } + + if (account.getClass().equals(java.io.File.class) + || account.getClass().equals(Integer.class) + || account.getClass().equals(String.class) + || account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for (int i = 0; i < getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } + } + if (oauthData != null) { + if (isFileTypeOrListOfFiles(oauthData)) { + fileTypeFound = true; + } + + if (oauthData.getClass().equals(java.io.File.class) + || oauthData.getClass().equals(Integer.class) + || oauthData.getClass().equals(String.class) + || oauthData.getClass().isEnum()) { + map.put("oauth_data", oauthData); + } else if (isListOfFile(oauthData)) { + for (int i = 0; i < getListSize(oauthData); i++) { + map.put("oauth_data[" + i + "]", getFromList(oauthData, i)); + } + } else { + map.put( + "oauth_data", + JSON.getDefault().getMapper().writeValueAsString(oauthData)); + } + } + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/AccountGetResponse.java b/src/main/java/com/dropbox/sign/model/AccountGetResponse.java index b642115..36473bf 100644 --- a/src/main/java/com/dropbox/sign/model/AccountGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountGetResponse.java @@ -10,231 +10,215 @@ * 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.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountGetResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public AccountGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountGetResponse.class); - } - - static public AccountGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountGetResponse.class - ); - } - - public AccountGetResponse account(AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * @return account - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public AccountResponse getAccount() { - return account; - } - - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAccount(AccountResponse account) { - this.account = account; - } - - - public AccountGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this AccountGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountGetResponse accountGetResponse = (AccountGetResponse) o; - return Objects.equals(this.account, accountGetResponse.account) && - Objects.equals(this.warnings, accountGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(account, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountGetResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).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 (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ACCOUNT = "account"; + private AccountResponse account; - if (account.getClass().equals(java.io.File.class) || - account.getClass().equals(Integer.class) || - account.getClass().equals(String.class) || - account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for(int i = 0; i< getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } - else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public AccountGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountGetResponse.class); + } + + public static AccountGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountGetResponse.class); + } + + public AccountGetResponse account(AccountResponse account) { + this.account = account; + return this; + } + + /** + * Get account + * + * @return account + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AccountResponse getAccount() { + return account; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAccount(AccountResponse account) { + this.account = account; + } + + public AccountGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public AccountGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this AccountGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountGetResponse accountGetResponse = (AccountGetResponse) o; + return Objects.equals(this.account, accountGetResponse.account) + && Objects.equals(this.warnings, accountGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(account, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountGetResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; + } + + if (account.getClass().equals(java.io.File.class) + || account.getClass().equals(Integer.class) + || account.getClass().equals(String.class) + || account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for (int i = 0; i < getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountResponse.java b/src/main/java/com/dropbox/sign/model/AccountResponse.java index 6c1e562..541c7f6 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponse.java @@ -10,671 +10,645 @@ * 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.AccountResponseQuotas; -import com.dropbox.sign.model.AccountResponseUsage; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountResponse { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - private String accountId; + 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 static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - private Boolean isLocked; + public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + private Boolean isLocked; - public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; - private Boolean isPaidHs; - - public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; - private Boolean isPaidHf; + public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; + private Boolean isPaidHs; - public static final String JSON_PROPERTY_QUOTAS = "quotas"; - private AccountResponseQuotas quotas; + public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; + private Boolean isPaidHf; - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; + public static final String JSON_PROPERTY_QUOTAS = "quotas"; + private AccountResponseQuotas quotas; - public static final String JSON_PROPERTY_ROLE_CODE = "role_code"; - private String roleCode; - - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - private String teamId; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; - public static final String JSON_PROPERTY_LOCALE = "locale"; - private String locale; + public static final String JSON_PROPERTY_ROLE_CODE = "role_code"; + private String roleCode; - public static final String JSON_PROPERTY_USAGE = "usage"; - private AccountResponseUsage usage; + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; - public AccountResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponse.class); - } + public static final String JSON_PROPERTY_LOCALE = "locale"; + private String locale; - static public AccountResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountResponse.class - ); - } + public static final String JSON_PROPERTY_USAGE = "usage"; + private AccountResponseUsage usage; - public AccountResponse accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The ID of the Account - * @return accountId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getAccountId() { - return accountId; - } + public AccountResponse() {} + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponse.class); + } - @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountId(String accountId) { - this.accountId = accountId; - } + public static AccountResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountResponse.class); + } + public AccountResponse accountId(String accountId) { + this.accountId = accountId; + return this; + } - public AccountResponse emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * @return emailAddress - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEmailAddress() { - return emailAddress; - } + /** + * The ID of the Account + * + * @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; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - + public AccountResponse emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - public AccountResponse isLocked(Boolean isLocked) { - this.isLocked = isLocked; - return this; - } + /** + * The email address associated with the Account. + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; + } - /** - * Returns `true` if the user has been locked out of their account by a team admin. - * @return isLocked - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsLocked() { - return isLocked; - } - - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(Boolean isLocked) { - this.isLocked = isLocked; - } - - - public AccountResponse isPaidHs(Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - return this; - } - - /** - * Returns `true` if the user has a paid Dropbox Sign account. - * @return isPaidHs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsPaidHs() { - return isPaidHs; - } - - - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHs(Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - } - - - public AccountResponse isPaidHf(Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - return this; - } - - /** - * Returns `true` if the user has a paid HelloFax account. - * @return isPaidHf - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsPaidHf() { - return isPaidHf; - } - - - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHf(Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - } - - - public AccountResponse quotas(AccountResponseQuotas quotas) { - this.quotas = quotas; - return this; - } - - /** - * Get quotas - * @return quotas - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public AccountResponseQuotas getQuotas() { - return quotas; - } - - - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuotas(AccountResponseQuotas quotas) { - this.quotas = quotas; - } - - - public AccountResponse callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL that Dropbox Sign events will `POST` to. - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public AccountResponse roleCode(String roleCode) { - this.roleCode = roleCode; - return this; - } - - /** - * The membership role for the team. - * @return roleCode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROLE_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRoleCode() { - return roleCode; - } - - - @JsonProperty(JSON_PROPERTY_ROLE_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; - } - - - public AccountResponse teamId(String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of the team account belongs to. - * @return teamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTeamId() { - return teamId; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - - public AccountResponse locale(String locale) { - this.locale = 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 - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLocale() { - return locale; - } - - - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(String locale) { - this.locale = locale; - } - - - public AccountResponse usage(AccountResponseUsage usage) { - this.usage = usage; - return this; - } - - /** - * Get usage - * @return usage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public AccountResponseUsage getUsage() { - return usage; - } - - - @JsonProperty(JSON_PROPERTY_USAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsage(AccountResponseUsage usage) { - this.usage = usage; - } - - - /** - * Return true if this AccountResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountResponse accountResponse = (AccountResponse) o; - return Objects.equals(this.accountId, accountResponse.accountId) && - Objects.equals(this.emailAddress, accountResponse.emailAddress) && - Objects.equals(this.isLocked, accountResponse.isLocked) && - Objects.equals(this.isPaidHs, accountResponse.isPaidHs) && - Objects.equals(this.isPaidHf, accountResponse.isPaidHf) && - Objects.equals(this.quotas, accountResponse.quotas) && - Objects.equals(this.callbackUrl, accountResponse.callbackUrl) && - Objects.equals(this.roleCode, accountResponse.roleCode) && - Objects.equals(this.teamId, accountResponse.teamId) && - Objects.equals(this.locale, accountResponse.locale) && - Objects.equals(this.usage, accountResponse.usage); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas, callbackUrl, roleCode, teamId, locale, usage); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponse {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); - sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); - sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" roleCode: ").append(toIndentedString(roleCode)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } - 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)); - } + public AccountResponse isLocked(Boolean isLocked) { + this.isLocked = isLocked; + return this; } - 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)); - } + /** + * Returns `true` if the user has been locked out of their account by a team admin. + * + * @return isLocked + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLocked() { + return isLocked; } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - if (isLocked.getClass().equals(java.io.File.class) || - isLocked.getClass().equals(Integer.class) || - isLocked.getClass().equals(String.class) || - isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for(int i = 0; i< getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } - else { - map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(Boolean isLocked) { + this.isLocked = isLocked; } - if (isPaidHs != null) { - if (isFileTypeOrListOfFiles(isPaidHs)) { - fileTypeFound = true; - } - if (isPaidHs.getClass().equals(java.io.File.class) || - isPaidHs.getClass().equals(Integer.class) || - isPaidHs.getClass().equals(String.class) || - isPaidHs.getClass().isEnum()) { - map.put("is_paid_hs", isPaidHs); - } else if (isListOfFile(isPaidHs)) { - for(int i = 0; i< getListSize(isPaidHs); i++) { - map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); - } - } - else { - map.put("is_paid_hs", JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); - } + public AccountResponse isPaidHs(Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + return this; } - if (isPaidHf != null) { - if (isFileTypeOrListOfFiles(isPaidHf)) { - fileTypeFound = true; - } - if (isPaidHf.getClass().equals(java.io.File.class) || - isPaidHf.getClass().equals(Integer.class) || - isPaidHf.getClass().equals(String.class) || - isPaidHf.getClass().isEnum()) { - map.put("is_paid_hf", isPaidHf); - } else if (isListOfFile(isPaidHf)) { - for(int i = 0; i< getListSize(isPaidHf); i++) { - map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); - } - } - else { - map.put("is_paid_hf", JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); - } + /** + * Returns `true` if the user has a paid Dropbox Sign account. + * + * @return isPaidHs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaidHs() { + return isPaidHs; } - if (quotas != null) { - if (isFileTypeOrListOfFiles(quotas)) { - fileTypeFound = true; - } - if (quotas.getClass().equals(java.io.File.class) || - quotas.getClass().equals(Integer.class) || - quotas.getClass().equals(String.class) || - quotas.getClass().isEnum()) { - map.put("quotas", quotas); - } else if (isListOfFile(quotas)) { - for(int i = 0; i< getListSize(quotas); i++) { - map.put("quotas[" + i + "]", getFromList(quotas, i)); - } - } - else { - map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); - } + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHs(Boolean isPaidHs) { + this.isPaidHs = isPaidHs; } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + public AccountResponse isPaidHf(Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + return this; } - if (roleCode != null) { - if (isFileTypeOrListOfFiles(roleCode)) { - fileTypeFound = true; - } - if (roleCode.getClass().equals(java.io.File.class) || - roleCode.getClass().equals(Integer.class) || - roleCode.getClass().equals(String.class) || - roleCode.getClass().isEnum()) { - map.put("role_code", roleCode); - } else if (isListOfFile(roleCode)) { - for(int i = 0; i< getListSize(roleCode); i++) { - map.put("role_code[" + i + "]", getFromList(roleCode, i)); - } - } - else { - map.put("role_code", JSON.getDefault().getMapper().writeValueAsString(roleCode)); - } + /** + * Returns `true` if the user has a paid HelloFax account. + * + * @return isPaidHf + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaidHf() { + return isPaidHf; } - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - if (teamId.getClass().equals(java.io.File.class) || - teamId.getClass().equals(Integer.class) || - teamId.getClass().equals(String.class) || - teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for(int i = 0; i< getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } - else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHf(Boolean isPaidHf) { + this.isPaidHf = isPaidHf; } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - if (locale.getClass().equals(java.io.File.class) || - locale.getClass().equals(Integer.class) || - locale.getClass().equals(String.class) || - locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for(int i = 0; i< getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } - } - else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); - } + public AccountResponse quotas(AccountResponseQuotas quotas) { + this.quotas = quotas; + return this; } - if (usage != null) { - if (isFileTypeOrListOfFiles(usage)) { - fileTypeFound = true; - } - if (usage.getClass().equals(java.io.File.class) || - usage.getClass().equals(Integer.class) || - usage.getClass().equals(String.class) || - usage.getClass().isEnum()) { - map.put("usage", usage); - } else if (isListOfFile(usage)) { - for(int i = 0; i< getListSize(usage); i++) { - map.put("usage[" + i + "]", getFromList(usage, i)); - } - } - else { - map.put("usage", JSON.getDefault().getMapper().writeValueAsString(usage)); - } + /** + * Get quotas + * + * @return quotas + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccountResponseQuotas getQuotas() { + return quotas; + } + + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotas(AccountResponseQuotas quotas) { + this.quotas = quotas; } - } catch (Exception e) { - throw new ApiException(e); + + public AccountResponse callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - return fileTypeFound ? map : new HashMap<>(); - } + /** + * The URL that Dropbox Sign events will `POST` to. + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + public AccountResponse roleCode(String roleCode) { + this.roleCode = roleCode; + return this; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + /** + * The membership role for the team. + * + * @return roleCode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRoleCode() { + return roleCode; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + @JsonProperty(JSON_PROPERTY_ROLE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + public AccountResponse teamId(String teamId) { + this.teamId = teamId; + return this; + } - /** - * 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"; + /** + * The id of the team account belongs to. + * + * @return teamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; } - return o.toString().replace("\n", "\n "); - } -} + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public AccountResponse locale(String locale) { + this.locale = 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 @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocale() { + return locale; + } + + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(String locale) { + this.locale = locale; + } + + public AccountResponse usage(AccountResponseUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccountResponseUsage getUsage() { + return usage; + } + + @JsonProperty(JSON_PROPERTY_USAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsage(AccountResponseUsage usage) { + this.usage = usage; + } + + /** Return true if this AccountResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountResponse accountResponse = (AccountResponse) o; + return Objects.equals(this.accountId, accountResponse.accountId) + && Objects.equals(this.emailAddress, accountResponse.emailAddress) + && Objects.equals(this.isLocked, accountResponse.isLocked) + && Objects.equals(this.isPaidHs, accountResponse.isPaidHs) + && Objects.equals(this.isPaidHf, accountResponse.isPaidHf) + && Objects.equals(this.quotas, accountResponse.quotas) + && Objects.equals(this.callbackUrl, accountResponse.callbackUrl) + && Objects.equals(this.roleCode, accountResponse.roleCode) + && Objects.equals(this.teamId, accountResponse.teamId) + && Objects.equals(this.locale, accountResponse.locale) + && Objects.equals(this.usage, accountResponse.usage); + } + + @Override + public int hashCode() { + return Objects.hash( + accountId, + emailAddress, + isLocked, + isPaidHs, + isPaidHf, + quotas, + callbackUrl, + roleCode, + teamId, + locale, + usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponse {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); + sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); + sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" roleCode: ").append(toIndentedString(roleCode)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } + + if (isLocked.getClass().equals(java.io.File.class) + || isLocked.getClass().equals(Integer.class) + || isLocked.getClass().equals(String.class) + || isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for (int i = 0; i < getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } else { + map.put( + "is_locked", + JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } + } + if (isPaidHs != null) { + if (isFileTypeOrListOfFiles(isPaidHs)) { + fileTypeFound = true; + } + + if (isPaidHs.getClass().equals(java.io.File.class) + || isPaidHs.getClass().equals(Integer.class) + || isPaidHs.getClass().equals(String.class) + || isPaidHs.getClass().isEnum()) { + map.put("is_paid_hs", isPaidHs); + } else if (isListOfFile(isPaidHs)) { + for (int i = 0; i < getListSize(isPaidHs); i++) { + map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); + } + } else { + map.put( + "is_paid_hs", + JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); + } + } + if (isPaidHf != null) { + if (isFileTypeOrListOfFiles(isPaidHf)) { + fileTypeFound = true; + } + + if (isPaidHf.getClass().equals(java.io.File.class) + || isPaidHf.getClass().equals(Integer.class) + || isPaidHf.getClass().equals(String.class) + || isPaidHf.getClass().isEnum()) { + map.put("is_paid_hf", isPaidHf); + } else if (isListOfFile(isPaidHf)) { + for (int i = 0; i < getListSize(isPaidHf); i++) { + map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); + } + } else { + map.put( + "is_paid_hf", + JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); + } + } + if (quotas != null) { + if (isFileTypeOrListOfFiles(quotas)) { + fileTypeFound = true; + } + + if (quotas.getClass().equals(java.io.File.class) + || quotas.getClass().equals(Integer.class) + || quotas.getClass().equals(String.class) + || quotas.getClass().isEnum()) { + map.put("quotas", quotas); + } else if (isListOfFile(quotas)) { + for (int i = 0; i < getListSize(quotas); i++) { + map.put("quotas[" + i + "]", getFromList(quotas, i)); + } + } else { + map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); + } + } + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (roleCode != null) { + if (isFileTypeOrListOfFiles(roleCode)) { + fileTypeFound = true; + } + + if (roleCode.getClass().equals(java.io.File.class) + || roleCode.getClass().equals(Integer.class) + || roleCode.getClass().equals(String.class) + || roleCode.getClass().isEnum()) { + map.put("role_code", roleCode); + } else if (isListOfFile(roleCode)) { + for (int i = 0; i < getListSize(roleCode); i++) { + map.put("role_code[" + i + "]", getFromList(roleCode, i)); + } + } else { + map.put( + "role_code", + JSON.getDefault().getMapper().writeValueAsString(roleCode)); + } + } + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } + + if (teamId.getClass().equals(java.io.File.class) + || teamId.getClass().equals(Integer.class) + || teamId.getClass().equals(String.class) + || teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for (int i = 0; i < getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } + } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } + + if (locale.getClass().equals(java.io.File.class) + || locale.getClass().equals(Integer.class) + || locale.getClass().equals(String.class) + || locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for (int i = 0; i < getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); + } + } else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } + } + if (usage != null) { + if (isFileTypeOrListOfFiles(usage)) { + fileTypeFound = true; + } + + if (usage.getClass().equals(java.io.File.class) + || usage.getClass().equals(Integer.class) + || usage.getClass().equals(String.class) + || usage.getClass().isEnum()) { + map.put("usage", usage); + } else if (isListOfFile(usage)) { + for (int i = 0; i < getListSize(usage); i++) { + map.put("usage[" + i + "]", getFromList(usage, i)); + } + } else { + map.put("usage", JSON.getDefault().getMapper().writeValueAsString(usage)); + } + } + } 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/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java b/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java index 85ee5e8..584917f 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponseQuotas.java @@ -10,419 +10,421 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Details concerning remaining monthly quotas. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountResponseQuotas { - public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; - private Integer apiSignatureRequestsLeft; - - public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; - private Integer documentsLeft; - - public static final String JSON_PROPERTY_TEMPLATES_TOTAL = "templates_total"; - private Integer templatesTotal; - - public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; - private Integer templatesLeft; - - public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; - private Integer smsVerificationsLeft; - - public static final String JSON_PROPERTY_NUM_FAX_PAGES_LEFT = "num_fax_pages_left"; - private Integer numFaxPagesLeft; - - public AccountResponseQuotas() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountResponseQuotas init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponseQuotas.class); - } - - static public AccountResponseQuotas init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountResponseQuotas.class - ); - } - - public AccountResponseQuotas apiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - return this; - } - - /** - * API signature requests remaining. - * @return apiSignatureRequestsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getApiSignatureRequestsLeft() { - return apiSignatureRequestsLeft; - } - - - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - } - - - public AccountResponseQuotas documentsLeft(Integer documentsLeft) { - this.documentsLeft = documentsLeft; - return this; - } - - /** - * Signature requests remaining. - * @return documentsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getDocumentsLeft() { - return documentsLeft; - } - - - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocumentsLeft(Integer documentsLeft) { - this.documentsLeft = documentsLeft; - } - - - public AccountResponseQuotas templatesTotal(Integer templatesTotal) { - this.templatesTotal = templatesTotal; - return this; - } - - /** - * Total API templates allowed. - * @return templatesTotal - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getTemplatesTotal() { - return templatesTotal; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesTotal(Integer templatesTotal) { - this.templatesTotal = templatesTotal; - } - - - public AccountResponseQuotas templatesLeft(Integer templatesLeft) { - this.templatesLeft = templatesLeft; - return this; - } - - /** - * API templates remaining. - * @return templatesLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getTemplatesLeft() { - return templatesLeft; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesLeft(Integer templatesLeft) { - this.templatesLeft = templatesLeft; - } - - - public AccountResponseQuotas smsVerificationsLeft(Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - return this; - } - - /** - * SMS verifications remaining. - * @return smsVerificationsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getSmsVerificationsLeft() { - return smsVerificationsLeft; - } - - - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsVerificationsLeft(Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - } - - - public AccountResponseQuotas numFaxPagesLeft(Integer numFaxPagesLeft) { - this.numFaxPagesLeft = numFaxPagesLeft; - return this; - } - - /** - * Number of fax pages left - * @return numFaxPagesLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumFaxPagesLeft() { - return numFaxPagesLeft; - } - - - @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumFaxPagesLeft(Integer numFaxPagesLeft) { - this.numFaxPagesLeft = numFaxPagesLeft; - } - - - /** - * Return true if this AccountResponseQuotas object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = + "api_signature_requests_left"; + private Integer apiSignatureRequestsLeft; + + public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; + private Integer documentsLeft; + + public static final String JSON_PROPERTY_TEMPLATES_TOTAL = "templates_total"; + private Integer templatesTotal; + + public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; + private Integer templatesLeft; + + public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; + private Integer smsVerificationsLeft; + + public static final String JSON_PROPERTY_NUM_FAX_PAGES_LEFT = "num_fax_pages_left"; + private Integer numFaxPagesLeft; + + public AccountResponseQuotas() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountResponseQuotas init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponseQuotas.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static AccountResponseQuotas init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), AccountResponseQuotas.class); } - AccountResponseQuotas accountResponseQuotas = (AccountResponseQuotas) o; - return Objects.equals(this.apiSignatureRequestsLeft, accountResponseQuotas.apiSignatureRequestsLeft) && - Objects.equals(this.documentsLeft, accountResponseQuotas.documentsLeft) && - Objects.equals(this.templatesTotal, accountResponseQuotas.templatesTotal) && - Objects.equals(this.templatesLeft, accountResponseQuotas.templatesLeft) && - Objects.equals(this.smsVerificationsLeft, accountResponseQuotas.smsVerificationsLeft) && - Objects.equals(this.numFaxPagesLeft, accountResponseQuotas.numFaxPagesLeft); - } - - @Override - public int hashCode() { - return Objects.hash(apiSignatureRequestsLeft, documentsLeft, templatesTotal, templatesLeft, smsVerificationsLeft, numFaxPagesLeft); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponseQuotas {\n"); - sb.append(" apiSignatureRequestsLeft: ").append(toIndentedString(apiSignatureRequestsLeft)).append("\n"); - sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); - sb.append(" templatesTotal: ").append(toIndentedString(templatesTotal)).append("\n"); - sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); - sb.append(" smsVerificationsLeft: ").append(toIndentedString(smsVerificationsLeft)).append("\n"); - sb.append(" numFaxPagesLeft: ").append(toIndentedString(numFaxPagesLeft)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiSignatureRequestsLeft != null) { - if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { - fileTypeFound = true; - } - if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) || - apiSignatureRequestsLeft.getClass().equals(Integer.class) || - apiSignatureRequestsLeft.getClass().equals(String.class) || - apiSignatureRequestsLeft.getClass().isEnum()) { - map.put("api_signature_requests_left", apiSignatureRequestsLeft); - } else if (isListOfFile(apiSignatureRequestsLeft)) { - for(int i = 0; i< getListSize(apiSignatureRequestsLeft); i++) { - map.put("api_signature_requests_left[" + i + "]", getFromList(apiSignatureRequestsLeft, i)); - } - } - else { - map.put("api_signature_requests_left", JSON.getDefault().getMapper().writeValueAsString(apiSignatureRequestsLeft)); - } + public AccountResponseQuotas apiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + return this; } - if (documentsLeft != null) { - if (isFileTypeOrListOfFiles(documentsLeft)) { - fileTypeFound = true; - } - if (documentsLeft.getClass().equals(java.io.File.class) || - documentsLeft.getClass().equals(Integer.class) || - documentsLeft.getClass().equals(String.class) || - documentsLeft.getClass().isEnum()) { - map.put("documents_left", documentsLeft); - } else if (isListOfFile(documentsLeft)) { - for(int i = 0; i< getListSize(documentsLeft); i++) { - map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); - } - } - else { - map.put("documents_left", JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); - } + /** + * API signature requests remaining. + * + * @return apiSignatureRequestsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getApiSignatureRequestsLeft() { + return apiSignatureRequestsLeft; } - if (templatesTotal != null) { - if (isFileTypeOrListOfFiles(templatesTotal)) { - fileTypeFound = true; - } - if (templatesTotal.getClass().equals(java.io.File.class) || - templatesTotal.getClass().equals(Integer.class) || - templatesTotal.getClass().equals(String.class) || - templatesTotal.getClass().isEnum()) { - map.put("templates_total", templatesTotal); - } else if (isListOfFile(templatesTotal)) { - for(int i = 0; i< getListSize(templatesTotal); i++) { - map.put("templates_total[" + i + "]", getFromList(templatesTotal, i)); - } - } - else { - map.put("templates_total", JSON.getDefault().getMapper().writeValueAsString(templatesTotal)); - } + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; } - if (templatesLeft != null) { - if (isFileTypeOrListOfFiles(templatesLeft)) { - fileTypeFound = true; - } - if (templatesLeft.getClass().equals(java.io.File.class) || - templatesLeft.getClass().equals(Integer.class) || - templatesLeft.getClass().equals(String.class) || - templatesLeft.getClass().isEnum()) { - map.put("templates_left", templatesLeft); - } else if (isListOfFile(templatesLeft)) { - for(int i = 0; i< getListSize(templatesLeft); i++) { - map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); - } - } - else { - map.put("templates_left", JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); - } + public AccountResponseQuotas documentsLeft(Integer documentsLeft) { + this.documentsLeft = documentsLeft; + return this; } - if (smsVerificationsLeft != null) { - if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { - fileTypeFound = true; - } - if (smsVerificationsLeft.getClass().equals(java.io.File.class) || - smsVerificationsLeft.getClass().equals(Integer.class) || - smsVerificationsLeft.getClass().equals(String.class) || - smsVerificationsLeft.getClass().isEnum()) { - map.put("sms_verifications_left", smsVerificationsLeft); - } else if (isListOfFile(smsVerificationsLeft)) { - for(int i = 0; i< getListSize(smsVerificationsLeft); i++) { - map.put("sms_verifications_left[" + i + "]", getFromList(smsVerificationsLeft, i)); - } - } - else { - map.put("sms_verifications_left", JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); - } + /** + * Signature requests remaining. + * + * @return documentsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDocumentsLeft() { + return documentsLeft; } - if (numFaxPagesLeft != null) { - if (isFileTypeOrListOfFiles(numFaxPagesLeft)) { - fileTypeFound = true; - } - if (numFaxPagesLeft.getClass().equals(java.io.File.class) || - numFaxPagesLeft.getClass().equals(Integer.class) || - numFaxPagesLeft.getClass().equals(String.class) || - numFaxPagesLeft.getClass().isEnum()) { - map.put("num_fax_pages_left", numFaxPagesLeft); - } else if (isListOfFile(numFaxPagesLeft)) { - for(int i = 0; i< getListSize(numFaxPagesLeft); i++) { - map.put("num_fax_pages_left[" + i + "]", getFromList(numFaxPagesLeft, i)); - } + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentsLeft(Integer documentsLeft) { + this.documentsLeft = documentsLeft; + } + + public AccountResponseQuotas templatesTotal(Integer templatesTotal) { + this.templatesTotal = templatesTotal; + return this; + } + + /** + * Total API templates allowed. + * + * @return templatesTotal + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTemplatesTotal() { + return templatesTotal; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATES_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesTotal(Integer templatesTotal) { + this.templatesTotal = templatesTotal; + } + + public AccountResponseQuotas templatesLeft(Integer templatesLeft) { + this.templatesLeft = templatesLeft; + return this; + } + + /** + * API templates remaining. + * + * @return templatesLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTemplatesLeft() { + return templatesLeft; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesLeft(Integer templatesLeft) { + this.templatesLeft = templatesLeft; + } + + public AccountResponseQuotas smsVerificationsLeft(Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + return this; + } + + /** + * SMS verifications remaining. + * + * @return smsVerificationsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSmsVerificationsLeft() { + return smsVerificationsLeft; + } + + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsVerificationsLeft(Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + } + + public AccountResponseQuotas numFaxPagesLeft(Integer numFaxPagesLeft) { + this.numFaxPagesLeft = numFaxPagesLeft; + return this; + } + + /** + * Number of fax pages left + * + * @return numFaxPagesLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumFaxPagesLeft() { + return numFaxPagesLeft; + } + + @JsonProperty(JSON_PROPERTY_NUM_FAX_PAGES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumFaxPagesLeft(Integer numFaxPagesLeft) { + this.numFaxPagesLeft = numFaxPagesLeft; + } + + /** Return true if this AccountResponseQuotas object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("num_fax_pages_left", JSON.getDefault().getMapper().writeValueAsString(numFaxPagesLeft)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountResponseQuotas accountResponseQuotas = (AccountResponseQuotas) o; + return Objects.equals( + this.apiSignatureRequestsLeft, + accountResponseQuotas.apiSignatureRequestsLeft) + && Objects.equals(this.documentsLeft, accountResponseQuotas.documentsLeft) + && Objects.equals(this.templatesTotal, accountResponseQuotas.templatesTotal) + && Objects.equals(this.templatesLeft, accountResponseQuotas.templatesLeft) + && Objects.equals( + this.smsVerificationsLeft, accountResponseQuotas.smsVerificationsLeft) + && Objects.equals(this.numFaxPagesLeft, accountResponseQuotas.numFaxPagesLeft); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + apiSignatureRequestsLeft, + documentsLeft, + templatesTotal, + templatesLeft, + smsVerificationsLeft, + numFaxPagesLeft); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponseQuotas {\n"); + sb.append(" apiSignatureRequestsLeft: ") + .append(toIndentedString(apiSignatureRequestsLeft)) + .append("\n"); + sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); + sb.append(" templatesTotal: ").append(toIndentedString(templatesTotal)).append("\n"); + sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); + sb.append(" smsVerificationsLeft: ") + .append(toIndentedString(smsVerificationsLeft)) + .append("\n"); + sb.append(" numFaxPagesLeft: ").append(toIndentedString(numFaxPagesLeft)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiSignatureRequestsLeft != null) { + if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { + fileTypeFound = true; + } + + if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) + || apiSignatureRequestsLeft.getClass().equals(Integer.class) + || apiSignatureRequestsLeft.getClass().equals(String.class) + || apiSignatureRequestsLeft.getClass().isEnum()) { + map.put("api_signature_requests_left", apiSignatureRequestsLeft); + } else if (isListOfFile(apiSignatureRequestsLeft)) { + for (int i = 0; i < getListSize(apiSignatureRequestsLeft); i++) { + map.put( + "api_signature_requests_left[" + i + "]", + getFromList(apiSignatureRequestsLeft, i)); + } + } else { + map.put( + "api_signature_requests_left", + JSON.getDefault() + .getMapper() + .writeValueAsString(apiSignatureRequestsLeft)); + } + } + if (documentsLeft != null) { + if (isFileTypeOrListOfFiles(documentsLeft)) { + fileTypeFound = true; + } + + if (documentsLeft.getClass().equals(java.io.File.class) + || documentsLeft.getClass().equals(Integer.class) + || documentsLeft.getClass().equals(String.class) + || documentsLeft.getClass().isEnum()) { + map.put("documents_left", documentsLeft); + } else if (isListOfFile(documentsLeft)) { + for (int i = 0; i < getListSize(documentsLeft); i++) { + map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); + } + } else { + map.put( + "documents_left", + JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); + } + } + if (templatesTotal != null) { + if (isFileTypeOrListOfFiles(templatesTotal)) { + fileTypeFound = true; + } + + if (templatesTotal.getClass().equals(java.io.File.class) + || templatesTotal.getClass().equals(Integer.class) + || templatesTotal.getClass().equals(String.class) + || templatesTotal.getClass().isEnum()) { + map.put("templates_total", templatesTotal); + } else if (isListOfFile(templatesTotal)) { + for (int i = 0; i < getListSize(templatesTotal); i++) { + map.put("templates_total[" + i + "]", getFromList(templatesTotal, i)); + } + } else { + map.put( + "templates_total", + JSON.getDefault().getMapper().writeValueAsString(templatesTotal)); + } + } + if (templatesLeft != null) { + if (isFileTypeOrListOfFiles(templatesLeft)) { + fileTypeFound = true; + } + + if (templatesLeft.getClass().equals(java.io.File.class) + || templatesLeft.getClass().equals(Integer.class) + || templatesLeft.getClass().equals(String.class) + || templatesLeft.getClass().isEnum()) { + map.put("templates_left", templatesLeft); + } else if (isListOfFile(templatesLeft)) { + for (int i = 0; i < getListSize(templatesLeft); i++) { + map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); + } + } else { + map.put( + "templates_left", + JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); + } + } + if (smsVerificationsLeft != null) { + if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { + fileTypeFound = true; + } + + if (smsVerificationsLeft.getClass().equals(java.io.File.class) + || smsVerificationsLeft.getClass().equals(Integer.class) + || smsVerificationsLeft.getClass().equals(String.class) + || smsVerificationsLeft.getClass().isEnum()) { + map.put("sms_verifications_left", smsVerificationsLeft); + } else if (isListOfFile(smsVerificationsLeft)) { + for (int i = 0; i < getListSize(smsVerificationsLeft); i++) { + map.put( + "sms_verifications_left[" + i + "]", + getFromList(smsVerificationsLeft, i)); + } + } else { + map.put( + "sms_verifications_left", + JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); + } + } + if (numFaxPagesLeft != null) { + if (isFileTypeOrListOfFiles(numFaxPagesLeft)) { + fileTypeFound = true; + } + + if (numFaxPagesLeft.getClass().equals(java.io.File.class) + || numFaxPagesLeft.getClass().equals(Integer.class) + || numFaxPagesLeft.getClass().equals(String.class) + || numFaxPagesLeft.getClass().isEnum()) { + map.put("num_fax_pages_left", numFaxPagesLeft); + } else if (isListOfFile(numFaxPagesLeft)) { + for (int i = 0; i < getListSize(numFaxPagesLeft); i++) { + map.put("num_fax_pages_left[" + i + "]", getFromList(numFaxPagesLeft, i)); + } + } else { + map.put( + "num_fax_pages_left", + JSON.getDefault().getMapper().writeValueAsString(numFaxPagesLeft)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java b/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java index 1d87ae1..daac059 100644 --- a/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java +++ b/src/main/java/com/dropbox/sign/model/AccountResponseUsage.java @@ -10,169 +10,158 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Details concerning monthly usage - */ -@JsonPropertyOrder({ - AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** Details concerning monthly usage */ +@JsonPropertyOrder({AccountResponseUsage.JSON_PROPERTY_FAX_PAGES_SENT}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountResponseUsage { - public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; - private Integer faxPagesSent; - - public AccountResponseUsage() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountResponseUsage init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountResponseUsage.class); - } - - static public AccountResponseUsage init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountResponseUsage.class - ); - } - - public AccountResponseUsage faxPagesSent(Integer faxPagesSent) { - this.faxPagesSent = faxPagesSent; - return this; - } - - /** - * Number of fax pages sent - * @return faxPagesSent - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFaxPagesSent() { - return faxPagesSent; - } - - - @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFaxPagesSent(Integer faxPagesSent) { - this.faxPagesSent = faxPagesSent; - } - - - /** - * Return true if this AccountResponseUsage object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_FAX_PAGES_SENT = "fax_pages_sent"; + private Integer faxPagesSent; + + public AccountResponseUsage() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountResponseUsage init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountResponseUsage.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static AccountResponseUsage init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountResponseUsage.class); } - AccountResponseUsage accountResponseUsage = (AccountResponseUsage) o; - return Objects.equals(this.faxPagesSent, accountResponseUsage.faxPagesSent); - } - - @Override - public int hashCode() { - return Objects.hash(faxPagesSent); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountResponseUsage {\n"); - sb.append(" faxPagesSent: ").append(toIndentedString(faxPagesSent)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (faxPagesSent != null) { - if (isFileTypeOrListOfFiles(faxPagesSent)) { - fileTypeFound = true; - } - if (faxPagesSent.getClass().equals(java.io.File.class) || - faxPagesSent.getClass().equals(Integer.class) || - faxPagesSent.getClass().equals(String.class) || - faxPagesSent.getClass().isEnum()) { - map.put("fax_pages_sent", faxPagesSent); - } else if (isListOfFile(faxPagesSent)) { - for(int i = 0; i< getListSize(faxPagesSent); i++) { - map.put("fax_pages_sent[" + i + "]", getFromList(faxPagesSent, i)); - } + public AccountResponseUsage faxPagesSent(Integer faxPagesSent) { + this.faxPagesSent = faxPagesSent; + return this; + } + + /** + * Number of fax pages sent + * + * @return faxPagesSent + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFaxPagesSent() { + return faxPagesSent; + } + + @JsonProperty(JSON_PROPERTY_FAX_PAGES_SENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFaxPagesSent(Integer faxPagesSent) { + this.faxPagesSent = faxPagesSent; + } + + /** Return true if this AccountResponseUsage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("fax_pages_sent", JSON.getDefault().getMapper().writeValueAsString(faxPagesSent)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountResponseUsage accountResponseUsage = (AccountResponseUsage) o; + return Objects.equals(this.faxPagesSent, accountResponseUsage.faxPagesSent); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(faxPagesSent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountResponseUsage {\n"); + sb.append(" faxPagesSent: ").append(toIndentedString(faxPagesSent)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (faxPagesSent != null) { + if (isFileTypeOrListOfFiles(faxPagesSent)) { + fileTypeFound = true; + } + + if (faxPagesSent.getClass().equals(java.io.File.class) + || faxPagesSent.getClass().equals(Integer.class) + || faxPagesSent.getClass().equals(String.class) + || faxPagesSent.getClass().isEnum()) { + map.put("fax_pages_sent", faxPagesSent); + } else if (isListOfFile(faxPagesSent)) { + for (int i = 0; i < getListSize(faxPagesSent); i++) { + map.put("fax_pages_sent[" + i + "]", getFromList(faxPagesSent, i)); + } + } else { + map.put( + "fax_pages_sent", + JSON.getDefault().getMapper().writeValueAsString(faxPagesSent)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java b/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java index 79d8c75..24bc0a8 100644 --- a/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountUpdateRequest.java @@ -10,269 +10,256 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountUpdateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountUpdateRequest { - public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; - private String accountId; - - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - public static final String JSON_PROPERTY_LOCALE = "locale"; - private String locale; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; - public AccountUpdateRequest() { - } + public static final String JSON_PROPERTY_LOCALE = "locale"; + private String locale; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountUpdateRequest.class); - } + public AccountUpdateRequest() {} - static public AccountUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountUpdateRequest.class - ); - } - - public AccountUpdateRequest accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The ID of the Account - * @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 AccountUpdateRequest callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL that Dropbox Sign should POST events to. - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public AccountUpdateRequest locale(String locale) { - this.locale = 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 - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountUpdateRequest.class); + } - public String getLocale() { - return locale; - } + public static AccountUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountUpdateRequest.class); + } + public AccountUpdateRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } - @JsonProperty(JSON_PROPERTY_LOCALE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(String locale) { - this.locale = locale; - } + /** + * The ID of the Account + * + * @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 AccountUpdateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public AccountUpdateRequest callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The URL that Dropbox Sign should POST events to. + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; } - AccountUpdateRequest accountUpdateRequest = (AccountUpdateRequest) o; - return Objects.equals(this.accountId, accountUpdateRequest.accountId) && - Objects.equals(this.callbackUrl, accountUpdateRequest.callbackUrl) && - Objects.equals(this.locale, accountUpdateRequest.locale); - } - @Override - public int hashCode() { - return Objects.hash(accountId, callbackUrl, locale); - } + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountUpdateRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public AccountUpdateRequest locale(String locale) { + this.locale = locale; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLocale() { + return locale; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_LOCALE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocale(String locale) { + this.locale = locale; } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } + /** Return true if this AccountUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountUpdateRequest accountUpdateRequest = (AccountUpdateRequest) o; + return Objects.equals(this.accountId, accountUpdateRequest.accountId) + && Objects.equals(this.callbackUrl, accountUpdateRequest.callbackUrl) + && Objects.equals(this.locale, accountUpdateRequest.locale); } - if (locale != null) { - if (isFileTypeOrListOfFiles(locale)) { - fileTypeFound = true; - } - if (locale.getClass().equals(java.io.File.class) || - locale.getClass().equals(Integer.class) || - locale.getClass().equals(String.class) || - locale.getClass().isEnum()) { - map.put("locale", locale); - } else if (isListOfFile(locale)) { - for(int i = 0; i< getListSize(locale); i++) { - map.put("locale[" + i + "]", getFromList(locale, i)); - } - } - else { - map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); - } + @Override + public int hashCode() { + return Objects.hash(accountId, callbackUrl, locale); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdateRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" locale: ").append(toIndentedString(locale)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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 (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (locale != null) { + if (isFileTypeOrListOfFiles(locale)) { + fileTypeFound = true; + } + + if (locale.getClass().equals(java.io.File.class) + || locale.getClass().equals(Integer.class) + || locale.getClass().equals(String.class) + || locale.getClass().isEnum()) { + map.put("locale", locale); + } else if (isListOfFile(locale)) { + for (int i = 0; i < getListSize(locale); i++) { + map.put("locale[" + i + "]", getFromList(locale, i)); + } + } else { + map.put("locale", JSON.getDefault().getMapper().writeValueAsString(locale)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java b/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java index 4d9d206..ffe2f15 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyRequest.java @@ -10,169 +10,159 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountVerifyRequest - */ -@JsonPropertyOrder({ - AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** AccountVerifyRequest */ +@JsonPropertyOrder({AccountVerifyRequest.JSON_PROPERTY_EMAIL_ADDRESS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountVerifyRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public AccountVerifyRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountVerifyRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyRequest.class); - } - - static public AccountVerifyRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountVerifyRequest.class - ); - } - - public AccountVerifyRequest emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Email address to run the verification for. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - /** - * Return true if this AccountVerifyRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public AccountVerifyRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountVerifyRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static AccountVerifyRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), AccountVerifyRequest.class); } - AccountVerifyRequest accountVerifyRequest = (AccountVerifyRequest) o; - return Objects.equals(this.emailAddress, accountVerifyRequest.emailAddress); - } - - @Override - public int hashCode() { - return Objects.hash(emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyRequest {\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 (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)); - } + public AccountVerifyRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Email address to run the verification for. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; + } + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /** Return true if this AccountVerifyRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountVerifyRequest accountVerifyRequest = (AccountVerifyRequest) o; + return Objects.equals(this.emailAddress, accountVerifyRequest.emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java b/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java index 5b32e1d..bce3d5a 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyResponse.java @@ -10,231 +10,215 @@ * 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.AccountVerifyResponseAccount; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountVerifyResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public AccountVerifyResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountVerifyResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyResponse.class); - } - - static public AccountVerifyResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountVerifyResponse.class - ); - } - - public AccountVerifyResponse account(AccountVerifyResponseAccount account) { - this.account = account; - return this; - } - - /** - * Get account - * @return account - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public AccountVerifyResponseAccount getAccount() { - return account; - } - - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccount(AccountVerifyResponseAccount account) { - this.account = account; - } - - - public AccountVerifyResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this AccountVerifyResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AccountVerifyResponse accountVerifyResponse = (AccountVerifyResponse) o; - return Objects.equals(this.account, accountVerifyResponse.account) && - Objects.equals(this.warnings, accountVerifyResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(account, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyResponse {\n"); - sb.append(" account: ").append(toIndentedString(account)).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 (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ACCOUNT = "account"; + private AccountVerifyResponseAccount account; - if (account.getClass().equals(java.io.File.class) || - account.getClass().equals(Integer.class) || - account.getClass().equals(String.class) || - account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for(int i = 0; i< getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } - else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public AccountVerifyResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountVerifyResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyResponse.class); + } + + public static AccountVerifyResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), AccountVerifyResponse.class); + } + + public AccountVerifyResponse account(AccountVerifyResponseAccount account) { + this.account = account; + return this; + } + + /** + * Get account + * + * @return account + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccountVerifyResponseAccount getAccount() { + return account; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccount(AccountVerifyResponseAccount account) { + this.account = account; + } + + public AccountVerifyResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public AccountVerifyResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this AccountVerifyResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountVerifyResponse accountVerifyResponse = (AccountVerifyResponse) o; + return Objects.equals(this.account, accountVerifyResponse.account) + && Objects.equals(this.warnings, accountVerifyResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(account, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyResponse {\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; + } + + if (account.getClass().equals(java.io.File.class) + || account.getClass().equals(Integer.class) + || account.getClass().equals(String.class) + || account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for (int i = 0; i < getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java b/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java index 5da20c9..3a2a2f7 100644 --- a/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java +++ b/src/main/java/com/dropbox/sign/model/AccountVerifyResponseAccount.java @@ -10,169 +10,161 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * AccountVerifyResponseAccount - */ -@JsonPropertyOrder({ - AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** AccountVerifyResponseAccount */ +@JsonPropertyOrder({AccountVerifyResponseAccount.JSON_PROPERTY_EMAIL_ADDRESS}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class AccountVerifyResponseAccount { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public AccountVerifyResponseAccount() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public AccountVerifyResponseAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, AccountVerifyResponseAccount.class); - } - - static public AccountVerifyResponseAccount init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - AccountVerifyResponseAccount.class - ); - } - - public AccountVerifyResponseAccount emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * @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 AccountVerifyResponseAccount object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public AccountVerifyResponseAccount() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static AccountVerifyResponseAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, AccountVerifyResponseAccount.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static AccountVerifyResponseAccount init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + AccountVerifyResponseAccount.class); } - AccountVerifyResponseAccount accountVerifyResponseAccount = (AccountVerifyResponseAccount) o; - return Objects.equals(this.emailAddress, accountVerifyResponseAccount.emailAddress); - } - - @Override - public int hashCode() { - return Objects.hash(emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AccountVerifyResponseAccount {\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 (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)); - } + public AccountVerifyResponseAccount emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address associated with the Account. + * + * @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 AccountVerifyResponseAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + AccountVerifyResponseAccount accountVerifyResponseAccount = + (AccountVerifyResponseAccount) o; + return Objects.equals(this.emailAddress, accountVerifyResponseAccount.emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(emailAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountVerifyResponseAccount {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java b/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java index 04a26e0..ff8e8a7 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppCreateRequest.java @@ -10,483 +10,459 @@ * 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.SubOAuth; -import com.dropbox.sign.model.SubOptions; -import com.dropbox.sign.model.SubWhiteLabelingOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * ApiAppCreateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppCreateRequest { - public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains = new ArrayList<>(); + public static final String JSON_PROPERTY_DOMAINS = "domains"; + private List domains = new ArrayList<>(); - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; - - public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; - private File customLogoFile; - - public static final String JSON_PROPERTY_OAUTH = "oauth"; - private SubOAuth oauth; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_OPTIONS = "options"; - private SubOptions options; - - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - private SubWhiteLabelingOptions whiteLabelingOptions; - - public ApiAppCreateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppCreateRequest.class); - } - - static public ApiAppCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppCreateRequest.class - ); - } - - public ApiAppCreateRequest domains(List domains) { - this.domains = domains; - return this; - } - - 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 - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getDomains() { - return domains; - } - - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDomains(List domains) { - this.domains = domains; - } - - - public ApiAppCreateRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name you want to assign to the ApiApp. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public ApiAppCreateRequest callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL at which the ApiApp should receive event callbacks. - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public ApiAppCreateRequest customLogoFile(File customLogoFile) { - this.customLogoFile = 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public File getCustomLogoFile() { - return customLogoFile; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomLogoFile(File customLogoFile) { - this.customLogoFile = customLogoFile; - } - - - public ApiAppCreateRequest oauth(SubOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * @return oauth - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubOAuth getOauth() { - return oauth; - } - - - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(SubOAuth oauth) { - this.oauth = oauth; - } - - - public ApiAppCreateRequest options(SubOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * @return options - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubOptions getOptions() { - return options; - } - - - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(SubOptions options) { - this.options = options; - } - - - public ApiAppCreateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; - } - - /** - * Get whiteLabelingOptions - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; - } - - - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - } - - - /** - * Return true if this ApiAppCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppCreateRequest apiAppCreateRequest = (ApiAppCreateRequest) o; - return Objects.equals(this.domains, apiAppCreateRequest.domains) && - Objects.equals(this.name, apiAppCreateRequest.name) && - Objects.equals(this.callbackUrl, apiAppCreateRequest.callbackUrl) && - Objects.equals(this.customLogoFile, apiAppCreateRequest.customLogoFile) && - Objects.equals(this.oauth, apiAppCreateRequest.oauth) && - Objects.equals(this.options, apiAppCreateRequest.options) && - Objects.equals(this.whiteLabelingOptions, apiAppCreateRequest.whiteLabelingOptions); - } - - @Override - public int hashCode() { - return Objects.hash(domains, name, callbackUrl, customLogoFile, oauth, options, whiteLabelingOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppCreateRequest {\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; - if (domains.getClass().equals(java.io.File.class) || - domains.getClass().equals(Integer.class) || - domains.getClass().equals(String.class) || - domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for(int i = 0; i< getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } - else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } + public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; + private File customLogoFile; + + public static final String JSON_PROPERTY_OAUTH = "oauth"; + private SubOAuth oauth; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private SubOptions options; + + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + private SubWhiteLabelingOptions whiteLabelingOptions; + + public ApiAppCreateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppCreateRequest.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static ApiAppCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppCreateRequest.class); } - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + public ApiAppCreateRequest domains(List domains) { + this.domains = domains; + return this; } - if (customLogoFile != null) { - if (isFileTypeOrListOfFiles(customLogoFile)) { - fileTypeFound = true; - } - if (customLogoFile.getClass().equals(java.io.File.class) || - customLogoFile.getClass().equals(Integer.class) || - customLogoFile.getClass().equals(String.class) || - customLogoFile.getClass().isEnum()) { - map.put("custom_logo_file", customLogoFile); - } else if (isListOfFile(customLogoFile)) { - for(int i = 0; i< getListSize(customLogoFile); i++) { - map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); - } - } - else { - map.put("custom_logo_file", JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); + public ApiAppCreateRequest addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); } + this.domains.add(domainsItem); + return this; } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - if (oauth.getClass().equals(java.io.File.class) || - oauth.getClass().equals(Integer.class) || - oauth.getClass().equals(String.class) || - oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for(int i = 0; i< getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } - else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } + /** + * The domain names the ApiApp will be associated with. + * + * @return domains + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDomains() { + return domains; } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - if (options.getClass().equals(java.io.File.class) || - options.getClass().equals(Integer.class) || - options.getClass().equals(String.class) || - options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for(int i = 0; i< getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } - else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDomains(List domains) { + this.domains = domains; } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; - } - if (whiteLabelingOptions.getClass().equals(java.io.File.class) || - whiteLabelingOptions.getClass().equals(Integer.class) || - whiteLabelingOptions.getClass().equals(String.class) || - whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { - map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); - } + public ApiAppCreateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name you want to assign to the ApiApp. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public ApiAppCreateRequest callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; + } + + /** + * The URL at which the ApiApp should receive event callbacks. + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; + } + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + public ApiAppCreateRequest customLogoFile(File customLogoFile) { + this.customLogoFile = 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 @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getCustomLogoFile() { + return customLogoFile; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomLogoFile(File customLogoFile) { + this.customLogoFile = customLogoFile; + } + + public ApiAppCreateRequest oauth(SubOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * + * @return oauth + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubOAuth getOauth() { + return oauth; + } + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(SubOAuth oauth) { + this.oauth = oauth; + } + + public ApiAppCreateRequest options(SubOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubOptions getOptions() { + return options; + } + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(SubOptions options) { + this.options = options; + } + + public ApiAppCreateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + /** Return true if this ApiAppCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppCreateRequest apiAppCreateRequest = (ApiAppCreateRequest) o; + return Objects.equals(this.domains, apiAppCreateRequest.domains) + && Objects.equals(this.name, apiAppCreateRequest.name) + && Objects.equals(this.callbackUrl, apiAppCreateRequest.callbackUrl) + && Objects.equals(this.customLogoFile, apiAppCreateRequest.customLogoFile) + && Objects.equals(this.oauth, apiAppCreateRequest.oauth) + && Objects.equals(this.options, apiAppCreateRequest.options) + && Objects.equals( + this.whiteLabelingOptions, apiAppCreateRequest.whiteLabelingOptions); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + domains, name, callbackUrl, customLogoFile, oauth, options, whiteLabelingOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppCreateRequest {\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" whiteLabelingOptions: ") + .append(toIndentedString(whiteLabelingOptions)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; + } + + if (domains.getClass().equals(java.io.File.class) + || domains.getClass().equals(Integer.class) + || domains.getClass().equals(String.class) + || domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for (int i = 0; i < getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (customLogoFile != null) { + if (isFileTypeOrListOfFiles(customLogoFile)) { + fileTypeFound = true; + } + + if (customLogoFile.getClass().equals(java.io.File.class) + || customLogoFile.getClass().equals(Integer.class) + || customLogoFile.getClass().equals(String.class) + || customLogoFile.getClass().isEnum()) { + map.put("custom_logo_file", customLogoFile); + } else if (isListOfFile(customLogoFile)) { + for (int i = 0; i < getListSize(customLogoFile); i++) { + map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); + } + } else { + map.put( + "custom_logo_file", + JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); + } + } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } + + if (oauth.getClass().equals(java.io.File.class) + || oauth.getClass().equals(Integer.class) + || oauth.getClass().equals(String.class) + || oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for (int i = 0; i < getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } + } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } + + if (options.getClass().equals(java.io.File.class) + || options.getClass().equals(Integer.class) + || options.getClass().equals(String.class) + || options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for (int i = 0; i < getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } + } else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); + } + } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } + + if (whiteLabelingOptions.getClass().equals(java.io.File.class) + || whiteLabelingOptions.getClass().equals(Integer.class) + || whiteLabelingOptions.getClass().equals(String.class) + || whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { + map.put( + "white_labeling_options[" + i + "]", + getFromList(whiteLabelingOptions, i)); + } + } else { + map.put( + "white_labeling_options", + JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java index 0b9eb3f..57bf2b4 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppGetResponse.java @@ -10,231 +10,215 @@ * 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.ApiAppResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * ApiAppGetResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public ApiAppGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppGetResponse.class); - } - - static public ApiAppGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppGetResponse.class - ); - } - - public ApiAppGetResponse apiApp(ApiAppResponse apiApp) { - this.apiApp = apiApp; - return this; - } - - /** - * Get apiApp - * @return apiApp - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ApiAppResponse getApiApp() { - return apiApp; - } - - - @JsonProperty(JSON_PROPERTY_API_APP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiApp(ApiAppResponse apiApp) { - this.apiApp = apiApp; - } - - - public ApiAppGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this ApiAppGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppGetResponse apiAppGetResponse = (ApiAppGetResponse) o; - return Objects.equals(this.apiApp, apiAppGetResponse.apiApp) && - Objects.equals(this.warnings, apiAppGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(apiApp, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppGetResponse {\n"); - sb.append(" apiApp: ").append(toIndentedString(apiApp)).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 (apiApp != null) { - if (isFileTypeOrListOfFiles(apiApp)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_API_APP = "api_app"; + private ApiAppResponse apiApp; - if (apiApp.getClass().equals(java.io.File.class) || - apiApp.getClass().equals(Integer.class) || - apiApp.getClass().equals(String.class) || - apiApp.getClass().isEnum()) { - map.put("api_app", apiApp); - } else if (isListOfFile(apiApp)) { - for(int i = 0; i< getListSize(apiApp); i++) { - map.put("api_app[" + i + "]", getFromList(apiApp, i)); - } - } - else { - map.put("api_app", JSON.getDefault().getMapper().writeValueAsString(apiApp)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public ApiAppGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppGetResponse.class); + } + + public static ApiAppGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppGetResponse.class); + } + + public ApiAppGetResponse apiApp(ApiAppResponse apiApp) { + this.apiApp = apiApp; + return this; + } + + /** + * Get apiApp + * + * @return apiApp + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_APP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ApiAppResponse getApiApp() { + return apiApp; + } + + @JsonProperty(JSON_PROPERTY_API_APP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiApp(ApiAppResponse apiApp) { + this.apiApp = apiApp; + } + + public ApiAppGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public ApiAppGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this ApiAppGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppGetResponse apiAppGetResponse = (ApiAppGetResponse) o; + return Objects.equals(this.apiApp, apiAppGetResponse.apiApp) + && Objects.equals(this.warnings, apiAppGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(apiApp, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppGetResponse {\n"); + sb.append(" apiApp: ").append(toIndentedString(apiApp)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiApp != null) { + if (isFileTypeOrListOfFiles(apiApp)) { + fileTypeFound = true; + } + + if (apiApp.getClass().equals(java.io.File.class) + || apiApp.getClass().equals(Integer.class) + || apiApp.getClass().equals(String.class) + || apiApp.getClass().isEnum()) { + map.put("api_app", apiApp); + } else if (isListOfFile(apiApp)) { + for (int i = 0; i < getListSize(apiApp); i++) { + map.put("api_app[" + i + "]", getFromList(apiApp, i)); + } + } else { + map.put("api_app", JSON.getDefault().getMapper().writeValueAsString(apiApp)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java index 7078480..4963459 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppListResponse.java @@ -10,290 +10,272 @@ * 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.ApiAppResponse; -import com.dropbox.sign.model.ListInfoResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * ApiAppListResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppListResponse { - public static final String JSON_PROPERTY_API_APPS = "api_apps"; - 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 = null; - - public ApiAppListResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppListResponse.class); - } - - static public ApiAppListResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppListResponse.class - ); - } - - public ApiAppListResponse apiApps(List apiApps) { - this.apiApps = apiApps; - return this; - } - - public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { - if (this.apiApps == null) { - this.apiApps = new ArrayList<>(); - } - this.apiApps.add(apiAppsItem); - return this; - } - - /** - * Contains information about API Apps. - * @return apiApps - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getApiApps() { - return apiApps; - } - - - @JsonProperty(JSON_PROPERTY_API_APPS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiApps(List apiApps) { - this.apiApps = apiApps; - } - - - public ApiAppListResponse 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 ApiAppListResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_API_APPS = "api_apps"; + 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 = null; + + public ApiAppListResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppListResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this ApiAppListResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static ApiAppListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppListResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public ApiAppListResponse apiApps(List apiApps) { + this.apiApps = apiApps; + return this; } - ApiAppListResponse apiAppListResponse = (ApiAppListResponse) o; - return Objects.equals(this.apiApps, apiAppListResponse.apiApps) && - Objects.equals(this.listInfo, apiAppListResponse.listInfo) && - Objects.equals(this.warnings, apiAppListResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(apiApps, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppListResponse {\n"); - sb.append(" apiApps: ").append(toIndentedString(apiApps)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (apiApps != null) { - if (isFileTypeOrListOfFiles(apiApps)) { - fileTypeFound = true; - } - if (apiApps.getClass().equals(java.io.File.class) || - apiApps.getClass().equals(Integer.class) || - apiApps.getClass().equals(String.class) || - apiApps.getClass().isEnum()) { - map.put("api_apps", apiApps); - } else if (isListOfFile(apiApps)) { - for(int i = 0; i< getListSize(apiApps); i++) { - map.put("api_apps[" + i + "]", getFromList(apiApps, i)); - } - } - else { - map.put("api_apps", JSON.getDefault().getMapper().writeValueAsString(apiApps)); + public ApiAppListResponse addApiAppsItem(ApiAppResponse apiAppsItem) { + if (this.apiApps == null) { + this.apiApps = new ArrayList<>(); } + this.apiApps.add(apiAppsItem); + return this; } - 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)); - } + /** + * Contains information about API Apps. + * + * @return apiApps + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_APPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getApiApps() { + return apiApps; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_API_APPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiApps(List apiApps) { + this.apiApps = apiApps; + } + + public ApiAppListResponse 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 ApiAppListResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public ApiAppListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this ApiAppListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppListResponse apiAppListResponse = (ApiAppListResponse) o; + return Objects.equals(this.apiApps, apiAppListResponse.apiApps) + && Objects.equals(this.listInfo, apiAppListResponse.listInfo) + && Objects.equals(this.warnings, apiAppListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(apiApps, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppListResponse {\n"); + sb.append(" apiApps: ").append(toIndentedString(apiApps)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiApps != null) { + if (isFileTypeOrListOfFiles(apiApps)) { + fileTypeFound = true; + } + + if (apiApps.getClass().equals(java.io.File.class) + || apiApps.getClass().equals(Integer.class) + || apiApps.getClass().equals(String.class) + || apiApps.getClass().isEnum()) { + map.put("api_apps", apiApps); + } else if (isListOfFile(apiApps)) { + for (int i = 0; i < getListSize(apiApps); i++) { + map.put("api_apps[" + i + "]", getFromList(apiApps, i)); + } + } else { + map.put("api_apps", JSON.getDefault().getMapper().writeValueAsString(apiApps)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppResponse.java b/src/main/java/com/dropbox/sign/model/ApiAppResponse.java index 6679f9f..9e5b007 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponse.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponse.java @@ -10,633 +10,609 @@ * 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.ApiAppResponseOAuth; -import com.dropbox.sign.model.ApiAppResponseOptions; -import com.dropbox.sign.model.ApiAppResponseOwnerAccount; -import com.dropbox.sign.model.ApiAppResponseWhiteLabelingOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains information about an API App. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppResponse { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - private Integer createdAt; - - public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains = null; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; - public static final String JSON_PROPERTY_IS_APPROVED = "is_approved"; - private Boolean isApproved; + public static final String JSON_PROPERTY_DOMAINS = "domains"; + private List domains = null; - public static final String JSON_PROPERTY_OAUTH = "oauth"; - private ApiAppResponseOAuth oauth; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - private ApiAppResponseOptions options; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_OWNER_ACCOUNT = "owner_account"; - private ApiAppResponseOwnerAccount ownerAccount; + public static final String JSON_PROPERTY_IS_APPROVED = "is_approved"; + private Boolean isApproved; - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - private ApiAppResponseWhiteLabelingOptions whiteLabelingOptions; + public static final String JSON_PROPERTY_OAUTH = "oauth"; + private ApiAppResponseOAuth oauth; - public ApiAppResponse() { - } + public static final String JSON_PROPERTY_OPTIONS = "options"; + private ApiAppResponseOptions options; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponse.class); - } - - static public ApiAppResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponse.class - ); - } - - public ApiAppResponse callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The app's callback URL (for events) - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public static final String JSON_PROPERTY_OWNER_ACCOUNT = "owner_account"; + private ApiAppResponseOwnerAccount ownerAccount; - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public ApiAppResponse clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The app's client id - * @return clientId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + private ApiAppResponseWhiteLabelingOptions whiteLabelingOptions; - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public ApiAppResponse createdAt(Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * The time that the app was created - * @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 ApiAppResponse domains(List domains) { - this.domains = domains; - return this; - } - - public ApiAppResponse addDomainsItem(String domainsItem) { - if (this.domains == null) { - this.domains = new ArrayList<>(); - } - this.domains.add(domainsItem); - return this; - } - - /** - * The domain name(s) associated with the app - * @return domains - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getDomains() { - return domains; - } - - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDomains(List domains) { - this.domains = domains; - } - - - public ApiAppResponse name(String name) { - this.name = name; - return this; - } + public ApiAppResponse() {} - /** - * The name of the app - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public ApiAppResponse isApproved(Boolean isApproved) { - this.isApproved = isApproved; - return this; - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponse.class); + } - /** - * Boolean to indicate if the app has been approved - * @return isApproved - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_APPROVED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsApproved() { - return isApproved; - } - - - @JsonProperty(JSON_PROPERTY_IS_APPROVED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsApproved(Boolean isApproved) { - this.isApproved = isApproved; - } - - - public ApiAppResponse oauth(ApiAppResponseOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * @return oauth - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ApiAppResponseOAuth getOauth() { - return oauth; - } - - - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(ApiAppResponseOAuth oauth) { - this.oauth = oauth; - } - - - public ApiAppResponse options(ApiAppResponseOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * @return options - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ApiAppResponseOptions getOptions() { - return options; - } - - - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(ApiAppResponseOptions options) { - this.options = options; - } - - - public ApiAppResponse ownerAccount(ApiAppResponseOwnerAccount ownerAccount) { - this.ownerAccount = ownerAccount; - return this; - } - - /** - * Get ownerAccount - * @return ownerAccount - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ApiAppResponseOwnerAccount getOwnerAccount() { - return ownerAccount; - } - - - @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOwnerAccount(ApiAppResponseOwnerAccount ownerAccount) { - this.ownerAccount = ownerAccount; - } - - - public ApiAppResponse whiteLabelingOptions(ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; - } - - /** - * Get whiteLabelingOptions - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ApiAppResponseWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; - } - - - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions(ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - } - - - /** - * Return true if this ApiAppResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppResponse apiAppResponse = (ApiAppResponse) o; - return Objects.equals(this.callbackUrl, apiAppResponse.callbackUrl) && - Objects.equals(this.clientId, apiAppResponse.clientId) && - Objects.equals(this.createdAt, apiAppResponse.createdAt) && - Objects.equals(this.domains, apiAppResponse.domains) && - Objects.equals(this.name, apiAppResponse.name) && - Objects.equals(this.isApproved, apiAppResponse.isApproved) && - Objects.equals(this.oauth, apiAppResponse.oauth) && - Objects.equals(this.options, apiAppResponse.options) && - Objects.equals(this.ownerAccount, apiAppResponse.ownerAccount) && - Objects.equals(this.whiteLabelingOptions, apiAppResponse.whiteLabelingOptions); - } - - @Override - public int hashCode() { - return Objects.hash(callbackUrl, clientId, createdAt, domains, name, isApproved, oauth, options, ownerAccount, whiteLabelingOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponse {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" isApproved: ").append(toIndentedString(isApproved)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" ownerAccount: ").append(toIndentedString(ownerAccount)).append("\n"); - sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } + public static ApiAppResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppResponse.class); + } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + public ApiAppResponse callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + /** + * The app's callback URL (for events) + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; } - 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)); - } + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; } - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } - if (domains.getClass().equals(java.io.File.class) || - domains.getClass().equals(Integer.class) || - domains.getClass().equals(String.class) || - domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for(int i = 0; i< getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } - else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } + public ApiAppResponse clientId(String clientId) { + this.clientId = clientId; + return this; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + /** + * The app's client id + * + * @return clientId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (isApproved != null) { - if (isFileTypeOrListOfFiles(isApproved)) { - fileTypeFound = true; - } - if (isApproved.getClass().equals(java.io.File.class) || - isApproved.getClass().equals(Integer.class) || - isApproved.getClass().equals(String.class) || - isApproved.getClass().isEnum()) { - map.put("is_approved", isApproved); - } else if (isListOfFile(isApproved)) { - for(int i = 0; i< getListSize(isApproved); i++) { - map.put("is_approved[" + i + "]", getFromList(isApproved, i)); - } - } - else { - map.put("is_approved", JSON.getDefault().getMapper().writeValueAsString(isApproved)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - if (oauth.getClass().equals(java.io.File.class) || - oauth.getClass().equals(Integer.class) || - oauth.getClass().equals(String.class) || - oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for(int i = 0; i< getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } - else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } + public ApiAppResponse createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - if (options.getClass().equals(java.io.File.class) || - options.getClass().equals(Integer.class) || - options.getClass().equals(String.class) || - options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for(int i = 0; i< getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } - else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } + /** + * The time that the app was created + * + * @return createdAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCreatedAt() { + return createdAt; } - if (ownerAccount != null) { - if (isFileTypeOrListOfFiles(ownerAccount)) { - fileTypeFound = true; - } - if (ownerAccount.getClass().equals(java.io.File.class) || - ownerAccount.getClass().equals(Integer.class) || - ownerAccount.getClass().equals(String.class) || - ownerAccount.getClass().isEnum()) { - map.put("owner_account", ownerAccount); - } else if (isListOfFile(ownerAccount)) { - for(int i = 0; i< getListSize(ownerAccount); i++) { - map.put("owner_account[" + i + "]", getFromList(ownerAccount, i)); - } - } - else { - map.put("owner_account", JSON.getDefault().getMapper().writeValueAsString(ownerAccount)); - } + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + public ApiAppResponse domains(List domains) { + this.domains = domains; + return this; } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; + + public ApiAppResponse addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); } + this.domains.add(domainsItem); + return this; + } - if (whiteLabelingOptions.getClass().equals(java.io.File.class) || - whiteLabelingOptions.getClass().equals(Integer.class) || - whiteLabelingOptions.getClass().equals(String.class) || - whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { - map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); - } + /** + * The domain name(s) associated with the app + * + * @return domains + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDomains() { + return domains; + } + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomains(List domains) { + this.domains = domains; + } + + public ApiAppResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the app + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public ApiAppResponse isApproved(Boolean isApproved) { + this.isApproved = isApproved; + return this; + } + + /** + * Boolean to indicate if the app has been approved + * + * @return isApproved + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsApproved() { + return isApproved; + } + + @JsonProperty(JSON_PROPERTY_IS_APPROVED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsApproved(Boolean isApproved) { + this.isApproved = isApproved; + } + + public ApiAppResponse oauth(ApiAppResponseOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * + * @return oauth + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ApiAppResponseOAuth getOauth() { + return oauth; + } + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(ApiAppResponseOAuth oauth) { + this.oauth = oauth; + } + + public ApiAppResponse options(ApiAppResponseOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ApiAppResponseOptions getOptions() { + return options; + } + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(ApiAppResponseOptions options) { + this.options = options; + } + + public ApiAppResponse ownerAccount(ApiAppResponseOwnerAccount ownerAccount) { + this.ownerAccount = ownerAccount; + return this; + } + + /** + * Get ownerAccount + * + * @return ownerAccount + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ApiAppResponseOwnerAccount getOwnerAccount() { + return ownerAccount; + } + + @JsonProperty(JSON_PROPERTY_OWNER_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOwnerAccount(ApiAppResponseOwnerAccount ownerAccount) { + this.ownerAccount = ownerAccount; + } + + public ApiAppResponse whiteLabelingOptions( + ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ApiAppResponseWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(ApiAppResponseWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + /** Return true if this ApiAppResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppResponse apiAppResponse = (ApiAppResponse) o; + return Objects.equals(this.callbackUrl, apiAppResponse.callbackUrl) + && Objects.equals(this.clientId, apiAppResponse.clientId) + && Objects.equals(this.createdAt, apiAppResponse.createdAt) + && Objects.equals(this.domains, apiAppResponse.domains) + && Objects.equals(this.name, apiAppResponse.name) + && Objects.equals(this.isApproved, apiAppResponse.isApproved) + && Objects.equals(this.oauth, apiAppResponse.oauth) + && Objects.equals(this.options, apiAppResponse.options) + && Objects.equals(this.ownerAccount, apiAppResponse.ownerAccount) + && Objects.equals(this.whiteLabelingOptions, apiAppResponse.whiteLabelingOptions); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + callbackUrl, + clientId, + createdAt, + domains, + name, + isApproved, + oauth, + options, + ownerAccount, + whiteLabelingOptions); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponse {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isApproved: ").append(toIndentedString(isApproved)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" ownerAccount: ").append(toIndentedString(ownerAccount)).append("\n"); + sb.append(" whiteLabelingOptions: ") + .append(toIndentedString(whiteLabelingOptions)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (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 (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; + } + + if (domains.getClass().equals(java.io.File.class) + || domains.getClass().equals(Integer.class) + || domains.getClass().equals(String.class) + || domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for (int i = 0; i < getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (isApproved != null) { + if (isFileTypeOrListOfFiles(isApproved)) { + fileTypeFound = true; + } + + if (isApproved.getClass().equals(java.io.File.class) + || isApproved.getClass().equals(Integer.class) + || isApproved.getClass().equals(String.class) + || isApproved.getClass().isEnum()) { + map.put("is_approved", isApproved); + } else if (isListOfFile(isApproved)) { + for (int i = 0; i < getListSize(isApproved); i++) { + map.put("is_approved[" + i + "]", getFromList(isApproved, i)); + } + } else { + map.put( + "is_approved", + JSON.getDefault().getMapper().writeValueAsString(isApproved)); + } + } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } + + if (oauth.getClass().equals(java.io.File.class) + || oauth.getClass().equals(Integer.class) + || oauth.getClass().equals(String.class) + || oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for (int i = 0; i < getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } + } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } + + if (options.getClass().equals(java.io.File.class) + || options.getClass().equals(Integer.class) + || options.getClass().equals(String.class) + || options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for (int i = 0; i < getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } + } else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); + } + } + if (ownerAccount != null) { + if (isFileTypeOrListOfFiles(ownerAccount)) { + fileTypeFound = true; + } + + if (ownerAccount.getClass().equals(java.io.File.class) + || ownerAccount.getClass().equals(Integer.class) + || ownerAccount.getClass().equals(String.class) + || ownerAccount.getClass().isEnum()) { + map.put("owner_account", ownerAccount); + } else if (isListOfFile(ownerAccount)) { + for (int i = 0; i < getListSize(ownerAccount); i++) { + map.put("owner_account[" + i + "]", getFromList(ownerAccount, i)); + } + } else { + map.put( + "owner_account", + JSON.getDefault().getMapper().writeValueAsString(ownerAccount)); + } + } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } + + if (whiteLabelingOptions.getClass().equals(java.io.File.class) + || whiteLabelingOptions.getClass().equals(Integer.class) + || whiteLabelingOptions.getClass().equals(String.class) + || whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { + map.put( + "white_labeling_options[" + i + "]", + getFromList(whiteLabelingOptions, i)); + } + } else { + map.put( + "white_labeling_options", + JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java index d4fd6b7..74ba41e 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOAuth.java @@ -10,329 +10,314 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; /** - * An object describing the app's OAuth properties, or null if OAuth is not configured for the app. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppResponseOAuth { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; - - public static final String JSON_PROPERTY_SECRET = "secret"; - private String secret; - - public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes = null; - - public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; - private Boolean chargesUsers; - - public ApiAppResponseOAuth() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppResponseOAuth init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOAuth.class); - } - - static public ApiAppResponseOAuth init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseOAuth.class - ); - } - - public ApiAppResponseOAuth callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The app's OAuth callback URL. - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public ApiAppResponseOAuth secret(String secret) { - this.secret = secret; - return this; - } - - /** - * The app's OAuth secret, or null if the app does not belong to user. - * @return secret - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecret() { - return secret; - } - - - @JsonProperty(JSON_PROPERTY_SECRET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecret(String secret) { - this.secret = secret; - } - - - public ApiAppResponseOAuth scopes(List scopes) { - this.scopes = scopes; - return this; - } - - public ApiAppResponseOAuth addScopesItem(String scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private String secret; + + public static final String JSON_PROPERTY_SCOPES = "scopes"; + private List scopes = null; + + public static final String JSON_PROPERTY_CHARGES_USERS = "charges_users"; + private Boolean chargesUsers; + + public ApiAppResponseOAuth() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppResponseOAuth init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOAuth.class); } - this.scopes.add(scopesItem); - return this; - } - - /** - * Array of OAuth scopes used by the app. - * @return scopes - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getScopes() { - return scopes; - } - - - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScopes(List scopes) { - this.scopes = scopes; - } - - - public ApiAppResponseOAuth chargesUsers(Boolean chargesUsers) { - this.chargesUsers = chargesUsers; - return this; - } - - /** - * Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. - * @return chargesUsers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CHARGES_USERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getChargesUsers() { - return chargesUsers; - } - - - @JsonProperty(JSON_PROPERTY_CHARGES_USERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setChargesUsers(Boolean chargesUsers) { - this.chargesUsers = chargesUsers; - } - - - /** - * Return true if this ApiAppResponseOAuth object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static ApiAppResponseOAuth init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppResponseOAuth.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public ApiAppResponseOAuth callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - ApiAppResponseOAuth apiAppResponseOAuth = (ApiAppResponseOAuth) o; - return Objects.equals(this.callbackUrl, apiAppResponseOAuth.callbackUrl) && - Objects.equals(this.secret, apiAppResponseOAuth.secret) && - Objects.equals(this.scopes, apiAppResponseOAuth.scopes) && - Objects.equals(this.chargesUsers, apiAppResponseOAuth.chargesUsers); - } - - @Override - public int hashCode() { - return Objects.hash(callbackUrl, secret, scopes, chargesUsers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOAuth {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append(" chargesUsers: ").append(toIndentedString(chargesUsers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + /** + * The app's OAuth callback URL. + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; } - if (secret != null) { - if (isFileTypeOrListOfFiles(secret)) { - fileTypeFound = true; - } - if (secret.getClass().equals(java.io.File.class) || - secret.getClass().equals(Integer.class) || - secret.getClass().equals(String.class) || - secret.getClass().isEnum()) { - map.put("secret", secret); - } else if (isListOfFile(secret)) { - for(int i = 0; i< getListSize(secret); i++) { - map.put("secret[" + i + "]", getFromList(secret, i)); - } - } - else { - map.put("secret", JSON.getDefault().getMapper().writeValueAsString(secret)); - } + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; } - if (scopes != null) { - if (isFileTypeOrListOfFiles(scopes)) { - fileTypeFound = true; - } - if (scopes.getClass().equals(java.io.File.class) || - scopes.getClass().equals(Integer.class) || - scopes.getClass().equals(String.class) || - scopes.getClass().isEnum()) { - map.put("scopes", scopes); - } else if (isListOfFile(scopes)) { - for(int i = 0; i< getListSize(scopes); i++) { - map.put("scopes[" + i + "]", getFromList(scopes, i)); - } - } - else { - map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); - } + public ApiAppResponseOAuth secret(String secret) { + this.secret = secret; + return this; + } + + /** + * The app's OAuth secret, or null if the app does not belong to user. + * + * @return secret + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecret() { + return secret; + } + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(String secret) { + this.secret = secret; } - if (chargesUsers != null) { - if (isFileTypeOrListOfFiles(chargesUsers)) { - fileTypeFound = true; + + public ApiAppResponseOAuth scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public ApiAppResponseOAuth addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); } + this.scopes.add(scopesItem); + return this; + } - if (chargesUsers.getClass().equals(java.io.File.class) || - chargesUsers.getClass().equals(Integer.class) || - chargesUsers.getClass().equals(String.class) || - chargesUsers.getClass().isEnum()) { - map.put("charges_users", chargesUsers); - } else if (isListOfFile(chargesUsers)) { - for(int i = 0; i< getListSize(chargesUsers); i++) { - map.put("charges_users[" + i + "]", getFromList(chargesUsers, i)); - } + /** + * Array of OAuth scopes used by the app. + * + * @return scopes + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScopes() { + return scopes; + } + + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScopes(List scopes) { + this.scopes = scopes; + } + + public ApiAppResponseOAuth chargesUsers(Boolean chargesUsers) { + this.chargesUsers = chargesUsers; + return this; + } + + /** + * Boolean indicating whether the app owner or the account granting permission is billed for + * OAuth requests. + * + * @return chargesUsers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CHARGES_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getChargesUsers() { + return chargesUsers; + } + + @JsonProperty(JSON_PROPERTY_CHARGES_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChargesUsers(Boolean chargesUsers) { + this.chargesUsers = chargesUsers; + } + + /** Return true if this ApiAppResponseOAuth object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("charges_users", JSON.getDefault().getMapper().writeValueAsString(chargesUsers)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppResponseOAuth apiAppResponseOAuth = (ApiAppResponseOAuth) o; + return Objects.equals(this.callbackUrl, apiAppResponseOAuth.callbackUrl) + && Objects.equals(this.secret, apiAppResponseOAuth.secret) + && Objects.equals(this.scopes, apiAppResponseOAuth.scopes) + && Objects.equals(this.chargesUsers, apiAppResponseOAuth.chargesUsers); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, secret, scopes, chargesUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOAuth {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" chargesUsers: ").append(toIndentedString(chargesUsers)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (secret != null) { + if (isFileTypeOrListOfFiles(secret)) { + fileTypeFound = true; + } + + if (secret.getClass().equals(java.io.File.class) + || secret.getClass().equals(Integer.class) + || secret.getClass().equals(String.class) + || secret.getClass().isEnum()) { + map.put("secret", secret); + } else if (isListOfFile(secret)) { + for (int i = 0; i < getListSize(secret); i++) { + map.put("secret[" + i + "]", getFromList(secret, i)); + } + } else { + map.put("secret", JSON.getDefault().getMapper().writeValueAsString(secret)); + } + } + if (scopes != null) { + if (isFileTypeOrListOfFiles(scopes)) { + fileTypeFound = true; + } + + if (scopes.getClass().equals(java.io.File.class) + || scopes.getClass().equals(Integer.class) + || scopes.getClass().equals(String.class) + || scopes.getClass().isEnum()) { + map.put("scopes", scopes); + } else if (isListOfFile(scopes)) { + for (int i = 0; i < getListSize(scopes); i++) { + map.put("scopes[" + i + "]", getFromList(scopes, i)); + } + } else { + map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); + } + } + if (chargesUsers != null) { + if (isFileTypeOrListOfFiles(chargesUsers)) { + fileTypeFound = true; + } + + if (chargesUsers.getClass().equals(java.io.File.class) + || chargesUsers.getClass().equals(Integer.class) + || chargesUsers.getClass().equals(String.class) + || chargesUsers.getClass().isEnum()) { + map.put("charges_users", chargesUsers); + } else if (isListOfFile(chargesUsers)) { + for (int i = 0; i < getListSize(chargesUsers); i++) { + map.put("charges_users[" + i + "]", getFromList(chargesUsers, i)); + } + } else { + map.put( + "charges_users", + JSON.getDefault().getMapper().writeValueAsString(chargesUsers)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java index 33a7c70..e2d672d 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOptions.java @@ -10,169 +10,164 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An object with options that override account settings. - */ -@JsonPropertyOrder({ - ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** An object with options that override account settings. */ +@JsonPropertyOrder({ApiAppResponseOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppResponseOptions { - public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; - private Boolean canInsertEverywhere; - - public ApiAppResponseOptions() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppResponseOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOptions.class); - } - - static public ApiAppResponseOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseOptions.class - ); - } - - public ApiAppResponseOptions canInsertEverywhere(Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - return this; - } - - /** - * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document - * @return canInsertEverywhere - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getCanInsertEverywhere() { - return canInsertEverywhere; - } - - - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanInsertEverywhere(Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - } - - - /** - * Return true if this ApiAppResponseOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; + private Boolean canInsertEverywhere; + + public ApiAppResponseOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppResponseOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOptions.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static ApiAppResponseOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), ApiAppResponseOptions.class); } - ApiAppResponseOptions apiAppResponseOptions = (ApiAppResponseOptions) o; - return Objects.equals(this.canInsertEverywhere, apiAppResponseOptions.canInsertEverywhere); - } - - @Override - public int hashCode() { - return Objects.hash(canInsertEverywhere); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOptions {\n"); - sb.append(" canInsertEverywhere: ").append(toIndentedString(canInsertEverywhere)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (canInsertEverywhere != null) { - if (isFileTypeOrListOfFiles(canInsertEverywhere)) { - fileTypeFound = true; - } - if (canInsertEverywhere.getClass().equals(java.io.File.class) || - canInsertEverywhere.getClass().equals(Integer.class) || - canInsertEverywhere.getClass().equals(String.class) || - canInsertEverywhere.getClass().isEnum()) { - map.put("can_insert_everywhere", canInsertEverywhere); - } else if (isListOfFile(canInsertEverywhere)) { - for(int i = 0; i< getListSize(canInsertEverywhere); i++) { - map.put("can_insert_everywhere[" + i + "]", getFromList(canInsertEverywhere, i)); - } + public ApiAppResponseOptions canInsertEverywhere(Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + return this; + } + + /** + * Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a + * document + * + * @return canInsertEverywhere + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanInsertEverywhere() { + return canInsertEverywhere; + } + + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanInsertEverywhere(Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + } + + /** Return true if this ApiAppResponseOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("can_insert_everywhere", JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppResponseOptions apiAppResponseOptions = (ApiAppResponseOptions) o; + return Objects.equals(this.canInsertEverywhere, apiAppResponseOptions.canInsertEverywhere); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(canInsertEverywhere); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOptions {\n"); + sb.append(" canInsertEverywhere: ") + .append(toIndentedString(canInsertEverywhere)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (canInsertEverywhere != null) { + if (isFileTypeOrListOfFiles(canInsertEverywhere)) { + fileTypeFound = true; + } + + if (canInsertEverywhere.getClass().equals(java.io.File.class) + || canInsertEverywhere.getClass().equals(Integer.class) + || canInsertEverywhere.getClass().equals(String.class) + || canInsertEverywhere.getClass().isEnum()) { + map.put("can_insert_everywhere", canInsertEverywhere); + } else if (isListOfFile(canInsertEverywhere)) { + for (int i = 0; i < getListSize(canInsertEverywhere); i++) { + map.put( + "can_insert_everywhere[" + i + "]", + getFromList(canInsertEverywhere, i)); + } + } else { + map.put( + "can_insert_everywhere", + JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java index a1e52ba..7107a43 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseOwnerAccount.java @@ -10,219 +10,210 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An object describing the app's owner - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppResponseOwnerAccount { - 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 ApiAppResponseOwnerAccount() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppResponseOwnerAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseOwnerAccount.class); - } - - static public ApiAppResponseOwnerAccount init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseOwnerAccount.class - ); - } - - public ApiAppResponseOwnerAccount accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The owner account's 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 ApiAppResponseOwnerAccount emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The owner account's 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 ApiAppResponseOwnerAccount object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppResponseOwnerAccount apiAppResponseOwnerAccount = (ApiAppResponseOwnerAccount) o; - return Objects.equals(this.accountId, apiAppResponseOwnerAccount.accountId) && - Objects.equals(this.emailAddress, apiAppResponseOwnerAccount.emailAddress); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseOwnerAccount {\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 (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - 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)); - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public ApiAppResponseOwnerAccount() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppResponseOwnerAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseOwnerAccount.class); } - 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)); - } + public static ApiAppResponseOwnerAccount init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseOwnerAccount.class); + } + + public ApiAppResponseOwnerAccount accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The owner account's 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 ApiAppResponseOwnerAccount emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The owner account's 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 ApiAppResponseOwnerAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppResponseOwnerAccount apiAppResponseOwnerAccount = (ApiAppResponseOwnerAccount) o; + return Objects.equals(this.accountId, apiAppResponseOwnerAccount.accountId) + && Objects.equals(this.emailAddress, apiAppResponseOwnerAccount.emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseOwnerAccount {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java b/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java index f8dabea..6efd8fc 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppResponseWhiteLabelingOptions.java @@ -10,819 +10,888 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An object with options to customize the app's signer page - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppResponseWhiteLabelingOptions { - public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; - private String headerBackgroundColor; + public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; + private String headerBackgroundColor; - public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; - private String legalVersion; + public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; + private String legalVersion; - public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; - private String linkColor; + public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; + private String linkColor; - public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; - private String pageBackgroundColor; + public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; + private String pageBackgroundColor; - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; - private String primaryButtonColor; + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; + private String primaryButtonColor; - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = "primary_button_color_hover"; - private String primaryButtonColorHover; + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = + "primary_button_color_hover"; + private String primaryButtonColorHover; - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = "primary_button_text_color"; - private String primaryButtonTextColor; + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = + "primary_button_text_color"; + private String primaryButtonTextColor; - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = "primary_button_text_color_hover"; - private String primaryButtonTextColorHover; + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = + "primary_button_text_color_hover"; + private String primaryButtonTextColorHover; - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; - private String secondaryButtonColor; + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; + private String secondaryButtonColor; - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = "secondary_button_color_hover"; - private String secondaryButtonColorHover; + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = + "secondary_button_color_hover"; + private String secondaryButtonColorHover; - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = "secondary_button_text_color"; - private String secondaryButtonTextColor; + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = + "secondary_button_text_color"; + private String secondaryButtonTextColor; - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = "secondary_button_text_color_hover"; - private String secondaryButtonTextColorHover; + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = + "secondary_button_text_color_hover"; + private String secondaryButtonTextColorHover; - public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; - private String textColor1; + public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; + private String textColor1; - public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; - private String textColor2; + public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; + private String textColor2; - public ApiAppResponseWhiteLabelingOptions() { - } + public ApiAppResponseWhiteLabelingOptions() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppResponseWhiteLabelingOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppResponseWhiteLabelingOptions.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppResponseWhiteLabelingOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppResponseWhiteLabelingOptions.class); + } - static public ApiAppResponseWhiteLabelingOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppResponseWhiteLabelingOptions.class - ); - } + public static ApiAppResponseWhiteLabelingOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + ApiAppResponseWhiteLabelingOptions.class); + } - public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - return this; - } + public ApiAppResponseWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + return this; + } - /** - * Get headerBackgroundColor - * @return headerBackgroundColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get headerBackgroundColor + * + * @return headerBackgroundColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderBackgroundColor() { + return headerBackgroundColor; + } - public String getHeaderBackgroundColor() { - return headerBackgroundColor; - } + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderBackgroundColor(String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + } + public ApiAppResponseWhiteLabelingOptions legalVersion(String legalVersion) { + this.legalVersion = legalVersion; + return this; + } - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderBackgroundColor(String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - } + /** + * Get legalVersion + * + * @return legalVersion + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLegalVersion() { + return legalVersion; + } + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLegalVersion(String legalVersion) { + this.legalVersion = legalVersion; + } - public ApiAppResponseWhiteLabelingOptions legalVersion(String legalVersion) { - this.legalVersion = legalVersion; - return this; - } + public ApiAppResponseWhiteLabelingOptions linkColor(String linkColor) { + this.linkColor = linkColor; + return this; + } - /** - * Get legalVersion - * @return legalVersion - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get linkColor + * + * @return linkColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLinkColor() { + return linkColor; + } - public String getLegalVersion() { - return legalVersion; - } + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkColor(String linkColor) { + this.linkColor = linkColor; + } + public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + return this; + } - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLegalVersion(String legalVersion) { - this.legalVersion = legalVersion; - } + /** + * Get pageBackgroundColor + * + * @return pageBackgroundColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageBackgroundColor() { + return pageBackgroundColor; + } + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageBackgroundColor(String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + } - public ApiAppResponseWhiteLabelingOptions linkColor(String linkColor) { - this.linkColor = linkColor; - return this; - } + public ApiAppResponseWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + return this; + } - /** - * Get linkColor - * @return linkColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLinkColor() { - return linkColor; - } - - - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkColor(String linkColor) { - this.linkColor = linkColor; - } - - - public ApiAppResponseWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - return this; - } - - /** - * Get pageBackgroundColor - * @return pageBackgroundColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPageBackgroundColor() { - return pageBackgroundColor; - } - - - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageBackgroundColor(String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - } - - - public ApiAppResponseWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - return this; - } - - /** - * Get primaryButtonColor - * @return primaryButtonColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonColor() { - return primaryButtonColor; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColor(String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - } - - - public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - return this; - } - - /** - * Get primaryButtonColorHover - * @return primaryButtonColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonColorHover() { - return primaryButtonColorHover; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColorHover(String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - } - - - public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - return this; - } - - /** - * Get primaryButtonTextColor - * @return primaryButtonTextColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonTextColor() { - return primaryButtonTextColor; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColor(String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - } - - - public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - return this; - } - - /** - * Get primaryButtonTextColorHover - * @return primaryButtonTextColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonTextColorHover() { - return primaryButtonTextColorHover; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColorHover(String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - } - - - public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - return this; - } - - /** - * Get secondaryButtonColor - * @return secondaryButtonColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonColor() { - return secondaryButtonColor; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColor(String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - } - - - public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - return this; - } - - /** - * Get secondaryButtonColorHover - * @return secondaryButtonColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonColorHover() { - return secondaryButtonColorHover; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColorHover(String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - } - - - public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - return this; - } - - /** - * Get secondaryButtonTextColor - * @return secondaryButtonTextColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonTextColor() { - return secondaryButtonTextColor; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColor(String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - } - - - public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover(String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - return this; - } - - /** - * Get secondaryButtonTextColorHover - * @return secondaryButtonTextColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonTextColorHover() { - return secondaryButtonTextColorHover; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColorHover(String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - } - - - public ApiAppResponseWhiteLabelingOptions textColor1(String textColor1) { - this.textColor1 = textColor1; - return this; - } - - /** - * Get textColor1 - * @return textColor1 - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTextColor1() { - return textColor1; - } - - - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor1(String textColor1) { - this.textColor1 = textColor1; - } - - - public ApiAppResponseWhiteLabelingOptions textColor2(String textColor2) { - this.textColor2 = textColor2; - return this; - } - - /** - * Get textColor2 - * @return textColor2 - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTextColor2() { - return textColor2; - } - - - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor2(String textColor2) { - this.textColor2 = textColor2; - } - - - /** - * Return true if this ApiAppResponseWhiteLabelingOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppResponseWhiteLabelingOptions apiAppResponseWhiteLabelingOptions = (ApiAppResponseWhiteLabelingOptions) o; - return Objects.equals(this.headerBackgroundColor, apiAppResponseWhiteLabelingOptions.headerBackgroundColor) && - Objects.equals(this.legalVersion, apiAppResponseWhiteLabelingOptions.legalVersion) && - Objects.equals(this.linkColor, apiAppResponseWhiteLabelingOptions.linkColor) && - Objects.equals(this.pageBackgroundColor, apiAppResponseWhiteLabelingOptions.pageBackgroundColor) && - Objects.equals(this.primaryButtonColor, apiAppResponseWhiteLabelingOptions.primaryButtonColor) && - Objects.equals(this.primaryButtonColorHover, apiAppResponseWhiteLabelingOptions.primaryButtonColorHover) && - Objects.equals(this.primaryButtonTextColor, apiAppResponseWhiteLabelingOptions.primaryButtonTextColor) && - Objects.equals(this.primaryButtonTextColorHover, apiAppResponseWhiteLabelingOptions.primaryButtonTextColorHover) && - Objects.equals(this.secondaryButtonColor, apiAppResponseWhiteLabelingOptions.secondaryButtonColor) && - Objects.equals(this.secondaryButtonColorHover, apiAppResponseWhiteLabelingOptions.secondaryButtonColorHover) && - Objects.equals(this.secondaryButtonTextColor, apiAppResponseWhiteLabelingOptions.secondaryButtonTextColor) && - Objects.equals(this.secondaryButtonTextColorHover, apiAppResponseWhiteLabelingOptions.secondaryButtonTextColorHover) && - Objects.equals(this.textColor1, apiAppResponseWhiteLabelingOptions.textColor1) && - Objects.equals(this.textColor2, apiAppResponseWhiteLabelingOptions.textColor2); - } - - @Override - public int hashCode() { - return Objects.hash(headerBackgroundColor, legalVersion, linkColor, pageBackgroundColor, primaryButtonColor, primaryButtonColorHover, primaryButtonTextColor, primaryButtonTextColorHover, secondaryButtonColor, secondaryButtonColorHover, secondaryButtonTextColor, secondaryButtonTextColorHover, textColor1, textColor2); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppResponseWhiteLabelingOptions {\n"); - sb.append(" headerBackgroundColor: ").append(toIndentedString(headerBackgroundColor)).append("\n"); - sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); - sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); - sb.append(" pageBackgroundColor: ").append(toIndentedString(pageBackgroundColor)).append("\n"); - sb.append(" primaryButtonColor: ").append(toIndentedString(primaryButtonColor)).append("\n"); - sb.append(" primaryButtonColorHover: ").append(toIndentedString(primaryButtonColorHover)).append("\n"); - sb.append(" primaryButtonTextColor: ").append(toIndentedString(primaryButtonTextColor)).append("\n"); - sb.append(" primaryButtonTextColorHover: ").append(toIndentedString(primaryButtonTextColorHover)).append("\n"); - sb.append(" secondaryButtonColor: ").append(toIndentedString(secondaryButtonColor)).append("\n"); - sb.append(" secondaryButtonColorHover: ").append(toIndentedString(secondaryButtonColorHover)).append("\n"); - sb.append(" secondaryButtonTextColor: ").append(toIndentedString(secondaryButtonTextColor)).append("\n"); - sb.append(" secondaryButtonTextColorHover: ").append(toIndentedString(secondaryButtonTextColorHover)).append("\n"); - sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); - sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (headerBackgroundColor != null) { - if (isFileTypeOrListOfFiles(headerBackgroundColor)) { - fileTypeFound = true; - } + /** + * Get primaryButtonColor + * + * @return primaryButtonColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonColor() { + return primaryButtonColor; + } - if (headerBackgroundColor.getClass().equals(java.io.File.class) || - headerBackgroundColor.getClass().equals(Integer.class) || - headerBackgroundColor.getClass().equals(String.class) || - headerBackgroundColor.getClass().isEnum()) { - map.put("header_background_color", headerBackgroundColor); - } else if (isListOfFile(headerBackgroundColor)) { - for(int i = 0; i< getListSize(headerBackgroundColor); i++) { - map.put("header_background_color[" + i + "]", getFromList(headerBackgroundColor, i)); - } - } - else { - map.put("header_background_color", JSON.getDefault().getMapper().writeValueAsString(headerBackgroundColor)); - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColor(String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; } - if (legalVersion != null) { - if (isFileTypeOrListOfFiles(legalVersion)) { - fileTypeFound = true; - } - if (legalVersion.getClass().equals(java.io.File.class) || - legalVersion.getClass().equals(Integer.class) || - legalVersion.getClass().equals(String.class) || - legalVersion.getClass().isEnum()) { - map.put("legal_version", legalVersion); - } else if (isListOfFile(legalVersion)) { - for(int i = 0; i< getListSize(legalVersion); i++) { - map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); - } - } - else { - map.put("legal_version", JSON.getDefault().getMapper().writeValueAsString(legalVersion)); - } + public ApiAppResponseWhiteLabelingOptions primaryButtonColorHover( + String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + return this; } - if (linkColor != null) { - if (isFileTypeOrListOfFiles(linkColor)) { - fileTypeFound = true; - } - if (linkColor.getClass().equals(java.io.File.class) || - linkColor.getClass().equals(Integer.class) || - linkColor.getClass().equals(String.class) || - linkColor.getClass().isEnum()) { - map.put("link_color", linkColor); - } else if (isListOfFile(linkColor)) { - for(int i = 0; i< getListSize(linkColor); i++) { - map.put("link_color[" + i + "]", getFromList(linkColor, i)); - } - } - else { - map.put("link_color", JSON.getDefault().getMapper().writeValueAsString(linkColor)); - } + /** + * Get primaryButtonColorHover + * + * @return primaryButtonColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonColorHover() { + return primaryButtonColorHover; } - if (pageBackgroundColor != null) { - if (isFileTypeOrListOfFiles(pageBackgroundColor)) { - fileTypeFound = true; - } - if (pageBackgroundColor.getClass().equals(java.io.File.class) || - pageBackgroundColor.getClass().equals(Integer.class) || - pageBackgroundColor.getClass().equals(String.class) || - pageBackgroundColor.getClass().isEnum()) { - map.put("page_background_color", pageBackgroundColor); - } else if (isListOfFile(pageBackgroundColor)) { - for(int i = 0; i< getListSize(pageBackgroundColor); i++) { - map.put("page_background_color[" + i + "]", getFromList(pageBackgroundColor, i)); - } - } - else { - map.put("page_background_color", JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColorHover(String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; } - if (primaryButtonColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonColor)) { - fileTypeFound = true; - } - if (primaryButtonColor.getClass().equals(java.io.File.class) || - primaryButtonColor.getClass().equals(Integer.class) || - primaryButtonColor.getClass().equals(String.class) || - primaryButtonColor.getClass().isEnum()) { - map.put("primary_button_color", primaryButtonColor); - } else if (isListOfFile(primaryButtonColor)) { - for(int i = 0; i< getListSize(primaryButtonColor); i++) { - map.put("primary_button_color[" + i + "]", getFromList(primaryButtonColor, i)); - } - } - else { - map.put("primary_button_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); - } + public ApiAppResponseWhiteLabelingOptions primaryButtonTextColor( + String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + return this; } - if (primaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { - fileTypeFound = true; - } - if (primaryButtonColorHover.getClass().equals(java.io.File.class) || - primaryButtonColorHover.getClass().equals(Integer.class) || - primaryButtonColorHover.getClass().equals(String.class) || - primaryButtonColorHover.getClass().isEnum()) { - map.put("primary_button_color_hover", primaryButtonColorHover); - } else if (isListOfFile(primaryButtonColorHover)) { - for(int i = 0; i< getListSize(primaryButtonColorHover); i++) { - map.put("primary_button_color_hover[" + i + "]", getFromList(primaryButtonColorHover, i)); - } - } - else { - map.put("primary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColorHover)); - } + /** + * Get primaryButtonTextColor + * + * @return primaryButtonTextColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonTextColor() { + return primaryButtonTextColor; } - if (primaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { - fileTypeFound = true; - } - if (primaryButtonTextColor.getClass().equals(java.io.File.class) || - primaryButtonTextColor.getClass().equals(Integer.class) || - primaryButtonTextColor.getClass().equals(String.class) || - primaryButtonTextColor.getClass().isEnum()) { - map.put("primary_button_text_color", primaryButtonTextColor); - } else if (isListOfFile(primaryButtonTextColor)) { - for(int i = 0; i< getListSize(primaryButtonTextColor); i++) { - map.put("primary_button_text_color[" + i + "]", getFromList(primaryButtonTextColor, i)); - } - } - else { - map.put("primary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColor)); - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColor(String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; } - if (primaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { - fileTypeFound = true; - } - if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) || - primaryButtonTextColorHover.getClass().equals(Integer.class) || - primaryButtonTextColorHover.getClass().equals(String.class) || - primaryButtonTextColorHover.getClass().isEnum()) { - map.put("primary_button_text_color_hover", primaryButtonTextColorHover); - } else if (isListOfFile(primaryButtonTextColorHover)) { - for(int i = 0; i< getListSize(primaryButtonTextColorHover); i++) { - map.put("primary_button_text_color_hover[" + i + "]", getFromList(primaryButtonTextColorHover, i)); - } - } - else { - map.put("primary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColorHover)); - } + public ApiAppResponseWhiteLabelingOptions primaryButtonTextColorHover( + String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + return this; } - if (secondaryButtonColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColor)) { - fileTypeFound = true; - } - if (secondaryButtonColor.getClass().equals(java.io.File.class) || - secondaryButtonColor.getClass().equals(Integer.class) || - secondaryButtonColor.getClass().equals(String.class) || - secondaryButtonColor.getClass().isEnum()) { - map.put("secondary_button_color", secondaryButtonColor); - } else if (isListOfFile(secondaryButtonColor)) { - for(int i = 0; i< getListSize(secondaryButtonColor); i++) { - map.put("secondary_button_color[" + i + "]", getFromList(secondaryButtonColor, i)); - } - } - else { - map.put("secondary_button_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); - } + /** + * Get primaryButtonTextColorHover + * + * @return primaryButtonTextColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonTextColorHover() { + return primaryButtonTextColorHover; } - if (secondaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { - fileTypeFound = true; - } - if (secondaryButtonColorHover.getClass().equals(java.io.File.class) || - secondaryButtonColorHover.getClass().equals(Integer.class) || - secondaryButtonColorHover.getClass().equals(String.class) || - secondaryButtonColorHover.getClass().isEnum()) { - map.put("secondary_button_color_hover", secondaryButtonColorHover); - } else if (isListOfFile(secondaryButtonColorHover)) { - for(int i = 0; i< getListSize(secondaryButtonColorHover); i++) { - map.put("secondary_button_color_hover[" + i + "]", getFromList(secondaryButtonColorHover, i)); - } - } - else { - map.put("secondary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColorHover)); - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColorHover(String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; } - if (secondaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { - fileTypeFound = true; - } - if (secondaryButtonTextColor.getClass().equals(java.io.File.class) || - secondaryButtonTextColor.getClass().equals(Integer.class) || - secondaryButtonTextColor.getClass().equals(String.class) || - secondaryButtonTextColor.getClass().isEnum()) { - map.put("secondary_button_text_color", secondaryButtonTextColor); - } else if (isListOfFile(secondaryButtonTextColor)) { - for(int i = 0; i< getListSize(secondaryButtonTextColor); i++) { - map.put("secondary_button_text_color[" + i + "]", getFromList(secondaryButtonTextColor, i)); - } - } - else { - map.put("secondary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColor)); - } + public ApiAppResponseWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + return this; } - if (secondaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { - fileTypeFound = true; - } - if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) || - secondaryButtonTextColorHover.getClass().equals(Integer.class) || - secondaryButtonTextColorHover.getClass().equals(String.class) || - secondaryButtonTextColorHover.getClass().isEnum()) { - map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); - } else if (isListOfFile(secondaryButtonTextColorHover)) { - for(int i = 0; i< getListSize(secondaryButtonTextColorHover); i++) { - map.put("secondary_button_text_color_hover[" + i + "]", getFromList(secondaryButtonTextColorHover, i)); - } - } - else { - map.put("secondary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColorHover)); - } + /** + * Get secondaryButtonColor + * + * @return secondaryButtonColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonColor() { + return secondaryButtonColor; } - if (textColor1 != null) { - if (isFileTypeOrListOfFiles(textColor1)) { - fileTypeFound = true; - } - if (textColor1.getClass().equals(java.io.File.class) || - textColor1.getClass().equals(Integer.class) || - textColor1.getClass().equals(String.class) || - textColor1.getClass().isEnum()) { - map.put("text_color1", textColor1); - } else if (isListOfFile(textColor1)) { - for(int i = 0; i< getListSize(textColor1); i++) { - map.put("text_color1[" + i + "]", getFromList(textColor1, i)); - } - } - else { - map.put("text_color1", JSON.getDefault().getMapper().writeValueAsString(textColor1)); - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColor(String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; } - if (textColor2 != null) { - if (isFileTypeOrListOfFiles(textColor2)) { - fileTypeFound = true; - } - if (textColor2.getClass().equals(java.io.File.class) || - textColor2.getClass().equals(Integer.class) || - textColor2.getClass().equals(String.class) || - textColor2.getClass().isEnum()) { - map.put("text_color2", textColor2); - } else if (isListOfFile(textColor2)) { - for(int i = 0; i< getListSize(textColor2); i++) { - map.put("text_color2[" + i + "]", getFromList(textColor2, i)); - } - } - else { - map.put("text_color2", JSON.getDefault().getMapper().writeValueAsString(textColor2)); - } + public ApiAppResponseWhiteLabelingOptions secondaryButtonColorHover( + String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + return this; + } + + /** + * Get secondaryButtonColorHover + * + * @return secondaryButtonColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonColorHover() { + return secondaryButtonColorHover; + } + + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColorHover(String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; } - } catch (Exception e) { - throw new ApiException(e); + + public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColor( + String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + return this; } - return fileTypeFound ? map : new HashMap<>(); - } + /** + * Get secondaryButtonTextColor + * + * @return secondaryButtonTextColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonTextColor() { + return secondaryButtonTextColor; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColor(String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + public ApiAppResponseWhiteLabelingOptions secondaryButtonTextColorHover( + String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + return this; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + /** + * Get secondaryButtonTextColorHover + * + * @return secondaryButtonTextColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonTextColorHover() { + return secondaryButtonTextColorHover; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColorHover(String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + public ApiAppResponseWhiteLabelingOptions textColor1(String textColor1) { + this.textColor1 = textColor1; + return this; + } - /** - * 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"; + /** + * Get textColor1 + * + * @return textColor1 + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextColor1() { + return textColor1; } - return o.toString().replace("\n", "\n "); - } -} + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor1(String textColor1) { + this.textColor1 = textColor1; + } + + public ApiAppResponseWhiteLabelingOptions textColor2(String textColor2) { + this.textColor2 = textColor2; + return this; + } + + /** + * Get textColor2 + * + * @return textColor2 + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextColor2() { + return textColor2; + } + + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor2(String textColor2) { + this.textColor2 = textColor2; + } + + /** Return true if this ApiAppResponseWhiteLabelingOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiAppResponseWhiteLabelingOptions apiAppResponseWhiteLabelingOptions = + (ApiAppResponseWhiteLabelingOptions) o; + return Objects.equals( + this.headerBackgroundColor, + apiAppResponseWhiteLabelingOptions.headerBackgroundColor) + && Objects.equals( + this.legalVersion, apiAppResponseWhiteLabelingOptions.legalVersion) + && Objects.equals(this.linkColor, apiAppResponseWhiteLabelingOptions.linkColor) + && Objects.equals( + this.pageBackgroundColor, + apiAppResponseWhiteLabelingOptions.pageBackgroundColor) + && Objects.equals( + this.primaryButtonColor, + apiAppResponseWhiteLabelingOptions.primaryButtonColor) + && Objects.equals( + this.primaryButtonColorHover, + apiAppResponseWhiteLabelingOptions.primaryButtonColorHover) + && Objects.equals( + this.primaryButtonTextColor, + apiAppResponseWhiteLabelingOptions.primaryButtonTextColor) + && Objects.equals( + this.primaryButtonTextColorHover, + apiAppResponseWhiteLabelingOptions.primaryButtonTextColorHover) + && Objects.equals( + this.secondaryButtonColor, + apiAppResponseWhiteLabelingOptions.secondaryButtonColor) + && Objects.equals( + this.secondaryButtonColorHover, + apiAppResponseWhiteLabelingOptions.secondaryButtonColorHover) + && Objects.equals( + this.secondaryButtonTextColor, + apiAppResponseWhiteLabelingOptions.secondaryButtonTextColor) + && Objects.equals( + this.secondaryButtonTextColorHover, + apiAppResponseWhiteLabelingOptions.secondaryButtonTextColorHover) + && Objects.equals(this.textColor1, apiAppResponseWhiteLabelingOptions.textColor1) + && Objects.equals(this.textColor2, apiAppResponseWhiteLabelingOptions.textColor2); + } + @Override + public int hashCode() { + return Objects.hash( + headerBackgroundColor, + legalVersion, + linkColor, + pageBackgroundColor, + primaryButtonColor, + primaryButtonColorHover, + primaryButtonTextColor, + primaryButtonTextColorHover, + secondaryButtonColor, + secondaryButtonColorHover, + secondaryButtonTextColor, + secondaryButtonTextColorHover, + textColor1, + textColor2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppResponseWhiteLabelingOptions {\n"); + sb.append(" headerBackgroundColor: ") + .append(toIndentedString(headerBackgroundColor)) + .append("\n"); + sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); + sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); + sb.append(" pageBackgroundColor: ") + .append(toIndentedString(pageBackgroundColor)) + .append("\n"); + sb.append(" primaryButtonColor: ") + .append(toIndentedString(primaryButtonColor)) + .append("\n"); + sb.append(" primaryButtonColorHover: ") + .append(toIndentedString(primaryButtonColorHover)) + .append("\n"); + sb.append(" primaryButtonTextColor: ") + .append(toIndentedString(primaryButtonTextColor)) + .append("\n"); + sb.append(" primaryButtonTextColorHover: ") + .append(toIndentedString(primaryButtonTextColorHover)) + .append("\n"); + sb.append(" secondaryButtonColor: ") + .append(toIndentedString(secondaryButtonColor)) + .append("\n"); + sb.append(" secondaryButtonColorHover: ") + .append(toIndentedString(secondaryButtonColorHover)) + .append("\n"); + sb.append(" secondaryButtonTextColor: ") + .append(toIndentedString(secondaryButtonTextColor)) + .append("\n"); + sb.append(" secondaryButtonTextColorHover: ") + .append(toIndentedString(secondaryButtonTextColorHover)) + .append("\n"); + sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); + sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (headerBackgroundColor != null) { + if (isFileTypeOrListOfFiles(headerBackgroundColor)) { + fileTypeFound = true; + } + + if (headerBackgroundColor.getClass().equals(java.io.File.class) + || headerBackgroundColor.getClass().equals(Integer.class) + || headerBackgroundColor.getClass().equals(String.class) + || headerBackgroundColor.getClass().isEnum()) { + map.put("header_background_color", headerBackgroundColor); + } else if (isListOfFile(headerBackgroundColor)) { + for (int i = 0; i < getListSize(headerBackgroundColor); i++) { + map.put( + "header_background_color[" + i + "]", + getFromList(headerBackgroundColor, i)); + } + } else { + map.put( + "header_background_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(headerBackgroundColor)); + } + } + if (legalVersion != null) { + if (isFileTypeOrListOfFiles(legalVersion)) { + fileTypeFound = true; + } + + if (legalVersion.getClass().equals(java.io.File.class) + || legalVersion.getClass().equals(Integer.class) + || legalVersion.getClass().equals(String.class) + || legalVersion.getClass().isEnum()) { + map.put("legal_version", legalVersion); + } else if (isListOfFile(legalVersion)) { + for (int i = 0; i < getListSize(legalVersion); i++) { + map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); + } + } else { + map.put( + "legal_version", + JSON.getDefault().getMapper().writeValueAsString(legalVersion)); + } + } + if (linkColor != null) { + if (isFileTypeOrListOfFiles(linkColor)) { + fileTypeFound = true; + } + + if (linkColor.getClass().equals(java.io.File.class) + || linkColor.getClass().equals(Integer.class) + || linkColor.getClass().equals(String.class) + || linkColor.getClass().isEnum()) { + map.put("link_color", linkColor); + } else if (isListOfFile(linkColor)) { + for (int i = 0; i < getListSize(linkColor); i++) { + map.put("link_color[" + i + "]", getFromList(linkColor, i)); + } + } else { + map.put( + "link_color", + JSON.getDefault().getMapper().writeValueAsString(linkColor)); + } + } + if (pageBackgroundColor != null) { + if (isFileTypeOrListOfFiles(pageBackgroundColor)) { + fileTypeFound = true; + } + + if (pageBackgroundColor.getClass().equals(java.io.File.class) + || pageBackgroundColor.getClass().equals(Integer.class) + || pageBackgroundColor.getClass().equals(String.class) + || pageBackgroundColor.getClass().isEnum()) { + map.put("page_background_color", pageBackgroundColor); + } else if (isListOfFile(pageBackgroundColor)) { + for (int i = 0; i < getListSize(pageBackgroundColor); i++) { + map.put( + "page_background_color[" + i + "]", + getFromList(pageBackgroundColor, i)); + } + } else { + map.put( + "page_background_color", + JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); + } + } + if (primaryButtonColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonColor)) { + fileTypeFound = true; + } + + if (primaryButtonColor.getClass().equals(java.io.File.class) + || primaryButtonColor.getClass().equals(Integer.class) + || primaryButtonColor.getClass().equals(String.class) + || primaryButtonColor.getClass().isEnum()) { + map.put("primary_button_color", primaryButtonColor); + } else if (isListOfFile(primaryButtonColor)) { + for (int i = 0; i < getListSize(primaryButtonColor); i++) { + map.put( + "primary_button_color[" + i + "]", + getFromList(primaryButtonColor, i)); + } + } else { + map.put( + "primary_button_color", + JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); + } + } + if (primaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { + fileTypeFound = true; + } + + if (primaryButtonColorHover.getClass().equals(java.io.File.class) + || primaryButtonColorHover.getClass().equals(Integer.class) + || primaryButtonColorHover.getClass().equals(String.class) + || primaryButtonColorHover.getClass().isEnum()) { + map.put("primary_button_color_hover", primaryButtonColorHover); + } else if (isListOfFile(primaryButtonColorHover)) { + for (int i = 0; i < getListSize(primaryButtonColorHover); i++) { + map.put( + "primary_button_color_hover[" + i + "]", + getFromList(primaryButtonColorHover, i)); + } + } else { + map.put( + "primary_button_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonColorHover)); + } + } + if (primaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { + fileTypeFound = true; + } + + if (primaryButtonTextColor.getClass().equals(java.io.File.class) + || primaryButtonTextColor.getClass().equals(Integer.class) + || primaryButtonTextColor.getClass().equals(String.class) + || primaryButtonTextColor.getClass().isEnum()) { + map.put("primary_button_text_color", primaryButtonTextColor); + } else if (isListOfFile(primaryButtonTextColor)) { + for (int i = 0; i < getListSize(primaryButtonTextColor); i++) { + map.put( + "primary_button_text_color[" + i + "]", + getFromList(primaryButtonTextColor, i)); + } + } else { + map.put( + "primary_button_text_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonTextColor)); + } + } + if (primaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { + fileTypeFound = true; + } + + if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) + || primaryButtonTextColorHover.getClass().equals(Integer.class) + || primaryButtonTextColorHover.getClass().equals(String.class) + || primaryButtonTextColorHover.getClass().isEnum()) { + map.put("primary_button_text_color_hover", primaryButtonTextColorHover); + } else if (isListOfFile(primaryButtonTextColorHover)) { + for (int i = 0; i < getListSize(primaryButtonTextColorHover); i++) { + map.put( + "primary_button_text_color_hover[" + i + "]", + getFromList(primaryButtonTextColorHover, i)); + } + } else { + map.put( + "primary_button_text_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonTextColorHover)); + } + } + if (secondaryButtonColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColor)) { + fileTypeFound = true; + } + + if (secondaryButtonColor.getClass().equals(java.io.File.class) + || secondaryButtonColor.getClass().equals(Integer.class) + || secondaryButtonColor.getClass().equals(String.class) + || secondaryButtonColor.getClass().isEnum()) { + map.put("secondary_button_color", secondaryButtonColor); + } else if (isListOfFile(secondaryButtonColor)) { + for (int i = 0; i < getListSize(secondaryButtonColor); i++) { + map.put( + "secondary_button_color[" + i + "]", + getFromList(secondaryButtonColor, i)); + } + } else { + map.put( + "secondary_button_color", + JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); + } + } + if (secondaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { + fileTypeFound = true; + } + + if (secondaryButtonColorHover.getClass().equals(java.io.File.class) + || secondaryButtonColorHover.getClass().equals(Integer.class) + || secondaryButtonColorHover.getClass().equals(String.class) + || secondaryButtonColorHover.getClass().isEnum()) { + map.put("secondary_button_color_hover", secondaryButtonColorHover); + } else if (isListOfFile(secondaryButtonColorHover)) { + for (int i = 0; i < getListSize(secondaryButtonColorHover); i++) { + map.put( + "secondary_button_color_hover[" + i + "]", + getFromList(secondaryButtonColorHover, i)); + } + } else { + map.put( + "secondary_button_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonColorHover)); + } + } + if (secondaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { + fileTypeFound = true; + } + + if (secondaryButtonTextColor.getClass().equals(java.io.File.class) + || secondaryButtonTextColor.getClass().equals(Integer.class) + || secondaryButtonTextColor.getClass().equals(String.class) + || secondaryButtonTextColor.getClass().isEnum()) { + map.put("secondary_button_text_color", secondaryButtonTextColor); + } else if (isListOfFile(secondaryButtonTextColor)) { + for (int i = 0; i < getListSize(secondaryButtonTextColor); i++) { + map.put( + "secondary_button_text_color[" + i + "]", + getFromList(secondaryButtonTextColor, i)); + } + } else { + map.put( + "secondary_button_text_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonTextColor)); + } + } + if (secondaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { + fileTypeFound = true; + } + + if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) + || secondaryButtonTextColorHover.getClass().equals(Integer.class) + || secondaryButtonTextColorHover.getClass().equals(String.class) + || secondaryButtonTextColorHover.getClass().isEnum()) { + map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); + } else if (isListOfFile(secondaryButtonTextColorHover)) { + for (int i = 0; i < getListSize(secondaryButtonTextColorHover); i++) { + map.put( + "secondary_button_text_color_hover[" + i + "]", + getFromList(secondaryButtonTextColorHover, i)); + } + } else { + map.put( + "secondary_button_text_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonTextColorHover)); + } + } + if (textColor1 != null) { + if (isFileTypeOrListOfFiles(textColor1)) { + fileTypeFound = true; + } + + if (textColor1.getClass().equals(java.io.File.class) + || textColor1.getClass().equals(Integer.class) + || textColor1.getClass().equals(String.class) + || textColor1.getClass().isEnum()) { + map.put("text_color1", textColor1); + } else if (isListOfFile(textColor1)) { + for (int i = 0; i < getListSize(textColor1); i++) { + map.put("text_color1[" + i + "]", getFromList(textColor1, i)); + } + } else { + map.put( + "text_color1", + JSON.getDefault().getMapper().writeValueAsString(textColor1)); + } + } + if (textColor2 != null) { + if (isFileTypeOrListOfFiles(textColor2)) { + fileTypeFound = true; + } + + if (textColor2.getClass().equals(java.io.File.class) + || textColor2.getClass().equals(Integer.class) + || textColor2.getClass().equals(String.class) + || textColor2.getClass().isEnum()) { + map.put("text_color2", textColor2); + } else if (isListOfFile(textColor2)) { + for (int i = 0; i < getListSize(textColor2); i++) { + map.put("text_color2[" + i + "]", getFromList(textColor2, i)); + } + } else { + map.put( + "text_color2", + JSON.getDefault().getMapper().writeValueAsString(textColor2)); + } + } + } 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/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java b/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java index 930edc3..04b23fb 100644 --- a/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ApiAppUpdateRequest.java @@ -10,483 +10,457 @@ * 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.SubOAuth; -import com.dropbox.sign.model.SubOptions; -import com.dropbox.sign.model.SubWhiteLabelingOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * ApiAppUpdateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiAppUpdateRequest { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; - public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; - private File customLogoFile; - - public static final String JSON_PROPERTY_DOMAINS = "domains"; - private List domains = null; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_OAUTH = "oauth"; - private SubOAuth oauth; + public static final String JSON_PROPERTY_CUSTOM_LOGO_FILE = "custom_logo_file"; + private File customLogoFile; - public static final String JSON_PROPERTY_OPTIONS = "options"; - private SubOptions options; - - public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; - private SubWhiteLabelingOptions whiteLabelingOptions; - - public ApiAppUpdateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ApiAppUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ApiAppUpdateRequest.class); - } - - static public ApiAppUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ApiAppUpdateRequest.class - ); - } - - public ApiAppUpdateRequest callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The URL at which the API App should receive event callbacks. - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public ApiAppUpdateRequest customLogoFile(File customLogoFile) { - this.customLogoFile = 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public File getCustomLogoFile() { - return customLogoFile; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomLogoFile(File customLogoFile) { - this.customLogoFile = customLogoFile; - } - - - public ApiAppUpdateRequest domains(List domains) { - this.domains = domains; - return this; - } - - public ApiAppUpdateRequest 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.Nullable - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getDomains() { - return domains; - } - - - @JsonProperty(JSON_PROPERTY_DOMAINS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDomains(List domains) { - this.domains = domains; - } - - - public ApiAppUpdateRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name you want to assign to the ApiApp. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public ApiAppUpdateRequest oauth(SubOAuth oauth) { - this.oauth = oauth; - return this; - } - - /** - * Get oauth - * @return oauth - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubOAuth getOauth() { - return oauth; - } - - - @JsonProperty(JSON_PROPERTY_OAUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth(SubOAuth oauth) { - this.oauth = oauth; - } - - - public ApiAppUpdateRequest options(SubOptions options) { - this.options = options; - return this; - } - - /** - * Get options - * @return options - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubOptions getOptions() { - return options; - } - - - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOptions(SubOptions options) { - this.options = options; - } - - - public ApiAppUpdateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - return this; - } - - /** - * Get whiteLabelingOptions - * @return whiteLabelingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubWhiteLabelingOptions getWhiteLabelingOptions() { - return whiteLabelingOptions; - } - - - @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWhiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { - this.whiteLabelingOptions = whiteLabelingOptions; - } - - - /** - * Return true if this ApiAppUpdateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiAppUpdateRequest apiAppUpdateRequest = (ApiAppUpdateRequest) o; - return Objects.equals(this.callbackUrl, apiAppUpdateRequest.callbackUrl) && - Objects.equals(this.customLogoFile, apiAppUpdateRequest.customLogoFile) && - Objects.equals(this.domains, apiAppUpdateRequest.domains) && - Objects.equals(this.name, apiAppUpdateRequest.name) && - Objects.equals(this.oauth, apiAppUpdateRequest.oauth) && - Objects.equals(this.options, apiAppUpdateRequest.options) && - Objects.equals(this.whiteLabelingOptions, apiAppUpdateRequest.whiteLabelingOptions); - } - - @Override - public int hashCode() { - return Objects.hash(callbackUrl, customLogoFile, domains, name, oauth, options, whiteLabelingOptions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiAppUpdateRequest {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); - sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" whiteLabelingOptions: ").append(toIndentedString(whiteLabelingOptions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_DOMAINS = "domains"; + private List domains = null; - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OAUTH = "oauth"; + private SubOAuth oauth; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private SubOptions options; + + public static final String JSON_PROPERTY_WHITE_LABELING_OPTIONS = "white_labeling_options"; + private SubWhiteLabelingOptions whiteLabelingOptions; + + public ApiAppUpdateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ApiAppUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ApiAppUpdateRequest.class); } - if (customLogoFile != null) { - if (isFileTypeOrListOfFiles(customLogoFile)) { - fileTypeFound = true; - } - if (customLogoFile.getClass().equals(java.io.File.class) || - customLogoFile.getClass().equals(Integer.class) || - customLogoFile.getClass().equals(String.class) || - customLogoFile.getClass().isEnum()) { - map.put("custom_logo_file", customLogoFile); - } else if (isListOfFile(customLogoFile)) { - for(int i = 0; i< getListSize(customLogoFile); i++) { - map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); - } - } - else { - map.put("custom_logo_file", JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); - } + public static ApiAppUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ApiAppUpdateRequest.class); } - if (domains != null) { - if (isFileTypeOrListOfFiles(domains)) { - fileTypeFound = true; - } - if (domains.getClass().equals(java.io.File.class) || - domains.getClass().equals(Integer.class) || - domains.getClass().equals(String.class) || - domains.getClass().isEnum()) { - map.put("domains", domains); - } else if (isListOfFile(domains)) { - for(int i = 0; i< getListSize(domains); i++) { - map.put("domains[" + i + "]", getFromList(domains, i)); - } - } - else { - map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); - } + public ApiAppUpdateRequest callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + /** + * The URL at which the API App should receive event callbacks. + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; } - if (oauth != null) { - if (isFileTypeOrListOfFiles(oauth)) { - fileTypeFound = true; - } - if (oauth.getClass().equals(java.io.File.class) || - oauth.getClass().equals(Integer.class) || - oauth.getClass().equals(String.class) || - oauth.getClass().isEnum()) { - map.put("oauth", oauth); - } else if (isListOfFile(oauth)) { - for(int i = 0; i< getListSize(oauth); i++) { - map.put("oauth[" + i + "]", getFromList(oauth, i)); - } - } - else { - map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); - } + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - if (options.getClass().equals(java.io.File.class) || - options.getClass().equals(Integer.class) || - options.getClass().equals(String.class) || - options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for(int i = 0; i< getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } - else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } + public ApiAppUpdateRequest customLogoFile(File customLogoFile) { + this.customLogoFile = 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 @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getCustomLogoFile() { + return customLogoFile; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_LOGO_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomLogoFile(File customLogoFile) { + this.customLogoFile = customLogoFile; } - if (whiteLabelingOptions != null) { - if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { - fileTypeFound = true; + + public ApiAppUpdateRequest domains(List domains) { + this.domains = domains; + return this; + } + + public ApiAppUpdateRequest addDomainsItem(String domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); } + this.domains.add(domainsItem); + return this; + } - if (whiteLabelingOptions.getClass().equals(java.io.File.class) || - whiteLabelingOptions.getClass().equals(Integer.class) || - whiteLabelingOptions.getClass().equals(String.class) || - whiteLabelingOptions.getClass().isEnum()) { - map.put("white_labeling_options", whiteLabelingOptions); - } else if (isListOfFile(whiteLabelingOptions)) { - for(int i = 0; i< getListSize(whiteLabelingOptions); i++) { - map.put("white_labeling_options[" + i + "]", getFromList(whiteLabelingOptions, i)); - } + /** + * The domain names the ApiApp will be associated with. + * + * @return domains + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDomains() { + return domains; + } + + @JsonProperty(JSON_PROPERTY_DOMAINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomains(List domains) { + this.domains = domains; + } + + public ApiAppUpdateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name you want to assign to the ApiApp. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public ApiAppUpdateRequest oauth(SubOAuth oauth) { + this.oauth = oauth; + return this; + } + + /** + * Get oauth + * + * @return oauth + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubOAuth getOauth() { + return oauth; + } + + @JsonProperty(JSON_PROPERTY_OAUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOauth(SubOAuth oauth) { + this.oauth = oauth; + } + + public ApiAppUpdateRequest options(SubOptions options) { + this.options = options; + return this; + } + + /** + * Get options + * + * @return options + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubOptions getOptions() { + return options; + } + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(SubOptions options) { + this.options = options; + } + + public ApiAppUpdateRequest whiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + return this; + } + + /** + * Get whiteLabelingOptions + * + * @return whiteLabelingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubWhiteLabelingOptions getWhiteLabelingOptions() { + return whiteLabelingOptions; + } + + @JsonProperty(JSON_PROPERTY_WHITE_LABELING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWhiteLabelingOptions(SubWhiteLabelingOptions whiteLabelingOptions) { + this.whiteLabelingOptions = whiteLabelingOptions; + } + + /** Return true if this ApiAppUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("white_labeling_options", JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + if (o == null || getClass() != o.getClass()) { + return false; } + ApiAppUpdateRequest apiAppUpdateRequest = (ApiAppUpdateRequest) o; + return Objects.equals(this.callbackUrl, apiAppUpdateRequest.callbackUrl) + && Objects.equals(this.customLogoFile, apiAppUpdateRequest.customLogoFile) + && Objects.equals(this.domains, apiAppUpdateRequest.domains) + && Objects.equals(this.name, apiAppUpdateRequest.name) + && Objects.equals(this.oauth, apiAppUpdateRequest.oauth) + && Objects.equals(this.options, apiAppUpdateRequest.options) + && Objects.equals( + this.whiteLabelingOptions, apiAppUpdateRequest.whiteLabelingOptions); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + callbackUrl, customLogoFile, domains, name, oauth, options, whiteLabelingOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiAppUpdateRequest {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" customLogoFile: ").append(toIndentedString(customLogoFile)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" oauth: ").append(toIndentedString(oauth)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" whiteLabelingOptions: ") + .append(toIndentedString(whiteLabelingOptions)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (customLogoFile != null) { + if (isFileTypeOrListOfFiles(customLogoFile)) { + fileTypeFound = true; + } + + if (customLogoFile.getClass().equals(java.io.File.class) + || customLogoFile.getClass().equals(Integer.class) + || customLogoFile.getClass().equals(String.class) + || customLogoFile.getClass().isEnum()) { + map.put("custom_logo_file", customLogoFile); + } else if (isListOfFile(customLogoFile)) { + for (int i = 0; i < getListSize(customLogoFile); i++) { + map.put("custom_logo_file[" + i + "]", getFromList(customLogoFile, i)); + } + } else { + map.put( + "custom_logo_file", + JSON.getDefault().getMapper().writeValueAsString(customLogoFile)); + } + } + if (domains != null) { + if (isFileTypeOrListOfFiles(domains)) { + fileTypeFound = true; + } + + if (domains.getClass().equals(java.io.File.class) + || domains.getClass().equals(Integer.class) + || domains.getClass().equals(String.class) + || domains.getClass().isEnum()) { + map.put("domains", domains); + } else if (isListOfFile(domains)) { + for (int i = 0; i < getListSize(domains); i++) { + map.put("domains[" + i + "]", getFromList(domains, i)); + } + } else { + map.put("domains", JSON.getDefault().getMapper().writeValueAsString(domains)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (oauth != null) { + if (isFileTypeOrListOfFiles(oauth)) { + fileTypeFound = true; + } + + if (oauth.getClass().equals(java.io.File.class) + || oauth.getClass().equals(Integer.class) + || oauth.getClass().equals(String.class) + || oauth.getClass().isEnum()) { + map.put("oauth", oauth); + } else if (isListOfFile(oauth)) { + for (int i = 0; i < getListSize(oauth); i++) { + map.put("oauth[" + i + "]", getFromList(oauth, i)); + } + } else { + map.put("oauth", JSON.getDefault().getMapper().writeValueAsString(oauth)); + } + } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } + + if (options.getClass().equals(java.io.File.class) + || options.getClass().equals(Integer.class) + || options.getClass().equals(String.class) + || options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for (int i = 0; i < getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } + } else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); + } + } + if (whiteLabelingOptions != null) { + if (isFileTypeOrListOfFiles(whiteLabelingOptions)) { + fileTypeFound = true; + } + + if (whiteLabelingOptions.getClass().equals(java.io.File.class) + || whiteLabelingOptions.getClass().equals(Integer.class) + || whiteLabelingOptions.getClass().equals(String.class) + || whiteLabelingOptions.getClass().isEnum()) { + map.put("white_labeling_options", whiteLabelingOptions); + } else if (isListOfFile(whiteLabelingOptions)) { + for (int i = 0; i < getListSize(whiteLabelingOptions); i++) { + map.put( + "white_labeling_options[" + i + "]", + getFromList(whiteLabelingOptions, i)); + } + } else { + map.put( + "white_labeling_options", + JSON.getDefault().getMapper().writeValueAsString(whiteLabelingOptions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java index 74f1294..27b8be9 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponse.java @@ -10,341 +10,329 @@ * 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.BulkSendJobGetResponseSignatureRequests; -import com.dropbox.sign.model.BulkSendJobResponse; -import com.dropbox.sign.model.ListInfoResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * BulkSendJobGetResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class BulkSendJobGetResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; - private BulkSendJobResponse bulkSendJob; - - public static final String JSON_PROPERTY_LIST_INFO = "list_info"; - private ListInfoResponse listInfo; - - public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - private List signatureRequests = new ArrayList<>(); - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings = null; - - public BulkSendJobGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public BulkSendJobGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponse.class); - } - - static public BulkSendJobGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobGetResponse.class - ); - } - - public BulkSendJobGetResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - return this; - } - - /** - * Get bulkSendJob - * @return bulkSendJob - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BulkSendJobResponse getBulkSendJob() { - return bulkSendJob; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - } - - - public BulkSendJobGetResponse 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 BulkSendJobGetResponse signatureRequests(List signatureRequests) { - this.signatureRequests = signatureRequests; - return this; - } - - public BulkSendJobGetResponse addSignatureRequestsItem(BulkSendJobGetResponseSignatureRequests signatureRequestsItem) { - if (this.signatureRequests == null) { - this.signatureRequests = new ArrayList<>(); + public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; + private BulkSendJobResponse bulkSendJob; + + public static final String JSON_PROPERTY_LIST_INFO = "list_info"; + private ListInfoResponse listInfo; + + public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; + private List signatureRequests = new ArrayList<>(); + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public BulkSendJobGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static BulkSendJobGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponse.class); } - this.signatureRequests.add(signatureRequestsItem); - return this; - } - - /** - * Contains information about the Signature Requests sent in bulk. - * @return signatureRequests - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSignatureRequests() { - return signatureRequests; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequests(List signatureRequests) { - this.signatureRequests = signatureRequests; - } - - - public BulkSendJobGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + + public static BulkSendJobGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), BulkSendJobGetResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this BulkSendJobGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public BulkSendJobGetResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get bulkSendJob + * + * @return bulkSendJob + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BulkSendJobResponse getBulkSendJob() { + return bulkSendJob; } - BulkSendJobGetResponse bulkSendJobGetResponse = (BulkSendJobGetResponse) o; - return Objects.equals(this.bulkSendJob, bulkSendJobGetResponse.bulkSendJob) && - Objects.equals(this.listInfo, bulkSendJobGetResponse.listInfo) && - Objects.equals(this.signatureRequests, bulkSendJobGetResponse.signatureRequests) && - Objects.equals(this.warnings, bulkSendJobGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(bulkSendJob, listInfo, signatureRequests, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobGetResponse {\n"); - sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); - sb.append(" signatureRequests: ").append(toIndentedString(signatureRequests)).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 (bulkSendJob != null) { - if (isFileTypeOrListOfFiles(bulkSendJob)) { - fileTypeFound = true; - } - if (bulkSendJob.getClass().equals(java.io.File.class) || - bulkSendJob.getClass().equals(Integer.class) || - bulkSendJob.getClass().equals(String.class) || - bulkSendJob.getClass().isEnum()) { - map.put("bulk_send_job", bulkSendJob); - } else if (isListOfFile(bulkSendJob)) { - for(int i = 0; i< getListSize(bulkSendJob); i++) { - map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); - } - } - else { - map.put("bulk_send_job", JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); - } + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; } - 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)); - } + public BulkSendJobGetResponse listInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; } - if (signatureRequests != null) { - if (isFileTypeOrListOfFiles(signatureRequests)) { - fileTypeFound = true; - } - if (signatureRequests.getClass().equals(java.io.File.class) || - signatureRequests.getClass().equals(Integer.class) || - signatureRequests.getClass().equals(String.class) || - signatureRequests.getClass().isEnum()) { - map.put("signature_requests", signatureRequests); - } else if (isListOfFile(signatureRequests)) { - for(int i = 0; i< getListSize(signatureRequests); i++) { - map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); - } - } - else { - map.put("signature_requests", JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); + /** + * 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 BulkSendJobGetResponse signatureRequests( + List signatureRequests) { + this.signatureRequests = signatureRequests; + return this; + } + + public BulkSendJobGetResponse addSignatureRequestsItem( + BulkSendJobGetResponseSignatureRequests signatureRequestsItem) { + if (this.signatureRequests == null) { + this.signatureRequests = new ArrayList<>(); } + this.signatureRequests.add(signatureRequestsItem); + return this; + } + + /** + * Contains information about the Signature Requests sent in bulk. + * + * @return signatureRequests + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSignatureRequests() { + return signatureRequests; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequests( + List signatureRequests) { + this.signatureRequests = signatureRequests; + } + + public BulkSendJobGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public BulkSendJobGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this BulkSendJobGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + BulkSendJobGetResponse bulkSendJobGetResponse = (BulkSendJobGetResponse) o; + return Objects.equals(this.bulkSendJob, bulkSendJobGetResponse.bulkSendJob) + && Objects.equals(this.listInfo, bulkSendJobGetResponse.listInfo) + && Objects.equals(this.signatureRequests, bulkSendJobGetResponse.signatureRequests) + && Objects.equals(this.warnings, bulkSendJobGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(bulkSendJob, listInfo, signatureRequests, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobGetResponse {\n"); + sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" signatureRequests: ") + .append(toIndentedString(signatureRequests)) + .append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJob != null) { + if (isFileTypeOrListOfFiles(bulkSendJob)) { + fileTypeFound = true; + } + + if (bulkSendJob.getClass().equals(java.io.File.class) + || bulkSendJob.getClass().equals(Integer.class) + || bulkSendJob.getClass().equals(String.class) + || bulkSendJob.getClass().isEnum()) { + map.put("bulk_send_job", bulkSendJob); + } else if (isListOfFile(bulkSendJob)) { + for (int i = 0; i < getListSize(bulkSendJob); i++) { + map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); + } + } else { + map.put( + "bulk_send_job", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); + } + } + 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 (signatureRequests != null) { + if (isFileTypeOrListOfFiles(signatureRequests)) { + fileTypeFound = true; + } + + if (signatureRequests.getClass().equals(java.io.File.class) + || signatureRequests.getClass().equals(Integer.class) + || signatureRequests.getClass().equals(String.class) + || signatureRequests.getClass().isEnum()) { + map.put("signature_requests", signatureRequests); + } else if (isListOfFile(signatureRequests)) { + for (int i = 0; i < getListSize(signatureRequests); i++) { + map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); + } + } else { + map.put( + "signature_requests", + JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); + } + } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java index 45342c7..d0b87b0 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobGetResponseSignatureRequests.java @@ -10,1423 +10,1438 @@ * 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.SignatureRequestResponseAttachment; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; -import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseSignatures; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * BulkSendJobGetResponseSignatureRequests - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class BulkSendJobGetResponseSignatureRequests { - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - private String signatureRequestId; + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + private String signatureRequestId; - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - private String requesterEmailAddress; + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + private String requesterEmailAddress; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; - private String originalTitle; + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + private String originalTitle; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Object metadata; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Object metadata; - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - private Integer createdAt; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; - public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; - private Boolean isComplete; + public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; + private Boolean isComplete; - public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; - private Boolean isDeclined; + public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; + private Boolean isDeclined; - public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; - private Boolean hasError; + public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; + private Boolean hasError; - public static final String JSON_PROPERTY_FILES_URL = "files_url"; - private String filesUrl; + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; - public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; - private String signingUrl; + public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; + private String signingUrl; - public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; - private String detailsUrl; + public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; + private String detailsUrl; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; - private String finalCopyUri; + public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; + private String finalCopyUri; - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = null; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData = null; + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + private List responseData = null; - public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures = null; + public static final String JSON_PROPERTY_SIGNATURES = "signatures"; + private List signatures = null; - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - private String bulkSendJobId; + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + private String bulkSendJobId; - public BulkSendJobGetResponseSignatureRequests() { - } + public BulkSendJobGetResponseSignatureRequests() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public BulkSendJobGetResponseSignatureRequests init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobGetResponseSignatureRequests.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static BulkSendJobGetResponseSignatureRequests init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, BulkSendJobGetResponseSignatureRequests.class); + } - static public BulkSendJobGetResponseSignatureRequests init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobGetResponseSignatureRequests.class - ); - } + public static BulkSendJobGetResponseSignatureRequests init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + BulkSendJobGetResponseSignatureRequests.class); + } - public BulkSendJobGetResponseSignatureRequests testMode(Boolean testMode) { - this.testMode = testMode; - return this; - } + public BulkSendJobGetResponseSignatureRequests testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. - * @return testMode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Whether this is a test signature request. Test requests have no legal value. Defaults to + * `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } - public Boolean getTestMode() { - return testMode; - } + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + public BulkSendJobGetResponseSignatureRequests signatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } + /** + * The id of the SignatureRequest. + * + * @return signatureRequestId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignatureRequestId() { + return signatureRequestId; + } + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + } - public BulkSendJobGetResponseSignatureRequests signatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } + public BulkSendJobGetResponseSignatureRequests requesterEmailAddress( + String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } - /** - * The id of the SignatureRequest. - * @return signatureRequestId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The email address of the initiator of the SignatureRequest. + * + * @return requesterEmailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } - public String getSignatureRequestId() { - return signatureRequestId; - } + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + public BulkSendJobGetResponseSignatureRequests title(String title) { + this.title = title; + return this; + } - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } + /** + * The title the specified Account uses for the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } - public BulkSendJobGetResponseSignatureRequests requesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } + public BulkSendJobGetResponseSignatureRequests originalTitle(String originalTitle) { + this.originalTitle = originalTitle; + return this; + } - /** - * The email address of the initiator of the SignatureRequest. - * @return requesterEmailAddress - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - - public BulkSendJobGetResponseSignatureRequests title(String title) { - this.title = title; - return this; - } - - /** - * The title the specified Account uses for the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public BulkSendJobGetResponseSignatureRequests originalTitle(String originalTitle) { - this.originalTitle = originalTitle; - return this; - } - - /** - * Default Label for account. - * @return originalTitle - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getOriginalTitle() { - return originalTitle; - } - - - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalTitle(String originalTitle) { - this.originalTitle = originalTitle; - } - - - public BulkSendJobGetResponseSignatureRequests subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that was initially sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public BulkSendJobGetResponseSignatureRequests message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that was initially sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public BulkSendJobGetResponseSignatureRequests metadata(Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * The metadata attached to the signature request. - * @return metadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Object metadata) { - this.metadata = metadata; - } - - - public BulkSendJobGetResponseSignatureRequests createdAt(Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Time the signature request was created. - * @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 BulkSendJobGetResponseSignatureRequests expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - public BulkSendJobGetResponseSignatureRequests isComplete(Boolean isComplete) { - this.isComplete = isComplete; - return this; - } - - /** - * Whether or not the SignatureRequest has been fully executed by all signers. - * @return isComplete - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsComplete() { - return isComplete; - } - - - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsComplete(Boolean isComplete) { - this.isComplete = isComplete; - } - - - public BulkSendJobGetResponseSignatureRequests isDeclined(Boolean isDeclined) { - this.isDeclined = isDeclined; - return this; - } - - /** - * Whether or not the SignatureRequest has been declined by a signer. - * @return isDeclined - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsDeclined() { - return isDeclined; - } - - - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsDeclined(Boolean isDeclined) { - this.isDeclined = isDeclined; - } - - - public BulkSendJobGetResponseSignatureRequests hasError(Boolean hasError) { - this.hasError = 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 - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Default Label for account. + * + * @return originalTitle + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } - public Boolean getHasError() { - return hasError; - } - - - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasError(Boolean hasError) { - this.hasError = hasError; - } - - - public BulkSendJobGetResponseSignatureRequests filesUrl(String filesUrl) { - this.filesUrl = filesUrl; - return this; - } - - /** - * The URL where a copy of the request's documents can be downloaded. - * @return filesUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } - public String getFilesUrl() { - return filesUrl; - } - - - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilesUrl(String filesUrl) { - this.filesUrl = filesUrl; - } - - - public BulkSendJobGetResponseSignatureRequests signingUrl(String signingUrl) { - this.signingUrl = 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 - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BulkSendJobGetResponseSignatureRequests subject(String subject) { + this.subject = subject; + return this; + } - public String getSigningUrl() { - return signingUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningUrl(String signingUrl) { - this.signingUrl = signingUrl; - } - - - public BulkSendJobGetResponseSignatureRequests detailsUrl(String detailsUrl) { - this.detailsUrl = detailsUrl; - return this; - } - - /** - * The URL where the requester and the signers can view the current status of the SignatureRequest. - * @return detailsUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The subject in the email that was initially sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - public String getDetailsUrl() { - return detailsUrl; - } + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + public BulkSendJobGetResponseSignatureRequests message(String message) { + this.message = message; + return this; + } - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDetailsUrl(String detailsUrl) { - this.detailsUrl = detailsUrl; - } - - - public BulkSendJobGetResponseSignatureRequests ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); - } - this.ccEmailAddresses.add(ccEmailAddressesItem); - 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 - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - - public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want the signer redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public BulkSendJobGetResponseSignatureRequests finalCopyUri(String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - return this; - } - - /** - * The path where the completed document can be downloaded - * @return finalCopyUri - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFinalCopyUri() { - return finalCopyUri; - } - - - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFinalCopyUri(String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - } - - - public BulkSendJobGetResponseSignatureRequests templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + /** + * The custom message in the email that was initially sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } - public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Templates IDs used in this SignatureRequest (if any). - * @return templateIds - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getTemplateIds() { - return templateIds; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } - - - public BulkSendJobGetResponseSignatureRequests customFields(List customFields) { - this.customFields = customFields; - return this; - } - public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem(SignatureRequestResponseCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + public BulkSendJobGetResponseSignatureRequests metadata(Object metadata) { + this.metadata = metadata; + return this; } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } + /** + * The metadata attached to the signature request. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMetadata() { + return metadata; + } - public BulkSendJobGetResponseSignatureRequests attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public BulkSendJobGetResponseSignatureRequests addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * Signer attachments. - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + public BulkSendJobGetResponseSignatureRequests createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public BulkSendJobGetResponseSignatureRequests responseData(List responseData) { - this.responseData = responseData; - return this; - } - - public BulkSendJobGetResponseSignatureRequests addResponseDataItem(SignatureRequestResponseDataBase responseDataItem) { - if (this.responseData == null) { - this.responseData = new ArrayList<>(); - } - this.responseData.add(responseDataItem); - 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 - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getResponseData() { - return responseData; - } - - - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseData(List responseData) { - this.responseData = responseData; - } - - - public BulkSendJobGetResponseSignatureRequests signatures(List signatures) { - this.signatures = signatures; - return this; - } - - public BulkSendJobGetResponseSignatureRequests addSignaturesItem(SignatureRequestResponseSignatures signaturesItem) { - if (this.signatures == null) { - this.signatures = new ArrayList<>(); - } - this.signatures.add(signaturesItem); - return this; - } - - /** - * An array of signature objects, 1 for each signer. - * @return signatures - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignatures() { - return signatures; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatures(List signatures) { - this.signatures = signatures; - } - - - public BulkSendJobGetResponseSignatureRequests bulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; - } - - /** - * The id of the BulkSendJob. - * @return bulkSendJobId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBulkSendJobId() { - return bulkSendJobId; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - } - - - /** - * Return true if this BulkSendJobGetResponseSignatureRequests object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BulkSendJobGetResponseSignatureRequests bulkSendJobGetResponseSignatureRequests = (BulkSendJobGetResponseSignatureRequests) o; - return Objects.equals(this.testMode, bulkSendJobGetResponseSignatureRequests.testMode) && - Objects.equals(this.signatureRequestId, bulkSendJobGetResponseSignatureRequests.signatureRequestId) && - Objects.equals(this.requesterEmailAddress, bulkSendJobGetResponseSignatureRequests.requesterEmailAddress) && - Objects.equals(this.title, bulkSendJobGetResponseSignatureRequests.title) && - Objects.equals(this.originalTitle, bulkSendJobGetResponseSignatureRequests.originalTitle) && - Objects.equals(this.subject, bulkSendJobGetResponseSignatureRequests.subject) && - Objects.equals(this.message, bulkSendJobGetResponseSignatureRequests.message) && - Objects.equals(this.metadata, bulkSendJobGetResponseSignatureRequests.metadata) && - Objects.equals(this.createdAt, bulkSendJobGetResponseSignatureRequests.createdAt) && - Objects.equals(this.expiresAt, bulkSendJobGetResponseSignatureRequests.expiresAt) && - Objects.equals(this.isComplete, bulkSendJobGetResponseSignatureRequests.isComplete) && - Objects.equals(this.isDeclined, bulkSendJobGetResponseSignatureRequests.isDeclined) && - Objects.equals(this.hasError, bulkSendJobGetResponseSignatureRequests.hasError) && - Objects.equals(this.filesUrl, bulkSendJobGetResponseSignatureRequests.filesUrl) && - Objects.equals(this.signingUrl, bulkSendJobGetResponseSignatureRequests.signingUrl) && - Objects.equals(this.detailsUrl, bulkSendJobGetResponseSignatureRequests.detailsUrl) && - Objects.equals(this.ccEmailAddresses, bulkSendJobGetResponseSignatureRequests.ccEmailAddresses) && - Objects.equals(this.signingRedirectUrl, bulkSendJobGetResponseSignatureRequests.signingRedirectUrl) && - Objects.equals(this.finalCopyUri, bulkSendJobGetResponseSignatureRequests.finalCopyUri) && - Objects.equals(this.templateIds, bulkSendJobGetResponseSignatureRequests.templateIds) && - Objects.equals(this.customFields, bulkSendJobGetResponseSignatureRequests.customFields) && - Objects.equals(this.attachments, bulkSendJobGetResponseSignatureRequests.attachments) && - Objects.equals(this.responseData, bulkSendJobGetResponseSignatureRequests.responseData) && - Objects.equals(this.signatures, bulkSendJobGetResponseSignatureRequests.signatures) && - Objects.equals(this.bulkSendJobId, bulkSendJobGetResponseSignatureRequests.bulkSendJobId); - } - - @Override - public int hashCode() { - return Objects.hash(testMode, signatureRequestId, requesterEmailAddress, title, originalTitle, subject, message, metadata, createdAt, expiresAt, isComplete, isDeclined, hasError, filesUrl, signingUrl, detailsUrl, ccEmailAddresses, signingRedirectUrl, finalCopyUri, templateIds, customFields, attachments, responseData, signatures, bulkSendJobId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobGetResponseSignatureRequests {\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); - sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); - sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); - sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); - sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); - sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); - sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); - sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } + /** + * Time the signature request was created. + * + * @return createdAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCreatedAt() { + return createdAt; + } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; } - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - if (signatureRequestId.getClass().equals(java.io.File.class) || - signatureRequestId.getClass().equals(Integer.class) || - signatureRequestId.getClass().equals(String.class) || - signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for(int i = 0; i< getListSize(signatureRequestId); i++) { - map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); - } - } - else { - map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } + public BulkSendJobGetResponseSignatureRequests expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - if (requesterEmailAddress.getClass().equals(java.io.File.class) || - requesterEmailAddress.getClass().equals(Integer.class) || - requesterEmailAddress.getClass().equals(String.class) || - requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for(int i = 0; i< getListSize(requesterEmailAddress); i++) { - map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); - } - } - else { - map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; } - if (originalTitle != null) { - if (isFileTypeOrListOfFiles(originalTitle)) { - fileTypeFound = true; - } - if (originalTitle.getClass().equals(java.io.File.class) || - originalTitle.getClass().equals(Integer.class) || - originalTitle.getClass().equals(String.class) || - originalTitle.getClass().isEnum()) { - map.put("original_title", originalTitle); - } else if (isListOfFile(originalTitle)) { - for(int i = 0; i< getListSize(originalTitle); i++) { - map.put("original_title[" + i + "]", getFromList(originalTitle, i)); - } - } - else { - map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); - } + public BulkSendJobGetResponseSignatureRequests isComplete(Boolean isComplete) { + this.isComplete = isComplete; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + /** + * Whether or not the SignatureRequest has been fully executed by all signers. + * + * @return isComplete + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsComplete() { + return isComplete; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsComplete(Boolean isComplete) { + this.isComplete = isComplete; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + public BulkSendJobGetResponseSignatureRequests isDeclined(Boolean isDeclined) { + this.isDeclined = isDeclined; + return this; } - 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)); - } + /** + * Whether or not the SignatureRequest has been declined by a signer. + * + * @return isDeclined + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDeclined() { + return isDeclined; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeclined(Boolean isDeclined) { + this.isDeclined = isDeclined; } - if (isComplete != null) { - if (isFileTypeOrListOfFiles(isComplete)) { - fileTypeFound = true; - } - if (isComplete.getClass().equals(java.io.File.class) || - isComplete.getClass().equals(Integer.class) || - isComplete.getClass().equals(String.class) || - isComplete.getClass().isEnum()) { - map.put("is_complete", isComplete); - } else if (isListOfFile(isComplete)) { - for(int i = 0; i< getListSize(isComplete); i++) { - map.put("is_complete[" + i + "]", getFromList(isComplete, i)); - } - } - else { - map.put("is_complete", JSON.getDefault().getMapper().writeValueAsString(isComplete)); - } + public BulkSendJobGetResponseSignatureRequests hasError(Boolean hasError) { + this.hasError = hasError; + return this; } - if (isDeclined != null) { - if (isFileTypeOrListOfFiles(isDeclined)) { - fileTypeFound = true; - } - if (isDeclined.getClass().equals(java.io.File.class) || - isDeclined.getClass().equals(Integer.class) || - isDeclined.getClass().equals(String.class) || - isDeclined.getClass().isEnum()) { - map.put("is_declined", isDeclined); - } else if (isListOfFile(isDeclined)) { - for(int i = 0; i< getListSize(isDeclined); i++) { - map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); - } - } - else { - map.put("is_declined", JSON.getDefault().getMapper().writeValueAsString(isDeclined)); - } + /** + * Whether or not an error occurred (either during the creation of the SignatureRequest or + * during one of the signings). + * + * @return hasError + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasError() { + return hasError; } - if (hasError != null) { - if (isFileTypeOrListOfFiles(hasError)) { - fileTypeFound = true; - } - if (hasError.getClass().equals(java.io.File.class) || - hasError.getClass().equals(Integer.class) || - hasError.getClass().equals(String.class) || - hasError.getClass().isEnum()) { - map.put("has_error", hasError); - } else if (isListOfFile(hasError)) { - for(int i = 0; i< getListSize(hasError); i++) { - map.put("has_error[" + i + "]", getFromList(hasError, i)); - } - } - else { - map.put("has_error", JSON.getDefault().getMapper().writeValueAsString(hasError)); - } + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasError(Boolean hasError) { + this.hasError = hasError; } - if (filesUrl != null) { - if (isFileTypeOrListOfFiles(filesUrl)) { - fileTypeFound = true; - } - if (filesUrl.getClass().equals(java.io.File.class) || - filesUrl.getClass().equals(Integer.class) || - filesUrl.getClass().equals(String.class) || - filesUrl.getClass().isEnum()) { - map.put("files_url", filesUrl); - } else if (isListOfFile(filesUrl)) { - for(int i = 0; i< getListSize(filesUrl); i++) { - map.put("files_url[" + i + "]", getFromList(filesUrl, i)); - } - } - else { - map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); - } + public BulkSendJobGetResponseSignatureRequests filesUrl(String filesUrl) { + this.filesUrl = filesUrl; + return this; } - if (signingUrl != null) { - if (isFileTypeOrListOfFiles(signingUrl)) { - fileTypeFound = true; - } - if (signingUrl.getClass().equals(java.io.File.class) || - signingUrl.getClass().equals(Integer.class) || - signingUrl.getClass().equals(String.class) || - signingUrl.getClass().isEnum()) { - map.put("signing_url", signingUrl); - } else if (isListOfFile(signingUrl)) { - for(int i = 0; i< getListSize(signingUrl); i++) { - map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); - } - } - else { - map.put("signing_url", JSON.getDefault().getMapper().writeValueAsString(signingUrl)); - } + /** + * The URL where a copy of the request's documents can be downloaded. + * + * @return filesUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilesUrl() { + return filesUrl; } - if (detailsUrl != null) { - if (isFileTypeOrListOfFiles(detailsUrl)) { - fileTypeFound = true; - } - if (detailsUrl.getClass().equals(java.io.File.class) || - detailsUrl.getClass().equals(Integer.class) || - detailsUrl.getClass().equals(String.class) || - detailsUrl.getClass().isEnum()) { - map.put("details_url", detailsUrl); - } else if (isListOfFile(detailsUrl)) { - for(int i = 0; i< getListSize(detailsUrl); i++) { - map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); - } - } - else { - map.put("details_url", JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); - } + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } + public BulkSendJobGetResponseSignatureRequests signingUrl(String signingUrl) { + this.signingUrl = signingUrl; + return this; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningUrl() { + return signingUrl; } - if (finalCopyUri != null) { - if (isFileTypeOrListOfFiles(finalCopyUri)) { - fileTypeFound = true; - } - if (finalCopyUri.getClass().equals(java.io.File.class) || - finalCopyUri.getClass().equals(Integer.class) || - finalCopyUri.getClass().equals(String.class) || - finalCopyUri.getClass().isEnum()) { - map.put("final_copy_uri", finalCopyUri); - } else if (isListOfFile(finalCopyUri)) { - for(int i = 0; i< getListSize(finalCopyUri); i++) { - map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); - } - } - else { - map.put("final_copy_uri", JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); - } + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningUrl(String signingUrl) { + this.signingUrl = signingUrl; } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + public BulkSendJobGetResponseSignatureRequests detailsUrl(String detailsUrl) { + this.detailsUrl = detailsUrl; + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + /** + * The URL where the requester and the signers can view the current status of the + * SignatureRequest. + * + * @return detailsUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetailsUrl() { + return detailsUrl; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetailsUrl(String detailsUrl) { + this.detailsUrl = detailsUrl; } - if (responseData != null) { - if (isFileTypeOrListOfFiles(responseData)) { - fileTypeFound = true; - } - if (responseData.getClass().equals(java.io.File.class) || - responseData.getClass().equals(Integer.class) || - responseData.getClass().equals(String.class) || - responseData.getClass().isEnum()) { - map.put("response_data", responseData); - } else if (isListOfFile(responseData)) { - for(int i = 0; i< getListSize(responseData); i++) { - map.put("response_data[" + i + "]", getFromList(responseData, i)); - } - } - else { - map.put("response_data", JSON.getDefault().getMapper().writeValueAsString(responseData)); - } + public BulkSendJobGetResponseSignatureRequests ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - if (signatures != null) { - if (isFileTypeOrListOfFiles(signatures)) { - fileTypeFound = true; + + public BulkSendJobGetResponseSignatureRequests addCcEmailAddressesItem( + String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } - if (signatures.getClass().equals(java.io.File.class) || - signatures.getClass().equals(Integer.class) || - signatures.getClass().equals(String.class) || - signatures.getClass().isEnum()) { - map.put("signatures", signatures); - } else if (isListOfFile(signatures)) { - for(int i = 0; i< getListSize(signatures); i++) { - map.put("signatures[" + i + "]", getFromList(signatures, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + public BulkSendJobGetResponseSignatureRequests signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want the signer redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public BulkSendJobGetResponseSignatureRequests finalCopyUri(String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + return this; + } + + /** + * The path where the completed document can be downloaded + * + * @return finalCopyUri + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFinalCopyUri() { + return finalCopyUri; + } + + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinalCopyUri(String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + } + + public BulkSendJobGetResponseSignatureRequests templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); } - else { - map.put("signatures", JSON.getDefault().getMapper().writeValueAsString(signatures)); + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Templates IDs used in this SignatureRequest (if any). + * + * @return templateIds + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateIds() { + return templateIds; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + public BulkSendJobGetResponseSignatureRequests customFields( + List customFields) { + this.customFields = customFields; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addCustomFieldsItem( + SignatureRequestResponseCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public BulkSendJobGetResponseSignatureRequests attachments( + List attachments) { + this.attachments = attachments; + return this; } - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; + + public BulkSendJobGetResponseSignatureRequests addAttachmentsItem( + SignatureRequestResponseAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } + this.attachments.add(attachmentsItem); + return this; + } - if (bulkSendJobId.getClass().equals(java.io.File.class) || - bulkSendJobId.getClass().equals(Integer.class) || - bulkSendJobId.getClass().equals(String.class) || - bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for(int i = 0; i< getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } + /** + * Signer attachments. + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + public BulkSendJobGetResponseSignatureRequests responseData( + List responseData) { + this.responseData = responseData; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addResponseDataItem( + SignatureRequestResponseDataBase responseDataItem) { + if (this.responseData == null) { + this.responseData = new ArrayList<>(); } - else { - map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + this.responseData.add(responseDataItem); + 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 @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getResponseData() { + return responseData; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(List responseData) { + this.responseData = responseData; + } + + public BulkSendJobGetResponseSignatureRequests signatures( + List signatures) { + this.signatures = signatures; + return this; + } + + public BulkSendJobGetResponseSignatureRequests addSignaturesItem( + SignatureRequestResponseSignatures signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); } + this.signatures.add(signaturesItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * An array of signature objects, 1 for each signer. + * + * @return signatures + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignatures() { + return signatures; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatures(List signatures) { + this.signatures = signatures; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public BulkSendJobGetResponseSignatureRequests bulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * The id of the BulkSendJob. + * + * @return bulkSendJobId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBulkSendJobId() { + return bulkSendJobId; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + /** Return true if this BulkSendJobGetResponseSignatureRequests object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkSendJobGetResponseSignatureRequests bulkSendJobGetResponseSignatureRequests = + (BulkSendJobGetResponseSignatureRequests) o; + return Objects.equals(this.testMode, bulkSendJobGetResponseSignatureRequests.testMode) + && Objects.equals( + this.signatureRequestId, + bulkSendJobGetResponseSignatureRequests.signatureRequestId) + && Objects.equals( + this.requesterEmailAddress, + bulkSendJobGetResponseSignatureRequests.requesterEmailAddress) + && Objects.equals(this.title, bulkSendJobGetResponseSignatureRequests.title) + && Objects.equals( + this.originalTitle, bulkSendJobGetResponseSignatureRequests.originalTitle) + && Objects.equals(this.subject, bulkSendJobGetResponseSignatureRequests.subject) + && Objects.equals(this.message, bulkSendJobGetResponseSignatureRequests.message) + && Objects.equals(this.metadata, bulkSendJobGetResponseSignatureRequests.metadata) + && Objects.equals(this.createdAt, bulkSendJobGetResponseSignatureRequests.createdAt) + && Objects.equals(this.expiresAt, bulkSendJobGetResponseSignatureRequests.expiresAt) + && Objects.equals( + this.isComplete, bulkSendJobGetResponseSignatureRequests.isComplete) + && Objects.equals( + this.isDeclined, bulkSendJobGetResponseSignatureRequests.isDeclined) + && Objects.equals(this.hasError, bulkSendJobGetResponseSignatureRequests.hasError) + && Objects.equals(this.filesUrl, bulkSendJobGetResponseSignatureRequests.filesUrl) + && Objects.equals( + this.signingUrl, bulkSendJobGetResponseSignatureRequests.signingUrl) + && Objects.equals( + this.detailsUrl, bulkSendJobGetResponseSignatureRequests.detailsUrl) + && Objects.equals( + this.ccEmailAddresses, + bulkSendJobGetResponseSignatureRequests.ccEmailAddresses) + && Objects.equals( + this.signingRedirectUrl, + bulkSendJobGetResponseSignatureRequests.signingRedirectUrl) + && Objects.equals( + this.finalCopyUri, bulkSendJobGetResponseSignatureRequests.finalCopyUri) + && Objects.equals( + this.templateIds, bulkSendJobGetResponseSignatureRequests.templateIds) + && Objects.equals( + this.customFields, bulkSendJobGetResponseSignatureRequests.customFields) + && Objects.equals( + this.attachments, bulkSendJobGetResponseSignatureRequests.attachments) + && Objects.equals( + this.responseData, bulkSendJobGetResponseSignatureRequests.responseData) + && Objects.equals( + this.signatures, bulkSendJobGetResponseSignatureRequests.signatures) + && Objects.equals( + this.bulkSendJobId, bulkSendJobGetResponseSignatureRequests.bulkSendJobId); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + @Override + public int hashCode() { + return Objects.hash( + testMode, + signatureRequestId, + requesterEmailAddress, + title, + originalTitle, + subject, + message, + metadata, + createdAt, + expiresAt, + isComplete, + isDeclined, + hasError, + filesUrl, + signingUrl, + detailsUrl, + ccEmailAddresses, + signingRedirectUrl, + finalCopyUri, + templateIds, + customFields, + attachments, + responseData, + signatures, + bulkSendJobId); + } - /** - * 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"; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobGetResponseSignatureRequests {\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" signatureRequestId: ") + .append(toIndentedString(signatureRequestId)) + .append("\n"); + sb.append(" requesterEmailAddress: ") + .append(toIndentedString(requesterEmailAddress)) + .append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); + sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); + sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); + sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); + sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } -} + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } + + if (signatureRequestId.getClass().equals(java.io.File.class) + || signatureRequestId.getClass().equals(Integer.class) + || signatureRequestId.getClass().equals(String.class) + || signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for (int i = 0; i < getListSize(signatureRequestId); i++) { + map.put( + "signature_request_id[" + i + "]", + getFromList(signatureRequestId, i)); + } + } else { + map.put( + "signature_request_id", + JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); + } + } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } + + if (requesterEmailAddress.getClass().equals(java.io.File.class) + || requesterEmailAddress.getClass().equals(Integer.class) + || requesterEmailAddress.getClass().equals(String.class) + || requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for (int i = 0; i < getListSize(requesterEmailAddress); i++) { + map.put( + "requester_email_address[" + i + "]", + getFromList(requesterEmailAddress, i)); + } + } else { + map.put( + "requester_email_address", + JSON.getDefault() + .getMapper() + .writeValueAsString(requesterEmailAddress)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } + + if (originalTitle.getClass().equals(java.io.File.class) + || originalTitle.getClass().equals(Integer.class) + || originalTitle.getClass().equals(String.class) + || originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for (int i = 0; i < getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } else { + map.put( + "original_title", + JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } + + if (createdAt.getClass().equals(java.io.File.class) + || createdAt.getClass().equals(Integer.class) + || createdAt.getClass().equals(String.class) + || createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for (int i = 0; i < getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } else { + map.put( + "created_at", + JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + if (isComplete != null) { + if (isFileTypeOrListOfFiles(isComplete)) { + fileTypeFound = true; + } + + if (isComplete.getClass().equals(java.io.File.class) + || isComplete.getClass().equals(Integer.class) + || isComplete.getClass().equals(String.class) + || isComplete.getClass().isEnum()) { + map.put("is_complete", isComplete); + } else if (isListOfFile(isComplete)) { + for (int i = 0; i < getListSize(isComplete); i++) { + map.put("is_complete[" + i + "]", getFromList(isComplete, i)); + } + } else { + map.put( + "is_complete", + JSON.getDefault().getMapper().writeValueAsString(isComplete)); + } + } + if (isDeclined != null) { + if (isFileTypeOrListOfFiles(isDeclined)) { + fileTypeFound = true; + } + + if (isDeclined.getClass().equals(java.io.File.class) + || isDeclined.getClass().equals(Integer.class) + || isDeclined.getClass().equals(String.class) + || isDeclined.getClass().isEnum()) { + map.put("is_declined", isDeclined); + } else if (isListOfFile(isDeclined)) { + for (int i = 0; i < getListSize(isDeclined); i++) { + map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); + } + } else { + map.put( + "is_declined", + JSON.getDefault().getMapper().writeValueAsString(isDeclined)); + } + } + if (hasError != null) { + if (isFileTypeOrListOfFiles(hasError)) { + fileTypeFound = true; + } + + if (hasError.getClass().equals(java.io.File.class) + || hasError.getClass().equals(Integer.class) + || hasError.getClass().equals(String.class) + || hasError.getClass().isEnum()) { + map.put("has_error", hasError); + } else if (isListOfFile(hasError)) { + for (int i = 0; i < getListSize(hasError); i++) { + map.put("has_error[" + i + "]", getFromList(hasError, i)); + } + } else { + map.put( + "has_error", + JSON.getDefault().getMapper().writeValueAsString(hasError)); + } + } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } + + if (filesUrl.getClass().equals(java.io.File.class) + || filesUrl.getClass().equals(Integer.class) + || filesUrl.getClass().equals(String.class) + || filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for (int i = 0; i < getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } else { + map.put( + "files_url", + JSON.getDefault().getMapper().writeValueAsString(filesUrl)); + } + } + if (signingUrl != null) { + if (isFileTypeOrListOfFiles(signingUrl)) { + fileTypeFound = true; + } + + if (signingUrl.getClass().equals(java.io.File.class) + || signingUrl.getClass().equals(Integer.class) + || signingUrl.getClass().equals(String.class) + || signingUrl.getClass().isEnum()) { + map.put("signing_url", signingUrl); + } else if (isListOfFile(signingUrl)) { + for (int i = 0; i < getListSize(signingUrl); i++) { + map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); + } + } else { + map.put( + "signing_url", + JSON.getDefault().getMapper().writeValueAsString(signingUrl)); + } + } + if (detailsUrl != null) { + if (isFileTypeOrListOfFiles(detailsUrl)) { + fileTypeFound = true; + } + + if (detailsUrl.getClass().equals(java.io.File.class) + || detailsUrl.getClass().equals(Integer.class) + || detailsUrl.getClass().equals(String.class) + || detailsUrl.getClass().isEnum()) { + map.put("details_url", detailsUrl); + } else if (isListOfFile(detailsUrl)) { + for (int i = 0; i < getListSize(detailsUrl); i++) { + map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); + } + } else { + map.put( + "details_url", + JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (finalCopyUri != null) { + if (isFileTypeOrListOfFiles(finalCopyUri)) { + fileTypeFound = true; + } + + if (finalCopyUri.getClass().equals(java.io.File.class) + || finalCopyUri.getClass().equals(Integer.class) + || finalCopyUri.getClass().equals(String.class) + || finalCopyUri.getClass().isEnum()) { + map.put("final_copy_uri", finalCopyUri); + } else if (isListOfFile(finalCopyUri)) { + for (int i = 0; i < getListSize(finalCopyUri); i++) { + map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); + } + } else { + map.put( + "final_copy_uri", + JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); + } + } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (responseData != null) { + if (isFileTypeOrListOfFiles(responseData)) { + fileTypeFound = true; + } + + if (responseData.getClass().equals(java.io.File.class) + || responseData.getClass().equals(Integer.class) + || responseData.getClass().equals(String.class) + || responseData.getClass().isEnum()) { + map.put("response_data", responseData); + } else if (isListOfFile(responseData)) { + for (int i = 0; i < getListSize(responseData); i++) { + map.put("response_data[" + i + "]", getFromList(responseData, i)); + } + } else { + map.put( + "response_data", + JSON.getDefault().getMapper().writeValueAsString(responseData)); + } + } + if (signatures != null) { + if (isFileTypeOrListOfFiles(signatures)) { + fileTypeFound = true; + } + + if (signatures.getClass().equals(java.io.File.class) + || signatures.getClass().equals(Integer.class) + || signatures.getClass().equals(String.class) + || signatures.getClass().isEnum()) { + map.put("signatures", signatures); + } else if (isListOfFile(signatures)) { + for (int i = 0; i < getListSize(signatures); i++) { + map.put("signatures[" + i + "]", getFromList(signatures, i)); + } + } else { + map.put( + "signatures", + JSON.getDefault().getMapper().writeValueAsString(signatures)); + } + } + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } + + if (bulkSendJobId.getClass().equals(java.io.File.class) + || bulkSendJobId.getClass().equals(Integer.class) + || bulkSendJobId.getClass().equals(String.class) + || bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for (int i = 0; i < getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } else { + map.put( + "bulk_send_job_id", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } + } + } 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/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java index 0e97384..3f4c641 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobListResponse.java @@ -10,290 +10,275 @@ * 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.BulkSendJobResponse; -import com.dropbox.sign.model.ListInfoResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * BulkSendJobListResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class BulkSendJobListResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; - 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 = null; - - public BulkSendJobListResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public BulkSendJobListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobListResponse.class); - } - - static public BulkSendJobListResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobListResponse.class - ); - } - - public BulkSendJobListResponse bulkSendJobs(List bulkSendJobs) { - this.bulkSendJobs = bulkSendJobs; - return this; - } - - public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJobsItem) { - if (this.bulkSendJobs == null) { - this.bulkSendJobs = new ArrayList<>(); - } - this.bulkSendJobs.add(bulkSendJobsItem); - return this; - } - - /** - * Contains a list of BulkSendJobs that the API caller has access to. - * @return bulkSendJobs - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getBulkSendJobs() { - return bulkSendJobs; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJobs(List bulkSendJobs) { - this.bulkSendJobs = bulkSendJobs; - } - - - public BulkSendJobListResponse 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 BulkSendJobListResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_BULK_SEND_JOBS = "bulk_send_jobs"; + 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 = null; + + public BulkSendJobListResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static BulkSendJobListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobListResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this BulkSendJobListResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static BulkSendJobListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), BulkSendJobListResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public BulkSendJobListResponse bulkSendJobs(List bulkSendJobs) { + this.bulkSendJobs = bulkSendJobs; + return this; } - BulkSendJobListResponse bulkSendJobListResponse = (BulkSendJobListResponse) o; - return Objects.equals(this.bulkSendJobs, bulkSendJobListResponse.bulkSendJobs) && - Objects.equals(this.listInfo, bulkSendJobListResponse.listInfo) && - Objects.equals(this.warnings, bulkSendJobListResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(bulkSendJobs, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobListResponse {\n"); - sb.append(" bulkSendJobs: ").append(toIndentedString(bulkSendJobs)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (bulkSendJobs != null) { - if (isFileTypeOrListOfFiles(bulkSendJobs)) { - fileTypeFound = true; - } - if (bulkSendJobs.getClass().equals(java.io.File.class) || - bulkSendJobs.getClass().equals(Integer.class) || - bulkSendJobs.getClass().equals(String.class) || - bulkSendJobs.getClass().isEnum()) { - map.put("bulk_send_jobs", bulkSendJobs); - } else if (isListOfFile(bulkSendJobs)) { - for(int i = 0; i< getListSize(bulkSendJobs); i++) { - map.put("bulk_send_jobs[" + i + "]", getFromList(bulkSendJobs, i)); - } - } - else { - map.put("bulk_send_jobs", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobs)); + public BulkSendJobListResponse addBulkSendJobsItem(BulkSendJobResponse bulkSendJobsItem) { + if (this.bulkSendJobs == null) { + this.bulkSendJobs = new ArrayList<>(); } + this.bulkSendJobs.add(bulkSendJobsItem); + return this; } - 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)); - } + /** + * Contains a list of BulkSendJobs that the API caller has access to. + * + * @return bulkSendJobs + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getBulkSendJobs() { + return bulkSendJobs; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOBS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJobs(List bulkSendJobs) { + this.bulkSendJobs = bulkSendJobs; + } + + public BulkSendJobListResponse 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 BulkSendJobListResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public BulkSendJobListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this BulkSendJobListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + BulkSendJobListResponse bulkSendJobListResponse = (BulkSendJobListResponse) o; + return Objects.equals(this.bulkSendJobs, bulkSendJobListResponse.bulkSendJobs) + && Objects.equals(this.listInfo, bulkSendJobListResponse.listInfo) + && Objects.equals(this.warnings, bulkSendJobListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(bulkSendJobs, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobListResponse {\n"); + sb.append(" bulkSendJobs: ").append(toIndentedString(bulkSendJobs)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJobs != null) { + if (isFileTypeOrListOfFiles(bulkSendJobs)) { + fileTypeFound = true; + } + + if (bulkSendJobs.getClass().equals(java.io.File.class) + || bulkSendJobs.getClass().equals(Integer.class) + || bulkSendJobs.getClass().equals(String.class) + || bulkSendJobs.getClass().isEnum()) { + map.put("bulk_send_jobs", bulkSendJobs); + } else if (isListOfFile(bulkSendJobs)) { + for (int i = 0; i < getListSize(bulkSendJobs); i++) { + map.put("bulk_send_jobs[" + i + "]", getFromList(bulkSendJobs, i)); + } + } else { + map.put( + "bulk_send_jobs", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJobs)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java index 613a269..bc366fd 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobResponse.java @@ -10,319 +10,306 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; /** - * Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class BulkSendJobResponse { - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - private String bulkSendJobId; - - public static final String JSON_PROPERTY_TOTAL = "total"; - private Integer total; - - public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; - private Boolean isCreator; - - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - private Integer createdAt; - - public BulkSendJobResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public BulkSendJobResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobResponse.class); - } - - static public BulkSendJobResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobResponse.class - ); - } - - public BulkSendJobResponse bulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; - } - - /** - * The id of the BulkSendJob. - * @return bulkSendJobId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBulkSendJobId() { - return bulkSendJobId; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - } - - - public BulkSendJobResponse total(Integer total) { - this.total = total; - return this; - } - - /** - * The total amount of Signature Requests queued for sending. - * @return total - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getTotal() { - return total; - } - - - @JsonProperty(JSON_PROPERTY_TOTAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTotal(Integer total) { - this.total = total; - } - - - public BulkSendJobResponse isCreator(Boolean isCreator) { - this.isCreator = 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 - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsCreator() { - return isCreator; - } - - - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsCreator(Boolean isCreator) { - this.isCreator = isCreator; - } - - - public BulkSendJobResponse createdAt(Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Time that the BulkSendJob was created. - * @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; - } - - - /** - * Return true if this BulkSendJobResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + private String bulkSendJobId; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Integer total; + + public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; + private Boolean isCreator; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; + + public BulkSendJobResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static BulkSendJobResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static BulkSendJobResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), BulkSendJobResponse.class); } - BulkSendJobResponse bulkSendJobResponse = (BulkSendJobResponse) o; - return Objects.equals(this.bulkSendJobId, bulkSendJobResponse.bulkSendJobId) && - Objects.equals(this.total, bulkSendJobResponse.total) && - Objects.equals(this.isCreator, bulkSendJobResponse.isCreator) && - Objects.equals(this.createdAt, bulkSendJobResponse.createdAt); - } - - @Override - public int hashCode() { - return Objects.hash(bulkSendJobId, total, isCreator, createdAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobResponse {\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append(" total: ").append(toIndentedString(total)).append("\n"); - sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; - } - if (bulkSendJobId.getClass().equals(java.io.File.class) || - bulkSendJobId.getClass().equals(Integer.class) || - bulkSendJobId.getClass().equals(String.class) || - bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for(int i = 0; i< getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } - } - else { - map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); - } + public BulkSendJobResponse bulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; } - if (total != null) { - if (isFileTypeOrListOfFiles(total)) { - fileTypeFound = true; - } - if (total.getClass().equals(java.io.File.class) || - total.getClass().equals(Integer.class) || - total.getClass().equals(String.class) || - total.getClass().isEnum()) { - map.put("total", total); - } else if (isListOfFile(total)) { - for(int i = 0; i< getListSize(total); i++) { - map.put("total[" + i + "]", getFromList(total, i)); - } - } - else { - map.put("total", JSON.getDefault().getMapper().writeValueAsString(total)); - } + /** + * The id of the BulkSendJob. + * + * @return bulkSendJobId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBulkSendJobId() { + return bulkSendJobId; } - if (isCreator != null) { - if (isFileTypeOrListOfFiles(isCreator)) { - fileTypeFound = true; - } - if (isCreator.getClass().equals(java.io.File.class) || - isCreator.getClass().equals(Integer.class) || - isCreator.getClass().equals(String.class) || - isCreator.getClass().isEnum()) { - map.put("is_creator", isCreator); - } else if (isListOfFile(isCreator)) { - for(int i = 0; i< getListSize(isCreator); i++) { - map.put("is_creator[" + i + "]", getFromList(isCreator, i)); - } - } - else { - map.put("is_creator", JSON.getDefault().getMapper().writeValueAsString(isCreator)); - } + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; } - 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)); - } + public BulkSendJobResponse total(Integer total) { + this.total = total; + return this; + } + + /** + * The total amount of Signature Requests queued for sending. + * + * @return total + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTotal() { + return total; + } + + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotal(Integer total) { + this.total = total; + } + + public BulkSendJobResponse isCreator(Boolean isCreator) { + this.isCreator = 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 @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsCreator() { + return isCreator; + } + + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCreator(Boolean isCreator) { + this.isCreator = isCreator; + } + + public BulkSendJobResponse createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time that the BulkSendJob was created. + * + * @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; + } + + /** Return true if this BulkSendJobResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("created_at", JSON.getDefault().getMapper().writeValueAsString(createdAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + BulkSendJobResponse bulkSendJobResponse = (BulkSendJobResponse) o; + return Objects.equals(this.bulkSendJobId, bulkSendJobResponse.bulkSendJobId) + && Objects.equals(this.total, bulkSendJobResponse.total) + && Objects.equals(this.isCreator, bulkSendJobResponse.isCreator) + && Objects.equals(this.createdAt, bulkSendJobResponse.createdAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(bulkSendJobId, total, isCreator, createdAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobResponse {\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } + + if (bulkSendJobId.getClass().equals(java.io.File.class) + || bulkSendJobId.getClass().equals(Integer.class) + || bulkSendJobId.getClass().equals(String.class) + || bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for (int i = 0; i < getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } else { + map.put( + "bulk_send_job_id", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } + } + if (total != null) { + if (isFileTypeOrListOfFiles(total)) { + fileTypeFound = true; + } + + if (total.getClass().equals(java.io.File.class) + || total.getClass().equals(Integer.class) + || total.getClass().equals(String.class) + || total.getClass().isEnum()) { + map.put("total", total); + } else if (isListOfFile(total)) { + for (int i = 0; i < getListSize(total); i++) { + map.put("total[" + i + "]", getFromList(total, i)); + } + } else { + map.put("total", JSON.getDefault().getMapper().writeValueAsString(total)); + } + } + if (isCreator != null) { + if (isFileTypeOrListOfFiles(isCreator)) { + fileTypeFound = true; + } + + if (isCreator.getClass().equals(java.io.File.class) + || isCreator.getClass().equals(Integer.class) + || isCreator.getClass().equals(String.class) + || isCreator.getClass().isEnum()) { + map.put("is_creator", isCreator); + } else if (isListOfFile(isCreator)) { + for (int i = 0; i < getListSize(isCreator); i++) { + map.put("is_creator[" + i + "]", getFromList(isCreator, i)); + } + } else { + map.put( + "is_creator", + JSON.getDefault().getMapper().writeValueAsString(isCreator)); + } + } + 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)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java b/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java index 400e70c..38e273f 100644 --- a/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java +++ b/src/main/java/com/dropbox/sign/model/BulkSendJobSendResponse.java @@ -10,231 +10,218 @@ * 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.BulkSendJobResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * BulkSendJobSendResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public BulkSendJobSendResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public BulkSendJobSendResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, BulkSendJobSendResponse.class); - } - - static public BulkSendJobSendResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - BulkSendJobSendResponse.class - ); - } - - public BulkSendJobSendResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - return this; - } - - /** - * Get bulkSendJob - * @return bulkSendJob - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BulkSendJobResponse getBulkSendJob() { - return bulkSendJob; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { - this.bulkSendJob = bulkSendJob; - } - - - public BulkSendJobSendResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this BulkSendJobSendResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BulkSendJobSendResponse bulkSendJobSendResponse = (BulkSendJobSendResponse) o; - return Objects.equals(this.bulkSendJob, bulkSendJobSendResponse.bulkSendJob) && - Objects.equals(this.warnings, bulkSendJobSendResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(bulkSendJob, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BulkSendJobSendResponse {\n"); - sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).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 (bulkSendJob != null) { - if (isFileTypeOrListOfFiles(bulkSendJob)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_BULK_SEND_JOB = "bulk_send_job"; + private BulkSendJobResponse bulkSendJob; - if (bulkSendJob.getClass().equals(java.io.File.class) || - bulkSendJob.getClass().equals(Integer.class) || - bulkSendJob.getClass().equals(String.class) || - bulkSendJob.getClass().isEnum()) { - map.put("bulk_send_job", bulkSendJob); - } else if (isListOfFile(bulkSendJob)) { - for(int i = 0; i< getListSize(bulkSendJob); i++) { - map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); - } - } - else { - map.put("bulk_send_job", JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public BulkSendJobSendResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static BulkSendJobSendResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, BulkSendJobSendResponse.class); + } + + public static BulkSendJobSendResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), BulkSendJobSendResponse.class); + } + + public BulkSendJobSendResponse bulkSendJob(BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + return this; + } + + /** + * Get bulkSendJob + * + * @return bulkSendJob + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BulkSendJobResponse getBulkSendJob() { + return bulkSendJob; + } + + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBulkSendJob(BulkSendJobResponse bulkSendJob) { + this.bulkSendJob = bulkSendJob; + } + + public BulkSendJobSendResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public BulkSendJobSendResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this BulkSendJobSendResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + BulkSendJobSendResponse bulkSendJobSendResponse = (BulkSendJobSendResponse) o; + return Objects.equals(this.bulkSendJob, bulkSendJobSendResponse.bulkSendJob) + && Objects.equals(this.warnings, bulkSendJobSendResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(bulkSendJob, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkSendJobSendResponse {\n"); + sb.append(" bulkSendJob: ").append(toIndentedString(bulkSendJob)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (bulkSendJob != null) { + if (isFileTypeOrListOfFiles(bulkSendJob)) { + fileTypeFound = true; + } + + if (bulkSendJob.getClass().equals(java.io.File.class) + || bulkSendJob.getClass().equals(Integer.class) + || bulkSendJob.getClass().equals(String.class) + || bulkSendJob.getClass().isEnum()) { + map.put("bulk_send_job", bulkSendJob); + } else if (isListOfFile(bulkSendJob)) { + for (int i = 0; i < getListSize(bulkSendJob); i++) { + map.put("bulk_send_job[" + i + "]", getFromList(bulkSendJob, i)); + } + } else { + map.put( + "bulk_send_job", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJob)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java index 4ae0413..1494bf4 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlRequest.java @@ -10,639 +10,637 @@ * 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.SubEditorOptions; -import com.dropbox.sign.model.SubMergeField; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * EmbeddedEditUrlRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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_ALLOW_EDIT_CCS = "allow_edit_ccs"; + private Boolean allowEditCcs = false; + + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + private List ccRoles = null; - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles = null; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + private SubEditorOptions editorOptions; - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - private SubEditorOptions editorOptions; + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + private Boolean forceSignerRoles = false; - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - private Boolean forceSignerRoles = false; + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + private Boolean forceSubjectMessage = false; - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - private Boolean forceSubjectMessage = false; + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + private List mergeFields = null; - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields = null; - - public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; - private Boolean previewOnly = false; - - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - private Boolean showPreview = false; + public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; + private Boolean previewOnly = false; - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + private Boolean showPreview = false; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + private Boolean showProgressStepper = true; - public EmbeddedEditUrlRequest() { - } + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EmbeddedEditUrlRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlRequest.class); - } - - static public EmbeddedEditUrlRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedEditUrlRequest.class - ); - } - - public EmbeddedEditUrlRequest allowEditCcs(Boolean allowEditCcs) { - this.allowEditCcs = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EmbeddedEditUrlRequest() {} - public Boolean getAllowEditCcs() { - return allowEditCcs; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditCcs(Boolean allowEditCcs) { - this.allowEditCcs = allowEditCcs; - } - - - public EmbeddedEditUrlRequest ccRoles(List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EmbeddedEditUrlRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlRequest.class); } - this.ccRoles.add(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 - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public static EmbeddedEditUrlRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), EmbeddedEditUrlRequest.class); + } - public List getCcRoles() { - return ccRoles; - } - - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(List ccRoles) { - this.ccRoles = ccRoles; - } - - - public EmbeddedEditUrlRequest editorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * @return editorOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - - public EmbeddedEditUrlRequest forceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * @return forceSignerRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } - - - public EmbeddedEditUrlRequest forceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * @return forceSubjectMessage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - - public EmbeddedEditUrlRequest mergeFields(List mergeFields) { - this.mergeFields = mergeFields; - return this; - } - - public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); - } - this.mergeFields.add(mergeFieldsItem); - return this; - } + public EmbeddedEditUrlRequest allowEditCcs(Boolean allowEditCcs) { + this.allowEditCcs = allowEditCcs; + 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 - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getMergeFields() { - return mergeFields; - } - - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(List mergeFields) { - this.mergeFields = mergeFields; - } - - - public EmbeddedEditUrlRequest previewOnly(Boolean previewOnly) { - this.previewOnly = 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 - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPreviewOnly() { - return previewOnly; - } - - - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPreviewOnly(Boolean previewOnly) { - this.previewOnly = previewOnly; - } - - - public EmbeddedEditUrlRequest showPreview(Boolean showPreview) { - this.showPreview = showPreview; - return this; - } - - /** - * This allows the requester to enable the editor/preview experience. - * @return showPreview - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowPreview() { - return showPreview; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(Boolean showPreview) { - this.showPreview = showPreview; - } - - - public EmbeddedEditUrlRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public EmbeddedEditUrlRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - /** - * Return true if this EmbeddedEditUrlRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedEditUrlRequest embeddedEditUrlRequest = (EmbeddedEditUrlRequest) o; - return Objects.equals(this.allowEditCcs, embeddedEditUrlRequest.allowEditCcs) && - Objects.equals(this.ccRoles, embeddedEditUrlRequest.ccRoles) && - Objects.equals(this.editorOptions, embeddedEditUrlRequest.editorOptions) && - Objects.equals(this.forceSignerRoles, embeddedEditUrlRequest.forceSignerRoles) && - Objects.equals(this.forceSubjectMessage, embeddedEditUrlRequest.forceSubjectMessage) && - Objects.equals(this.mergeFields, embeddedEditUrlRequest.mergeFields) && - Objects.equals(this.previewOnly, embeddedEditUrlRequest.previewOnly) && - Objects.equals(this.showPreview, embeddedEditUrlRequest.showPreview) && - Objects.equals(this.showProgressStepper, embeddedEditUrlRequest.showProgressStepper) && - Objects.equals(this.testMode, embeddedEditUrlRequest.testMode); - } - - @Override - public int hashCode() { - return Objects.hash(allowEditCcs, ccRoles, editorOptions, forceSignerRoles, forceSubjectMessage, mergeFields, previewOnly, showPreview, showProgressStepper, testMode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlRequest {\n"); - sb.append(" allowEditCcs: ").append(toIndentedString(allowEditCcs)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (allowEditCcs != null) { - if (isFileTypeOrListOfFiles(allowEditCcs)) { - fileTypeFound = true; - } + /** + * This allows the requester to enable/disable to add or change CC roles when editing the + * template. + * + * @return allowEditCcs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowEditCcs() { + return allowEditCcs; + } - if (allowEditCcs.getClass().equals(java.io.File.class) || - allowEditCcs.getClass().equals(Integer.class) || - allowEditCcs.getClass().equals(String.class) || - allowEditCcs.getClass().isEnum()) { - map.put("allow_edit_ccs", allowEditCcs); - } else if (isListOfFile(allowEditCcs)) { - for(int i = 0; i< getListSize(allowEditCcs); i++) { - map.put("allow_edit_ccs[" + i + "]", getFromList(allowEditCcs, i)); - } - } - else { - map.put("allow_edit_ccs", JSON.getDefault().getMapper().writeValueAsString(allowEditCcs)); - } + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditCcs(Boolean allowEditCcs) { + this.allowEditCcs = allowEditCcs; } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - if (ccRoles.getClass().equals(java.io.File.class) || - ccRoles.getClass().equals(Integer.class) || - ccRoles.getClass().equals(String.class) || - ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for(int i = 0; i< getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } - else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } + public EmbeddedEditUrlRequest ccRoles(List ccRoles) { + this.ccRoles = ccRoles; + return this; } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - if (editorOptions.getClass().equals(java.io.File.class) || - editorOptions.getClass().equals(Integer.class) || - editorOptions.getClass().equals(String.class) || - editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for(int i = 0; i< getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } - else { - map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + public EmbeddedEditUrlRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } + this.ccRoles.add(ccRolesItem); + return this; } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - if (forceSignerRoles.getClass().equals(java.io.File.class) || - forceSignerRoles.getClass().equals(Integer.class) || - forceSignerRoles.getClass().equals(String.class) || - forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for(int i = 0; i< getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } - else { - map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcRoles() { + return ccRoles; } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - if (forceSubjectMessage.getClass().equals(java.io.File.class) || - forceSubjectMessage.getClass().equals(Integer.class) || - forceSubjectMessage.getClass().equals(String.class) || - forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for(int i = 0; i< getListSize(forceSubjectMessage); i++) { - map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); - } - } - else { - map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(List ccRoles) { + this.ccRoles = ccRoles; } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - if (mergeFields.getClass().equals(java.io.File.class) || - mergeFields.getClass().equals(Integer.class) || - mergeFields.getClass().equals(String.class) || - mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for(int i = 0; i< getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } - else { - map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } + public EmbeddedEditUrlRequest editorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; } - if (previewOnly != null) { - if (isFileTypeOrListOfFiles(previewOnly)) { - fileTypeFound = true; - } - if (previewOnly.getClass().equals(java.io.File.class) || - previewOnly.getClass().equals(Integer.class) || - previewOnly.getClass().equals(String.class) || - previewOnly.getClass().isEnum()) { - map.put("preview_only", previewOnly); - } else if (isListOfFile(previewOnly)) { - for(int i = 0; i< getListSize(previewOnly); i++) { - map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); - } - } - else { - map.put("preview_only", JSON.getDefault().getMapper().writeValueAsString(previewOnly)); - } + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorOptions getEditorOptions() { + return editorOptions; } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - if (showPreview.getClass().equals(java.io.File.class) || - showPreview.getClass().equals(Integer.class) || - showPreview.getClass().equals(String.class) || - showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for(int i = 0; i< getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } - else { - map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } + public EmbeddedEditUrlRequest forceSignerRoles(Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; + } + + /** + * Provide users the ability to review/edit the template signer roles. + * + * @return forceSignerRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSignerRoles() { + return forceSignerRoles; + } + + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; + + public EmbeddedEditUrlRequest forceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; + } + + /** + * Provide users the ability to review/edit the template subject and message. + * + * @return forceSubjectMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; + } + + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + } + + public EmbeddedEditUrlRequest mergeFields(List mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + public EmbeddedEditUrlRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); } + this.mergeFields.add(mergeFieldsItem); + return this; + } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMergeFields() { + return mergeFields; + } + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(List mergeFields) { + this.mergeFields = mergeFields; + } + + public EmbeddedEditUrlRequest previewOnly(Boolean previewOnly) { + this.previewOnly = 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 @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPreviewOnly() { + return previewOnly; + } + + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewOnly(Boolean previewOnly) { + this.previewOnly = previewOnly; + } + + public EmbeddedEditUrlRequest showPreview(Boolean showPreview) { + this.showPreview = showPreview; + return this; + } + + /** + * This allows the requester to enable the editor/preview experience. + * + * @return showPreview + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowPreview() { + return showPreview; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(Boolean showPreview) { + this.showPreview = showPreview; + } + + public EmbeddedEditUrlRequest showProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public EmbeddedEditUrlRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + /** Return true if this EmbeddedEditUrlRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + if (o == null || getClass() != o.getClass()) { + return false; } + EmbeddedEditUrlRequest embeddedEditUrlRequest = (EmbeddedEditUrlRequest) o; + return Objects.equals(this.allowEditCcs, embeddedEditUrlRequest.allowEditCcs) + && Objects.equals(this.ccRoles, embeddedEditUrlRequest.ccRoles) + && Objects.equals(this.editorOptions, embeddedEditUrlRequest.editorOptions) + && Objects.equals(this.forceSignerRoles, embeddedEditUrlRequest.forceSignerRoles) + && Objects.equals( + this.forceSubjectMessage, embeddedEditUrlRequest.forceSubjectMessage) + && Objects.equals(this.mergeFields, embeddedEditUrlRequest.mergeFields) + && Objects.equals(this.previewOnly, embeddedEditUrlRequest.previewOnly) + && Objects.equals(this.showPreview, embeddedEditUrlRequest.showPreview) + && Objects.equals( + this.showProgressStepper, embeddedEditUrlRequest.showProgressStepper) + && Objects.equals(this.testMode, embeddedEditUrlRequest.testMode); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + allowEditCcs, + ccRoles, + editorOptions, + forceSignerRoles, + forceSubjectMessage, + mergeFields, + previewOnly, + showPreview, + showProgressStepper, + testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlRequest {\n"); + sb.append(" allowEditCcs: ").append(toIndentedString(allowEditCcs)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ") + .append(toIndentedString(forceSubjectMessage)) + .append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (allowEditCcs != null) { + if (isFileTypeOrListOfFiles(allowEditCcs)) { + fileTypeFound = true; + } + + if (allowEditCcs.getClass().equals(java.io.File.class) + || allowEditCcs.getClass().equals(Integer.class) + || allowEditCcs.getClass().equals(String.class) + || allowEditCcs.getClass().isEnum()) { + map.put("allow_edit_ccs", allowEditCcs); + } else if (isListOfFile(allowEditCcs)) { + for (int i = 0; i < getListSize(allowEditCcs); i++) { + map.put("allow_edit_ccs[" + i + "]", getFromList(allowEditCcs, i)); + } + } else { + map.put( + "allow_edit_ccs", + JSON.getDefault().getMapper().writeValueAsString(allowEditCcs)); + } + } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) + || ccRoles.getClass().equals(Integer.class) + || ccRoles.getClass().equals(String.class) + || ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for (int i = 0; i < getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } + + if (forceSignerRoles.getClass().equals(java.io.File.class) + || forceSignerRoles.getClass().equals(Integer.class) + || forceSignerRoles.getClass().equals(String.class) + || forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for (int i = 0; i < getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } else { + map.put( + "force_signer_roles", + JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } + } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } + + if (forceSubjectMessage.getClass().equals(java.io.File.class) + || forceSubjectMessage.getClass().equals(Integer.class) + || forceSubjectMessage.getClass().equals(String.class) + || forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for (int i = 0; i < getListSize(forceSubjectMessage); i++) { + map.put( + "force_subject_message[" + i + "]", + getFromList(forceSubjectMessage, i)); + } + } else { + map.put( + "force_subject_message", + JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } + } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } + + if (mergeFields.getClass().equals(java.io.File.class) + || mergeFields.getClass().equals(Integer.class) + || mergeFields.getClass().equals(String.class) + || mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for (int i = 0; i < getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } else { + map.put( + "merge_fields", + JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } + } + if (previewOnly != null) { + if (isFileTypeOrListOfFiles(previewOnly)) { + fileTypeFound = true; + } + + if (previewOnly.getClass().equals(java.io.File.class) + || previewOnly.getClass().equals(Integer.class) + || previewOnly.getClass().equals(String.class) + || previewOnly.getClass().isEnum()) { + map.put("preview_only", previewOnly); + } else if (isListOfFile(previewOnly)) { + for (int i = 0; i < getListSize(previewOnly); i++) { + map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); + } + } else { + map.put( + "preview_only", + JSON.getDefault().getMapper().writeValueAsString(previewOnly)); + } + } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } + + if (showPreview.getClass().equals(java.io.File.class) + || showPreview.getClass().equals(Integer.class) + || showPreview.getClass().equals(String.class) + || showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for (int i = 0; i < getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } else { + map.put( + "show_preview", + JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java index 81fb833..a16cac9 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponse.java @@ -10,231 +10,216 @@ * 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.EmbeddedEditUrlResponseEmbedded; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * EmbeddedEditUrlResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public EmbeddedEditUrlResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EmbeddedEditUrlResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponse.class); - } - - static public EmbeddedEditUrlResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedEditUrlResponse.class - ); - } - - public EmbeddedEditUrlResponse embedded(EmbeddedEditUrlResponseEmbedded embedded) { - this.embedded = embedded; - return this; - } - - /** - * Get embedded - * @return embedded - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public EmbeddedEditUrlResponseEmbedded getEmbedded() { - return embedded; - } - - - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmbedded(EmbeddedEditUrlResponseEmbedded embedded) { - this.embedded = embedded; - } - - - public EmbeddedEditUrlResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this EmbeddedEditUrlResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedEditUrlResponse embeddedEditUrlResponse = (EmbeddedEditUrlResponse) o; - return Objects.equals(this.embedded, embeddedEditUrlResponse.embedded) && - Objects.equals(this.warnings, embeddedEditUrlResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(embedded, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlResponse {\n"); - sb.append(" embedded: ").append(toIndentedString(embedded)).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 (embedded != null) { - if (isFileTypeOrListOfFiles(embedded)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_EMBEDDED = "embedded"; + private EmbeddedEditUrlResponseEmbedded embedded; - if (embedded.getClass().equals(java.io.File.class) || - embedded.getClass().equals(Integer.class) || - embedded.getClass().equals(String.class) || - embedded.getClass().isEnum()) { - map.put("embedded", embedded); - } else if (isListOfFile(embedded)) { - for(int i = 0; i< getListSize(embedded); i++) { - map.put("embedded[" + i + "]", getFromList(embedded, i)); - } - } - else { - map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public EmbeddedEditUrlResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EmbeddedEditUrlResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponse.class); + } + + public static EmbeddedEditUrlResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), EmbeddedEditUrlResponse.class); + } + + public EmbeddedEditUrlResponse embedded(EmbeddedEditUrlResponseEmbedded embedded) { + this.embedded = embedded; + return this; + } + + /** + * Get embedded + * + * @return embedded + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EmbeddedEditUrlResponseEmbedded getEmbedded() { + return embedded; + } + + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmbedded(EmbeddedEditUrlResponseEmbedded embedded) { + this.embedded = embedded; + } + + public EmbeddedEditUrlResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public EmbeddedEditUrlResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this EmbeddedEditUrlResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + EmbeddedEditUrlResponse embeddedEditUrlResponse = (EmbeddedEditUrlResponse) o; + return Objects.equals(this.embedded, embeddedEditUrlResponse.embedded) + && Objects.equals(this.warnings, embeddedEditUrlResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(embedded, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlResponse {\n"); + sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (embedded != null) { + if (isFileTypeOrListOfFiles(embedded)) { + fileTypeFound = true; + } + + if (embedded.getClass().equals(java.io.File.class) + || embedded.getClass().equals(Integer.class) + || embedded.getClass().equals(String.class) + || embedded.getClass().isEnum()) { + map.put("embedded", embedded); + } else if (isListOfFile(embedded)) { + for (int i = 0; i < getListSize(embedded); i++) { + map.put("embedded[" + i + "]", getFromList(embedded, i)); + } + } else { + map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java index a2fe58d..7ce01e5 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedEditUrlResponseEmbedded.java @@ -10,219 +10,209 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An embedded template object. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class EmbeddedEditUrlResponseEmbedded { - public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; - private String editUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public EmbeddedEditUrlResponseEmbedded() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EmbeddedEditUrlResponseEmbedded init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponseEmbedded.class); - } - - static public EmbeddedEditUrlResponseEmbedded init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedEditUrlResponseEmbedded.class - ); - } - - public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) { - this.editUrl = editUrl; - return this; - } - - /** - * A template url that can be opened in an iFrame. - * @return editUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEditUrl() { - return editUrl; - } - - - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditUrl(String editUrl) { - this.editUrl = editUrl; - } - - - public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The specific time that the the `edit_url` link expires, in epoch. - * @return expiresAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this EmbeddedEditUrlResponseEmbedded object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedEditUrlResponseEmbedded embeddedEditUrlResponseEmbedded = (EmbeddedEditUrlResponseEmbedded) o; - return Objects.equals(this.editUrl, embeddedEditUrlResponseEmbedded.editUrl) && - Objects.equals(this.expiresAt, embeddedEditUrlResponseEmbedded.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(editUrl, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedEditUrlResponseEmbedded {\n"); - sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (editUrl != null) { - if (isFileTypeOrListOfFiles(editUrl)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; + private String editUrl; - if (editUrl.getClass().equals(java.io.File.class) || - editUrl.getClass().equals(Integer.class) || - editUrl.getClass().equals(String.class) || - editUrl.getClass().isEnum()) { - map.put("edit_url", editUrl); - } else if (isListOfFile(editUrl)) { - for(int i = 0; i< getListSize(editUrl); i++) { - map.put("edit_url[" + i + "]", getFromList(editUrl, i)); - } - } - else { - map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); - } + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public EmbeddedEditUrlResponseEmbedded() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EmbeddedEditUrlResponseEmbedded init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedEditUrlResponseEmbedded.class); } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + public static EmbeddedEditUrlResponseEmbedded init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedEditUrlResponseEmbedded.class); + } + + public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) { + this.editUrl = editUrl; + return this; + } + + /** + * A template url that can be opened in an iFrame. + * + * @return editUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEditUrl() { + return editUrl; + } + + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditUrl(String editUrl) { + this.editUrl = editUrl; + } + + public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The specific time that the the `edit_url` link expires, in epoch. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this EmbeddedEditUrlResponseEmbedded object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + EmbeddedEditUrlResponseEmbedded embeddedEditUrlResponseEmbedded = + (EmbeddedEditUrlResponseEmbedded) o; + return Objects.equals(this.editUrl, embeddedEditUrlResponseEmbedded.editUrl) + && Objects.equals(this.expiresAt, embeddedEditUrlResponseEmbedded.expiresAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(editUrl, expiresAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedEditUrlResponseEmbedded {\n"); + sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (editUrl != null) { + if (isFileTypeOrListOfFiles(editUrl)) { + fileTypeFound = true; + } + + if (editUrl.getClass().equals(java.io.File.class) + || editUrl.getClass().equals(Integer.class) + || editUrl.getClass().equals(String.class) + || editUrl.getClass().isEnum()) { + map.put("edit_url", editUrl); + } else if (isListOfFile(editUrl)) { + for (int i = 0; i < getListSize(editUrl); i++) { + map.put("edit_url[" + i + "]", getFromList(editUrl, i)); + } + } else { + map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java index 94e2512..7e34d2d 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponse.java @@ -10,231 +10,216 @@ * 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.EmbeddedSignUrlResponseEmbedded; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * EmbeddedSignUrlResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public EmbeddedSignUrlResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EmbeddedSignUrlResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponse.class); - } - - static public EmbeddedSignUrlResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedSignUrlResponse.class - ); - } - - public EmbeddedSignUrlResponse embedded(EmbeddedSignUrlResponseEmbedded embedded) { - this.embedded = embedded; - return this; - } - - /** - * Get embedded - * @return embedded - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public EmbeddedSignUrlResponseEmbedded getEmbedded() { - return embedded; - } - - - @JsonProperty(JSON_PROPERTY_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmbedded(EmbeddedSignUrlResponseEmbedded embedded) { - this.embedded = embedded; - } - - - public EmbeddedSignUrlResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this EmbeddedSignUrlResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedSignUrlResponse embeddedSignUrlResponse = (EmbeddedSignUrlResponse) o; - return Objects.equals(this.embedded, embeddedSignUrlResponse.embedded) && - Objects.equals(this.warnings, embeddedSignUrlResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(embedded, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedSignUrlResponse {\n"); - sb.append(" embedded: ").append(toIndentedString(embedded)).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 (embedded != null) { - if (isFileTypeOrListOfFiles(embedded)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_EMBEDDED = "embedded"; + private EmbeddedSignUrlResponseEmbedded embedded; - if (embedded.getClass().equals(java.io.File.class) || - embedded.getClass().equals(Integer.class) || - embedded.getClass().equals(String.class) || - embedded.getClass().isEnum()) { - map.put("embedded", embedded); - } else if (isListOfFile(embedded)) { - for(int i = 0; i< getListSize(embedded); i++) { - map.put("embedded[" + i + "]", getFromList(embedded, i)); - } - } - else { - map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public EmbeddedSignUrlResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EmbeddedSignUrlResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponse.class); + } + + public static EmbeddedSignUrlResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), EmbeddedSignUrlResponse.class); + } + + public EmbeddedSignUrlResponse embedded(EmbeddedSignUrlResponseEmbedded embedded) { + this.embedded = embedded; + return this; + } + + /** + * Get embedded + * + * @return embedded + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EmbeddedSignUrlResponseEmbedded getEmbedded() { + return embedded; + } + + @JsonProperty(JSON_PROPERTY_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmbedded(EmbeddedSignUrlResponseEmbedded embedded) { + this.embedded = embedded; + } + + public EmbeddedSignUrlResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public EmbeddedSignUrlResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this EmbeddedSignUrlResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + EmbeddedSignUrlResponse embeddedSignUrlResponse = (EmbeddedSignUrlResponse) o; + return Objects.equals(this.embedded, embeddedSignUrlResponse.embedded) + && Objects.equals(this.warnings, embeddedSignUrlResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(embedded, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedSignUrlResponse {\n"); + sb.append(" embedded: ").append(toIndentedString(embedded)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (embedded != null) { + if (isFileTypeOrListOfFiles(embedded)) { + fileTypeFound = true; + } + + if (embedded.getClass().equals(java.io.File.class) + || embedded.getClass().equals(Integer.class) + || embedded.getClass().equals(String.class) + || embedded.getClass().isEnum()) { + map.put("embedded", embedded); + } else if (isListOfFile(embedded)) { + for (int i = 0; i < getListSize(embedded); i++) { + map.put("embedded[" + i + "]", getFromList(embedded, i)); + } + } else { + map.put("embedded", JSON.getDefault().getMapper().writeValueAsString(embedded)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java index 1d2140e..716bd32 100644 --- a/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java +++ b/src/main/java/com/dropbox/sign/model/EmbeddedSignUrlResponseEmbedded.java @@ -10,219 +10,209 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An object that contains necessary information to set up embedded signing. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class EmbeddedSignUrlResponseEmbedded { - public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; - private String signUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public EmbeddedSignUrlResponseEmbedded() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EmbeddedSignUrlResponseEmbedded init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponseEmbedded.class); - } - - static public EmbeddedSignUrlResponseEmbedded init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EmbeddedSignUrlResponseEmbedded.class - ); - } - - public EmbeddedSignUrlResponseEmbedded signUrl(String signUrl) { - this.signUrl = signUrl; - return this; - } - - /** - * A signature url that can be opened in an iFrame. - * @return signUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGN_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignUrl() { - return signUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGN_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignUrl(String signUrl) { - this.signUrl = signUrl; - } - - - public EmbeddedSignUrlResponseEmbedded expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * The specific time that the the `sign_url` link expires, in epoch. - * @return expiresAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this EmbeddedSignUrlResponseEmbedded object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EmbeddedSignUrlResponseEmbedded embeddedSignUrlResponseEmbedded = (EmbeddedSignUrlResponseEmbedded) o; - return Objects.equals(this.signUrl, embeddedSignUrlResponseEmbedded.signUrl) && - Objects.equals(this.expiresAt, embeddedSignUrlResponseEmbedded.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(signUrl, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EmbeddedSignUrlResponseEmbedded {\n"); - sb.append(" signUrl: ").append(toIndentedString(signUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signUrl != null) { - if (isFileTypeOrListOfFiles(signUrl)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_SIGN_URL = "sign_url"; + private String signUrl; - if (signUrl.getClass().equals(java.io.File.class) || - signUrl.getClass().equals(Integer.class) || - signUrl.getClass().equals(String.class) || - signUrl.getClass().isEnum()) { - map.put("sign_url", signUrl); - } else if (isListOfFile(signUrl)) { - for(int i = 0; i< getListSize(signUrl); i++) { - map.put("sign_url[" + i + "]", getFromList(signUrl, i)); - } - } - else { - map.put("sign_url", JSON.getDefault().getMapper().writeValueAsString(signUrl)); - } + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public EmbeddedSignUrlResponseEmbedded() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EmbeddedSignUrlResponseEmbedded init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EmbeddedSignUrlResponseEmbedded.class); } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + public static EmbeddedSignUrlResponseEmbedded init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + EmbeddedSignUrlResponseEmbedded.class); + } + + public EmbeddedSignUrlResponseEmbedded signUrl(String signUrl) { + this.signUrl = signUrl; + return this; + } + + /** + * A signature url that can be opened in an iFrame. + * + * @return signUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGN_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignUrl() { + return signUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGN_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignUrl(String signUrl) { + this.signUrl = signUrl; + } + + public EmbeddedSignUrlResponseEmbedded expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The specific time that the the `sign_url` link expires, in epoch. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this EmbeddedSignUrlResponseEmbedded object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + EmbeddedSignUrlResponseEmbedded embeddedSignUrlResponseEmbedded = + (EmbeddedSignUrlResponseEmbedded) o; + return Objects.equals(this.signUrl, embeddedSignUrlResponseEmbedded.signUrl) + && Objects.equals(this.expiresAt, embeddedSignUrlResponseEmbedded.expiresAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(signUrl, expiresAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedSignUrlResponseEmbedded {\n"); + sb.append(" signUrl: ").append(toIndentedString(signUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signUrl != null) { + if (isFileTypeOrListOfFiles(signUrl)) { + fileTypeFound = true; + } + + if (signUrl.getClass().equals(java.io.File.class) + || signUrl.getClass().equals(Integer.class) + || signUrl.getClass().equals(String.class) + || signUrl.getClass().isEnum()) { + map.put("sign_url", signUrl); + } else if (isListOfFile(signUrl)) { + for (int i = 0; i < getListSize(signUrl); i++) { + map.put("sign_url[" + i + "]", getFromList(signUrl, i)); + } + } else { + map.put("sign_url", JSON.getDefault().getMapper().writeValueAsString(signUrl)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ErrorResponse.java b/src/main/java/com/dropbox/sign/model/ErrorResponse.java index ea1255d..0536233 100644 --- a/src/main/java/com/dropbox/sign/model/ErrorResponse.java +++ b/src/main/java/com/dropbox/sign/model/ErrorResponse.java @@ -10,170 +10,157 @@ * 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.ErrorResponseError; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * ErrorResponse - */ -@JsonPropertyOrder({ - ErrorResponse.JSON_PROPERTY_ERROR -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** ErrorResponse */ +@JsonPropertyOrder({ErrorResponse.JSON_PROPERTY_ERROR}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ErrorResponse { - public static final String JSON_PROPERTY_ERROR = "error"; - private ErrorResponseError error; - - public ErrorResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ErrorResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ErrorResponse.class); - } - - static public ErrorResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ErrorResponse.class - ); - } - - public ErrorResponse error(ErrorResponseError error) { - this.error = error; - return this; - } - - /** - * Get error - * @return error - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ErrorResponseError getError() { - return error; - } - - - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setError(ErrorResponseError error) { - this.error = error; - } - - - /** - * Return true if this ErrorResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_ERROR = "error"; + private ErrorResponseError error; + + public ErrorResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ErrorResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ErrorResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static ErrorResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ErrorResponse.class); } - ErrorResponse errorResponse = (ErrorResponse) o; - return Objects.equals(this.error, errorResponse.error); - } - - @Override - public int hashCode() { - return Objects.hash(error); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponse {\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (error != null) { - if (isFileTypeOrListOfFiles(error)) { - fileTypeFound = true; - } - if (error.getClass().equals(java.io.File.class) || - error.getClass().equals(Integer.class) || - error.getClass().equals(String.class) || - error.getClass().isEnum()) { - map.put("error", error); - } else if (isListOfFile(error)) { - for(int i = 0; i< getListSize(error); i++) { - map.put("error[" + i + "]", getFromList(error, i)); - } + public ErrorResponse error(ErrorResponseError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ErrorResponseError getError() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setError(ErrorResponseError error) { + this.error = error; + } + + /** Return true if this ErrorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); + if (o == null || getClass() != o.getClass()) { + return false; } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.error, errorResponse.error); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (error != null) { + if (isFileTypeOrListOfFiles(error)) { + fileTypeFound = true; + } + + if (error.getClass().equals(java.io.File.class) + || error.getClass().equals(Integer.class) + || error.getClass().equals(String.class) + || error.getClass().isEnum()) { + map.put("error", error); + } else if (isListOfFile(error)) { + for (int i = 0; i < getListSize(error); i++) { + map.put("error[" + i + "]", getFromList(error, i)); + } + } else { + map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ErrorResponseError.java b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java index d7f9af4..6130165 100644 --- a/src/main/java/com/dropbox/sign/model/ErrorResponseError.java +++ b/src/main/java/com/dropbox/sign/model/ErrorResponseError.java @@ -10,269 +10,258 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains information about an error that occurred. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ErrorResponseError { - public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; - private String errorMsg; - - public static final String JSON_PROPERTY_ERROR_NAME = "error_name"; - private String errorName; + public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; + private String errorMsg; - public static final String JSON_PROPERTY_ERROR_PATH = "error_path"; - private String errorPath; + public static final String JSON_PROPERTY_ERROR_NAME = "error_name"; + private String errorName; - public ErrorResponseError() { - } + public static final String JSON_PROPERTY_ERROR_PATH = "error_path"; + private String errorPath; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ErrorResponseError init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ErrorResponseError.class); - } + public ErrorResponseError() {} - static public ErrorResponseError init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ErrorResponseError.class - ); - } - - public ErrorResponseError errorMsg(String errorMsg) { - this.errorMsg = errorMsg; - return this; - } - - /** - * Message describing an error. - * @return errorMsg - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getErrorMsg() { - return errorMsg; - } - - - @JsonProperty(JSON_PROPERTY_ERROR_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setErrorMsg(String errorMsg) { - this.errorMsg = errorMsg; - } - - - public ErrorResponseError errorName(String errorName) { - this.errorName = errorName; - return this; - } - - /** - * Name of the error. - * @return errorName - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ERROR_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getErrorName() { - return errorName; - } - - - @JsonProperty(JSON_PROPERTY_ERROR_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setErrorName(String errorName) { - this.errorName = errorName; - } - - - public ErrorResponseError errorPath(String errorPath) { - this.errorPath = errorPath; - return this; - } - - /** - * Path at which an error occurred. - * @return errorPath - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ERROR_PATH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ErrorResponseError init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ErrorResponseError.class); + } - public String getErrorPath() { - return errorPath; - } + public static ErrorResponseError init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ErrorResponseError.class); + } + public ErrorResponseError errorMsg(String errorMsg) { + this.errorMsg = errorMsg; + return this; + } - @JsonProperty(JSON_PROPERTY_ERROR_PATH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setErrorPath(String errorPath) { - this.errorPath = errorPath; - } + /** + * Message describing an error. + * + * @return errorMsg + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getErrorMsg() { + return errorMsg; + } + @JsonProperty(JSON_PROPERTY_ERROR_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } - /** - * Return true if this ErrorResponseError object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public ErrorResponseError errorName(String errorName) { + this.errorName = errorName; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Name of the error. + * + * @return errorName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ERROR_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getErrorName() { + return errorName; } - ErrorResponseError errorResponseError = (ErrorResponseError) o; - return Objects.equals(this.errorMsg, errorResponseError.errorMsg) && - Objects.equals(this.errorName, errorResponseError.errorName) && - Objects.equals(this.errorPath, errorResponseError.errorPath); - } - @Override - public int hashCode() { - return Objects.hash(errorMsg, errorName, errorPath); - } + @JsonProperty(JSON_PROPERTY_ERROR_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrorName(String errorName) { + this.errorName = errorName; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ErrorResponseError {\n"); - sb.append(" errorMsg: ").append(toIndentedString(errorMsg)).append("\n"); - sb.append(" errorName: ").append(toIndentedString(errorName)).append("\n"); - sb.append(" errorPath: ").append(toIndentedString(errorPath)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public ErrorResponseError errorPath(String errorPath) { + this.errorPath = errorPath; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (errorMsg != null) { - if (isFileTypeOrListOfFiles(errorMsg)) { - fileTypeFound = true; - } + /** + * Path at which an error occurred. + * + * @return errorPath + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ERROR_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorPath() { + return errorPath; + } - if (errorMsg.getClass().equals(java.io.File.class) || - errorMsg.getClass().equals(Integer.class) || - errorMsg.getClass().equals(String.class) || - errorMsg.getClass().isEnum()) { - map.put("error_msg", errorMsg); - } else if (isListOfFile(errorMsg)) { - for(int i = 0; i< getListSize(errorMsg); i++) { - map.put("error_msg[" + i + "]", getFromList(errorMsg, i)); - } - } - else { - map.put("error_msg", JSON.getDefault().getMapper().writeValueAsString(errorMsg)); - } + @JsonProperty(JSON_PROPERTY_ERROR_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorPath(String errorPath) { + this.errorPath = errorPath; } - if (errorName != null) { - if (isFileTypeOrListOfFiles(errorName)) { - fileTypeFound = true; - } - if (errorName.getClass().equals(java.io.File.class) || - errorName.getClass().equals(Integer.class) || - errorName.getClass().equals(String.class) || - errorName.getClass().isEnum()) { - map.put("error_name", errorName); - } else if (isListOfFile(errorName)) { - for(int i = 0; i< getListSize(errorName); i++) { - map.put("error_name[" + i + "]", getFromList(errorName, i)); - } + /** Return true if this ErrorResponseError object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("error_name", JSON.getDefault().getMapper().writeValueAsString(errorName)); + if (o == null || getClass() != o.getClass()) { + return false; } + ErrorResponseError errorResponseError = (ErrorResponseError) o; + return Objects.equals(this.errorMsg, errorResponseError.errorMsg) + && Objects.equals(this.errorName, errorResponseError.errorName) + && Objects.equals(this.errorPath, errorResponseError.errorPath); } - if (errorPath != null) { - if (isFileTypeOrListOfFiles(errorPath)) { - fileTypeFound = true; - } - if (errorPath.getClass().equals(java.io.File.class) || - errorPath.getClass().equals(Integer.class) || - errorPath.getClass().equals(String.class) || - errorPath.getClass().isEnum()) { - map.put("error_path", errorPath); - } else if (isListOfFile(errorPath)) { - for(int i = 0; i< getListSize(errorPath); i++) { - map.put("error_path[" + i + "]", getFromList(errorPath, i)); - } - } - else { - map.put("error_path", JSON.getDefault().getMapper().writeValueAsString(errorPath)); - } + @Override + public int hashCode() { + return Objects.hash(errorMsg, errorName, errorPath); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponseError {\n"); + sb.append(" errorMsg: ").append(toIndentedString(errorMsg)).append("\n"); + sb.append(" errorName: ").append(toIndentedString(errorName)).append("\n"); + sb.append(" errorPath: ").append(toIndentedString(errorPath)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (errorMsg != null) { + if (isFileTypeOrListOfFiles(errorMsg)) { + fileTypeFound = true; + } + + if (errorMsg.getClass().equals(java.io.File.class) + || errorMsg.getClass().equals(Integer.class) + || errorMsg.getClass().equals(String.class) + || errorMsg.getClass().isEnum()) { + map.put("error_msg", errorMsg); + } else if (isListOfFile(errorMsg)) { + for (int i = 0; i < getListSize(errorMsg); i++) { + map.put("error_msg[" + i + "]", getFromList(errorMsg, i)); + } + } else { + map.put( + "error_msg", + JSON.getDefault().getMapper().writeValueAsString(errorMsg)); + } + } + if (errorName != null) { + if (isFileTypeOrListOfFiles(errorName)) { + fileTypeFound = true; + } + + if (errorName.getClass().equals(java.io.File.class) + || errorName.getClass().equals(Integer.class) + || errorName.getClass().equals(String.class) + || errorName.getClass().isEnum()) { + map.put("error_name", errorName); + } else if (isListOfFile(errorName)) { + for (int i = 0; i < getListSize(errorName); i++) { + map.put("error_name[" + i + "]", getFromList(errorName, i)); + } + } else { + map.put( + "error_name", + JSON.getDefault().getMapper().writeValueAsString(errorName)); + } + } + if (errorPath != null) { + if (isFileTypeOrListOfFiles(errorPath)) { + fileTypeFound = true; + } + + if (errorPath.getClass().equals(java.io.File.class) + || errorPath.getClass().equals(Integer.class) + || errorPath.getClass().equals(String.class) + || errorPath.getClass().isEnum()) { + map.put("error_path", errorPath); + } else if (isListOfFile(errorPath)) { + for (int i = 0; i < getListSize(errorPath); i++) { + map.put("error_path[" + i + "]", getFromList(errorPath, i)); + } + } else { + map.put( + "error_path", + JSON.getDefault().getMapper().writeValueAsString(errorPath)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java index 791194f..54c9846 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequest.java @@ -10,323 +10,299 @@ * 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.dropbox.sign.model.EventCallbackRequestEvent; -import com.dropbox.sign.model.SignatureRequestResponse; -import com.dropbox.sign.model.TemplateResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * EventCallbackRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class EventCallbackRequest { - public static final String JSON_PROPERTY_EVENT = "event"; - private EventCallbackRequestEvent event; - - public static final String JSON_PROPERTY_ACCOUNT = "account"; - private AccountResponse account; - - public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; - private SignatureRequestResponse signatureRequest; - - public static final String JSON_PROPERTY_TEMPLATE = "template"; - private TemplateResponse template; - - public EventCallbackRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EventCallbackRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequest.class); - } - - static public EventCallbackRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EventCallbackRequest.class - ); - } - - public EventCallbackRequest event(EventCallbackRequestEvent event) { - this.event = event; - return this; - } - - /** - * Get event - * @return event - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public EventCallbackRequestEvent getEvent() { - return event; - } - - - @JsonProperty(JSON_PROPERTY_EVENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEvent(EventCallbackRequestEvent event) { - this.event = event; - } - - - public EventCallbackRequest account(AccountResponse account) { - this.account = account; - return this; - } - - /** - * Get account - * @return account - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public AccountResponse getAccount() { - return account; - } - - - @JsonProperty(JSON_PROPERTY_ACCOUNT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccount(AccountResponse account) { - this.account = account; - } - - - public EventCallbackRequest signatureRequest(SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - return this; - } - - /** - * Get signatureRequest - * @return signatureRequest - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SignatureRequestResponse getSignatureRequest() { - return signatureRequest; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequest(SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - } - - - public EventCallbackRequest template(TemplateResponse template) { - this.template = template; - return this; - } - - /** - * Get template - * @return template - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponse getTemplate() { - return template; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplate(TemplateResponse template) { - this.template = template; - } - - - /** - * Return true if this EventCallbackRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_EVENT = "event"; + private EventCallbackRequestEvent event; + + public static final String JSON_PROPERTY_ACCOUNT = "account"; + private AccountResponse account; + + public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; + private SignatureRequestResponse signatureRequest; + + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private TemplateResponse template; + + public EventCallbackRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EventCallbackRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static EventCallbackRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), EventCallbackRequest.class); } - EventCallbackRequest eventCallbackRequest = (EventCallbackRequest) o; - return Objects.equals(this.event, eventCallbackRequest.event) && - Objects.equals(this.account, eventCallbackRequest.account) && - Objects.equals(this.signatureRequest, eventCallbackRequest.signatureRequest) && - Objects.equals(this.template, eventCallbackRequest.template); - } - - @Override - public int hashCode() { - return Objects.hash(event, account, signatureRequest, template); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequest {\n"); - sb.append(" event: ").append(toIndentedString(event)).append("\n"); - sb.append(" account: ").append(toIndentedString(account)).append("\n"); - sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (event != null) { - if (isFileTypeOrListOfFiles(event)) { - fileTypeFound = true; - } - if (event.getClass().equals(java.io.File.class) || - event.getClass().equals(Integer.class) || - event.getClass().equals(String.class) || - event.getClass().isEnum()) { - map.put("event", event); - } else if (isListOfFile(event)) { - for(int i = 0; i< getListSize(event); i++) { - map.put("event[" + i + "]", getFromList(event, i)); - } - } - else { - map.put("event", JSON.getDefault().getMapper().writeValueAsString(event)); - } + public EventCallbackRequest event(EventCallbackRequestEvent event) { + this.event = event; + return this; } - if (account != null) { - if (isFileTypeOrListOfFiles(account)) { - fileTypeFound = true; - } - if (account.getClass().equals(java.io.File.class) || - account.getClass().equals(Integer.class) || - account.getClass().equals(String.class) || - account.getClass().isEnum()) { - map.put("account", account); - } else if (isListOfFile(account)) { - for(int i = 0; i< getListSize(account); i++) { - map.put("account[" + i + "]", getFromList(account, i)); - } - } - else { - map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); - } + /** + * Get event + * + * @return event + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventCallbackRequestEvent getEvent() { + return event; } - if (signatureRequest != null) { - if (isFileTypeOrListOfFiles(signatureRequest)) { - fileTypeFound = true; - } - if (signatureRequest.getClass().equals(java.io.File.class) || - signatureRequest.getClass().equals(Integer.class) || - signatureRequest.getClass().equals(String.class) || - signatureRequest.getClass().isEnum()) { - map.put("signature_request", signatureRequest); - } else if (isListOfFile(signatureRequest)) { - for(int i = 0; i< getListSize(signatureRequest); i++) { - map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); - } - } - else { - map.put("signature_request", JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); - } + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEvent(EventCallbackRequestEvent event) { + this.event = event; } - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - if (template.getClass().equals(java.io.File.class) || - template.getClass().equals(Integer.class) || - template.getClass().equals(String.class) || - template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for(int i = 0; i< getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } + public EventCallbackRequest account(AccountResponse account) { + this.account = account; + return this; + } + + /** + * Get account + * + * @return account + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AccountResponse getAccount() { + return account; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccount(AccountResponse account) { + this.account = account; + } + + public EventCallbackRequest signatureRequest(SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + return this; + } + + /** + * Get signatureRequest + * + * @return signatureRequest + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SignatureRequestResponse getSignatureRequest() { + return signatureRequest; + } + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequest(SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + } + + public EventCallbackRequest template(TemplateResponse template) { + this.template = template; + return this; + } + + /** + * Get template + * + * @return template + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponse getTemplate() { + return template; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplate(TemplateResponse template) { + this.template = template; + } + + /** Return true if this EventCallbackRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequest eventCallbackRequest = (EventCallbackRequest) o; + return Objects.equals(this.event, eventCallbackRequest.event) + && Objects.equals(this.account, eventCallbackRequest.account) + && Objects.equals(this.signatureRequest, eventCallbackRequest.signatureRequest) + && Objects.equals(this.template, eventCallbackRequest.template); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(event, account, signatureRequest, template); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequest {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" account: ").append(toIndentedString(account)).append("\n"); + sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (event != null) { + if (isFileTypeOrListOfFiles(event)) { + fileTypeFound = true; + } + + if (event.getClass().equals(java.io.File.class) + || event.getClass().equals(Integer.class) + || event.getClass().equals(String.class) + || event.getClass().isEnum()) { + map.put("event", event); + } else if (isListOfFile(event)) { + for (int i = 0; i < getListSize(event); i++) { + map.put("event[" + i + "]", getFromList(event, i)); + } + } else { + map.put("event", JSON.getDefault().getMapper().writeValueAsString(event)); + } + } + if (account != null) { + if (isFileTypeOrListOfFiles(account)) { + fileTypeFound = true; + } + + if (account.getClass().equals(java.io.File.class) + || account.getClass().equals(Integer.class) + || account.getClass().equals(String.class) + || account.getClass().isEnum()) { + map.put("account", account); + } else if (isListOfFile(account)) { + for (int i = 0; i < getListSize(account); i++) { + map.put("account[" + i + "]", getFromList(account, i)); + } + } else { + map.put("account", JSON.getDefault().getMapper().writeValueAsString(account)); + } + } + if (signatureRequest != null) { + if (isFileTypeOrListOfFiles(signatureRequest)) { + fileTypeFound = true; + } + + if (signatureRequest.getClass().equals(java.io.File.class) + || signatureRequest.getClass().equals(Integer.class) + || signatureRequest.getClass().equals(String.class) + || signatureRequest.getClass().isEnum()) { + map.put("signature_request", signatureRequest); + } else if (isListOfFile(signatureRequest)) { + for (int i = 0; i < getListSize(signatureRequest); i++) { + map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); + } + } else { + map.put( + "signature_request", + JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); + } + } + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) + || template.getClass().equals(Integer.class) + || template.getClass().equals(String.class) + || template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for (int i = 0; i < getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java index 38e621d..a746256 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEvent.java @@ -10,397 +10,387 @@ * 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.EventCallbackRequestEventMetadata; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Basic information about the event that occurred. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class EventCallbackRequestEvent { - public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; - private String eventTime; - - /** - * Type of callback event that was triggered. - */ - public enum EventTypeEnum { - 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"); - - private String value; - - EventTypeEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_EVENT_TIME = "event_time"; + private String eventTime; + + /** Type of callback event that was triggered. */ + public enum EventTypeEnum { + 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"); + + private String value; + + EventTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventTypeEnum fromValue(String value) { + for (EventTypeEnum b : EventTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + private EventTypeEnum eventType; + + public static final String JSON_PROPERTY_EVENT_HASH = "event_hash"; + private String eventHash; + + public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; + private EventCallbackRequestEventMetadata eventMetadata; + + public EventCallbackRequestEvent() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EventCallbackRequestEvent init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequestEvent.class); } - @Override - public String toString() { - return String.valueOf(value); + public static EventCallbackRequestEvent init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + EventCallbackRequestEvent.class); } - @JsonCreator - public static EventTypeEnum fromValue(String value) { - for (EventTypeEnum b : EventTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public EventCallbackRequestEvent eventTime(String eventTime) { + this.eventTime = eventTime; + return this; } - } - - public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; - private EventTypeEnum eventType; - - public static final String JSON_PROPERTY_EVENT_HASH = "event_hash"; - private String eventHash; - - public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; - private EventCallbackRequestEventMetadata eventMetadata; - - public EventCallbackRequestEvent() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EventCallbackRequestEvent init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequestEvent.class); - } - - static public EventCallbackRequestEvent init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EventCallbackRequestEvent.class - ); - } - - public EventCallbackRequestEvent eventTime(String eventTime) { - this.eventTime = eventTime; - return this; - } - - /** - * Time the event was created (using Unix time). - * @return eventTime - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_TIME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEventTime() { - return eventTime; - } - - - @JsonProperty(JSON_PROPERTY_EVENT_TIME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventTime(String eventTime) { - this.eventTime = eventTime; - } - - - public EventCallbackRequestEvent eventType(EventTypeEnum eventType) { - this.eventType = eventType; - return this; - } - - /** - * Type of callback event that was triggered. - * @return eventType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public EventTypeEnum getEventType() { - return eventType; - } - - - @JsonProperty(JSON_PROPERTY_EVENT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventType(EventTypeEnum eventType) { - this.eventType = eventType; - } - - - public EventCallbackRequestEvent eventHash(String eventHash) { - this.eventHash = eventHash; - return this; - } - - /** - * Generated hash used to verify source of event data. - * @return eventHash - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_HASH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEventHash() { - return eventHash; - } - - - @JsonProperty(JSON_PROPERTY_EVENT_HASH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventHash(String eventHash) { - this.eventHash = eventHash; - } - - - public EventCallbackRequestEvent eventMetadata(EventCallbackRequestEventMetadata eventMetadata) { - this.eventMetadata = eventMetadata; - return this; - } - - /** - * Get eventMetadata - * @return eventMetadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EVENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public EventCallbackRequestEventMetadata getEventMetadata() { - return eventMetadata; - } - - - @JsonProperty(JSON_PROPERTY_EVENT_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEventMetadata(EventCallbackRequestEventMetadata eventMetadata) { - this.eventMetadata = eventMetadata; - } - - - /** - * Return true if this EventCallbackRequestEvent object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * Time the event was created (using Unix time). + * + * @return eventTime + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEventTime() { + return eventTime; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_EVENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventTime(String eventTime) { + this.eventTime = eventTime; } - EventCallbackRequestEvent eventCallbackRequestEvent = (EventCallbackRequestEvent) o; - return Objects.equals(this.eventTime, eventCallbackRequestEvent.eventTime) && - Objects.equals(this.eventType, eventCallbackRequestEvent.eventType) && - Objects.equals(this.eventHash, eventCallbackRequestEvent.eventHash) && - Objects.equals(this.eventMetadata, eventCallbackRequestEvent.eventMetadata); - } - - @Override - public int hashCode() { - return Objects.hash(eventTime, eventType, eventHash, eventMetadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequestEvent {\n"); - sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); - sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" eventHash: ").append(toIndentedString(eventHash)).append("\n"); - sb.append(" eventMetadata: ").append(toIndentedString(eventMetadata)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (eventTime != null) { - if (isFileTypeOrListOfFiles(eventTime)) { - fileTypeFound = true; - } - if (eventTime.getClass().equals(java.io.File.class) || - eventTime.getClass().equals(Integer.class) || - eventTime.getClass().equals(String.class) || - eventTime.getClass().isEnum()) { - map.put("event_time", eventTime); - } else if (isListOfFile(eventTime)) { - for(int i = 0; i< getListSize(eventTime); i++) { - map.put("event_time[" + i + "]", getFromList(eventTime, i)); - } - } - else { - map.put("event_time", JSON.getDefault().getMapper().writeValueAsString(eventTime)); - } + public EventCallbackRequestEvent eventType(EventTypeEnum eventType) { + this.eventType = eventType; + return this; } - if (eventType != null) { - if (isFileTypeOrListOfFiles(eventType)) { - fileTypeFound = true; - } - if (eventType.getClass().equals(java.io.File.class) || - eventType.getClass().equals(Integer.class) || - eventType.getClass().equals(String.class) || - eventType.getClass().isEnum()) { - map.put("event_type", eventType); - } else if (isListOfFile(eventType)) { - for(int i = 0; i< getListSize(eventType); i++) { - map.put("event_type[" + i + "]", getFromList(eventType, i)); - } - } - else { - map.put("event_type", JSON.getDefault().getMapper().writeValueAsString(eventType)); - } + /** + * Type of callback event that was triggered. + * + * @return eventType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EventTypeEnum getEventType() { + return eventType; } - if (eventHash != null) { - if (isFileTypeOrListOfFiles(eventHash)) { - fileTypeFound = true; - } - if (eventHash.getClass().equals(java.io.File.class) || - eventHash.getClass().equals(Integer.class) || - eventHash.getClass().equals(String.class) || - eventHash.getClass().isEnum()) { - map.put("event_hash", eventHash); - } else if (isListOfFile(eventHash)) { - for(int i = 0; i< getListSize(eventHash); i++) { - map.put("event_hash[" + i + "]", getFromList(eventHash, i)); - } - } - else { - map.put("event_hash", JSON.getDefault().getMapper().writeValueAsString(eventHash)); - } + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventType(EventTypeEnum eventType) { + this.eventType = eventType; } - if (eventMetadata != null) { - if (isFileTypeOrListOfFiles(eventMetadata)) { - fileTypeFound = true; - } - if (eventMetadata.getClass().equals(java.io.File.class) || - eventMetadata.getClass().equals(Integer.class) || - eventMetadata.getClass().equals(String.class) || - eventMetadata.getClass().isEnum()) { - map.put("event_metadata", eventMetadata); - } else if (isListOfFile(eventMetadata)) { - for(int i = 0; i< getListSize(eventMetadata); i++) { - map.put("event_metadata[" + i + "]", getFromList(eventMetadata, i)); - } + public EventCallbackRequestEvent eventHash(String eventHash) { + this.eventHash = eventHash; + return this; + } + + /** + * Generated hash used to verify source of event data. + * + * @return eventHash + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EVENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEventHash() { + return eventHash; + } + + @JsonProperty(JSON_PROPERTY_EVENT_HASH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventHash(String eventHash) { + this.eventHash = eventHash; + } + + public EventCallbackRequestEvent eventMetadata( + EventCallbackRequestEventMetadata eventMetadata) { + this.eventMetadata = eventMetadata; + return this; + } + + /** + * Get eventMetadata + * + * @return eventMetadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EVENT_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EventCallbackRequestEventMetadata getEventMetadata() { + return eventMetadata; + } + + @JsonProperty(JSON_PROPERTY_EVENT_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventMetadata(EventCallbackRequestEventMetadata eventMetadata) { + this.eventMetadata = eventMetadata; + } + + /** Return true if this EventCallbackRequestEvent object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("event_metadata", JSON.getDefault().getMapper().writeValueAsString(eventMetadata)); + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequestEvent eventCallbackRequestEvent = (EventCallbackRequestEvent) o; + return Objects.equals(this.eventTime, eventCallbackRequestEvent.eventTime) + && Objects.equals(this.eventType, eventCallbackRequestEvent.eventType) + && Objects.equals(this.eventHash, eventCallbackRequestEvent.eventHash) + && Objects.equals(this.eventMetadata, eventCallbackRequestEvent.eventMetadata); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(eventTime, eventType, eventHash, eventMetadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequestEvent {\n"); + sb.append(" eventTime: ").append(toIndentedString(eventTime)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" eventHash: ").append(toIndentedString(eventHash)).append("\n"); + sb.append(" eventMetadata: ").append(toIndentedString(eventMetadata)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (eventTime != null) { + if (isFileTypeOrListOfFiles(eventTime)) { + fileTypeFound = true; + } + + if (eventTime.getClass().equals(java.io.File.class) + || eventTime.getClass().equals(Integer.class) + || eventTime.getClass().equals(String.class) + || eventTime.getClass().isEnum()) { + map.put("event_time", eventTime); + } else if (isListOfFile(eventTime)) { + for (int i = 0; i < getListSize(eventTime); i++) { + map.put("event_time[" + i + "]", getFromList(eventTime, i)); + } + } else { + map.put( + "event_time", + JSON.getDefault().getMapper().writeValueAsString(eventTime)); + } + } + if (eventType != null) { + if (isFileTypeOrListOfFiles(eventType)) { + fileTypeFound = true; + } + + if (eventType.getClass().equals(java.io.File.class) + || eventType.getClass().equals(Integer.class) + || eventType.getClass().equals(String.class) + || eventType.getClass().isEnum()) { + map.put("event_type", eventType); + } else if (isListOfFile(eventType)) { + for (int i = 0; i < getListSize(eventType); i++) { + map.put("event_type[" + i + "]", getFromList(eventType, i)); + } + } else { + map.put( + "event_type", + JSON.getDefault().getMapper().writeValueAsString(eventType)); + } + } + if (eventHash != null) { + if (isFileTypeOrListOfFiles(eventHash)) { + fileTypeFound = true; + } + + if (eventHash.getClass().equals(java.io.File.class) + || eventHash.getClass().equals(Integer.class) + || eventHash.getClass().equals(String.class) + || eventHash.getClass().isEnum()) { + map.put("event_hash", eventHash); + } else if (isListOfFile(eventHash)) { + for (int i = 0; i < getListSize(eventHash); i++) { + map.put("event_hash[" + i + "]", getFromList(eventHash, i)); + } + } else { + map.put( + "event_hash", + JSON.getDefault().getMapper().writeValueAsString(eventHash)); + } + } + if (eventMetadata != null) { + if (isFileTypeOrListOfFiles(eventMetadata)) { + fileTypeFound = true; + } + + if (eventMetadata.getClass().equals(java.io.File.class) + || eventMetadata.getClass().equals(Integer.class) + || eventMetadata.getClass().equals(String.class) + || eventMetadata.getClass().isEnum()) { + map.put("event_metadata", eventMetadata); + } else if (isListOfFile(eventMetadata)) { + for (int i = 0; i < getListSize(eventMetadata); i++) { + map.put("event_metadata[" + i + "]", getFromList(eventMetadata, i)); + } + } else { + map.put( + "event_metadata", + JSON.getDefault().getMapper().writeValueAsString(eventMetadata)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java index d6a0d30..e92975e 100644 --- a/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java +++ b/src/main/java/com/dropbox/sign/model/EventCallbackRequestEventMetadata.java @@ -10,319 +10,323 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Specific metadata about the event. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class EventCallbackRequestEventMetadata { - public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; - private String relatedSignatureId; - - public static final String JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID = "reported_for_account_id"; - private String reportedForAccountId; - - public static final String JSON_PROPERTY_REPORTED_FOR_APP_ID = "reported_for_app_id"; - private String reportedForAppId; - - public static final String JSON_PROPERTY_EVENT_MESSAGE = "event_message"; - private String eventMessage; - - public EventCallbackRequestEventMetadata() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public EventCallbackRequestEventMetadata init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, EventCallbackRequestEventMetadata.class); - } - - static public EventCallbackRequestEventMetadata init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - EventCallbackRequestEventMetadata.class - ); - } - - public EventCallbackRequestEventMetadata relatedSignatureId(String relatedSignatureId) { - this.relatedSignatureId = relatedSignatureId; - return this; - } - - /** - * Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. - * @return relatedSignatureId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRelatedSignatureId() { - return relatedSignatureId; - } - - - @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRelatedSignatureId(String relatedSignatureId) { - this.relatedSignatureId = relatedSignatureId; - } - - - public EventCallbackRequestEventMetadata reportedForAccountId(String reportedForAccountId) { - this.reportedForAccountId = reportedForAccountId; - return this; - } - - /** - * Account ID the event was reported for. - * @return reportedForAccountId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getReportedForAccountId() { - return reportedForAccountId; - } - - - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportedForAccountId(String reportedForAccountId) { - this.reportedForAccountId = reportedForAccountId; - } - - - public EventCallbackRequestEventMetadata reportedForAppId(String reportedForAppId) { - this.reportedForAppId = reportedForAppId; - return this; - } - - /** - * App ID the event was reported for. - * @return reportedForAppId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getReportedForAppId() { - return reportedForAppId; - } - - - @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportedForAppId(String reportedForAppId) { - this.reportedForAppId = reportedForAppId; - } - - - public EventCallbackRequestEventMetadata eventMessage(String eventMessage) { - this.eventMessage = eventMessage; - return this; - } - - /** - * Message about a declined or failed (due to error) signature flow. - * @return eventMessage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEventMessage() { - return eventMessage; - } - - - @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEventMessage(String eventMessage) { - this.eventMessage = eventMessage; - } - - - /** - * Return true if this EventCallbackRequestEventMetadata object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_RELATED_SIGNATURE_ID = "related_signature_id"; + private String relatedSignatureId; + + public static final String JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID = "reported_for_account_id"; + private String reportedForAccountId; + + public static final String JSON_PROPERTY_REPORTED_FOR_APP_ID = "reported_for_app_id"; + private String reportedForAppId; + + public static final String JSON_PROPERTY_EVENT_MESSAGE = "event_message"; + private String eventMessage; + + public EventCallbackRequestEventMetadata() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static EventCallbackRequestEventMetadata init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, EventCallbackRequestEventMetadata.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static EventCallbackRequestEventMetadata init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + EventCallbackRequestEventMetadata.class); } - EventCallbackRequestEventMetadata eventCallbackRequestEventMetadata = (EventCallbackRequestEventMetadata) o; - return Objects.equals(this.relatedSignatureId, eventCallbackRequestEventMetadata.relatedSignatureId) && - Objects.equals(this.reportedForAccountId, eventCallbackRequestEventMetadata.reportedForAccountId) && - Objects.equals(this.reportedForAppId, eventCallbackRequestEventMetadata.reportedForAppId) && - Objects.equals(this.eventMessage, eventCallbackRequestEventMetadata.eventMessage); - } - - @Override - public int hashCode() { - return Objects.hash(relatedSignatureId, reportedForAccountId, reportedForAppId, eventMessage); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCallbackRequestEventMetadata {\n"); - sb.append(" relatedSignatureId: ").append(toIndentedString(relatedSignatureId)).append("\n"); - sb.append(" reportedForAccountId: ").append(toIndentedString(reportedForAccountId)).append("\n"); - sb.append(" reportedForAppId: ").append(toIndentedString(reportedForAppId)).append("\n"); - sb.append(" eventMessage: ").append(toIndentedString(eventMessage)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (relatedSignatureId != null) { - if (isFileTypeOrListOfFiles(relatedSignatureId)) { - fileTypeFound = true; - } - if (relatedSignatureId.getClass().equals(java.io.File.class) || - relatedSignatureId.getClass().equals(Integer.class) || - relatedSignatureId.getClass().equals(String.class) || - relatedSignatureId.getClass().isEnum()) { - map.put("related_signature_id", relatedSignatureId); - } else if (isListOfFile(relatedSignatureId)) { - for(int i = 0; i< getListSize(relatedSignatureId); i++) { - map.put("related_signature_id[" + i + "]", getFromList(relatedSignatureId, i)); - } - } - else { - map.put("related_signature_id", JSON.getDefault().getMapper().writeValueAsString(relatedSignatureId)); - } + public EventCallbackRequestEventMetadata relatedSignatureId(String relatedSignatureId) { + this.relatedSignatureId = relatedSignatureId; + return this; } - if (reportedForAccountId != null) { - if (isFileTypeOrListOfFiles(reportedForAccountId)) { - fileTypeFound = true; - } - if (reportedForAccountId.getClass().equals(java.io.File.class) || - reportedForAccountId.getClass().equals(Integer.class) || - reportedForAccountId.getClass().equals(String.class) || - reportedForAccountId.getClass().isEnum()) { - map.put("reported_for_account_id", reportedForAccountId); - } else if (isListOfFile(reportedForAccountId)) { - for(int i = 0; i< getListSize(reportedForAccountId); i++) { - map.put("reported_for_account_id[" + i + "]", getFromList(reportedForAccountId, i)); - } - } - else { - map.put("reported_for_account_id", JSON.getDefault().getMapper().writeValueAsString(reportedForAccountId)); - } + /** + * Signature ID for a specific signer. Applicable to `signature_request_signed` and + * `signature_request_viewed` events. + * + * @return relatedSignatureId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRelatedSignatureId() { + return relatedSignatureId; } - if (reportedForAppId != null) { - if (isFileTypeOrListOfFiles(reportedForAppId)) { - fileTypeFound = true; - } - if (reportedForAppId.getClass().equals(java.io.File.class) || - reportedForAppId.getClass().equals(Integer.class) || - reportedForAppId.getClass().equals(String.class) || - reportedForAppId.getClass().isEnum()) { - map.put("reported_for_app_id", reportedForAppId); - } else if (isListOfFile(reportedForAppId)) { - for(int i = 0; i< getListSize(reportedForAppId); i++) { - map.put("reported_for_app_id[" + i + "]", getFromList(reportedForAppId, i)); - } - } - else { - map.put("reported_for_app_id", JSON.getDefault().getMapper().writeValueAsString(reportedForAppId)); - } + @JsonProperty(JSON_PROPERTY_RELATED_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRelatedSignatureId(String relatedSignatureId) { + this.relatedSignatureId = relatedSignatureId; } - if (eventMessage != null) { - if (isFileTypeOrListOfFiles(eventMessage)) { - fileTypeFound = true; - } - if (eventMessage.getClass().equals(java.io.File.class) || - eventMessage.getClass().equals(Integer.class) || - eventMessage.getClass().equals(String.class) || - eventMessage.getClass().isEnum()) { - map.put("event_message", eventMessage); - } else if (isListOfFile(eventMessage)) { - for(int i = 0; i< getListSize(eventMessage); i++) { - map.put("event_message[" + i + "]", getFromList(eventMessage, i)); - } + public EventCallbackRequestEventMetadata reportedForAccountId(String reportedForAccountId) { + this.reportedForAccountId = reportedForAccountId; + return this; + } + + /** + * Account ID the event was reported for. + * + * @return reportedForAccountId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReportedForAccountId() { + return reportedForAccountId; + } + + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportedForAccountId(String reportedForAccountId) { + this.reportedForAccountId = reportedForAccountId; + } + + public EventCallbackRequestEventMetadata reportedForAppId(String reportedForAppId) { + this.reportedForAppId = reportedForAppId; + return this; + } + + /** + * App ID the event was reported for. + * + * @return reportedForAppId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReportedForAppId() { + return reportedForAppId; + } + + @JsonProperty(JSON_PROPERTY_REPORTED_FOR_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportedForAppId(String reportedForAppId) { + this.reportedForAppId = reportedForAppId; + } + + public EventCallbackRequestEventMetadata eventMessage(String eventMessage) { + this.eventMessage = eventMessage; + return this; + } + + /** + * Message about a declined or failed (due to error) signature flow. + * + * @return eventMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEventMessage() { + return eventMessage; + } + + @JsonProperty(JSON_PROPERTY_EVENT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventMessage(String eventMessage) { + this.eventMessage = eventMessage; + } + + /** Return true if this EventCallbackRequestEventMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("event_message", JSON.getDefault().getMapper().writeValueAsString(eventMessage)); + if (o == null || getClass() != o.getClass()) { + return false; } + EventCallbackRequestEventMetadata eventCallbackRequestEventMetadata = + (EventCallbackRequestEventMetadata) o; + return Objects.equals( + this.relatedSignatureId, + eventCallbackRequestEventMetadata.relatedSignatureId) + && Objects.equals( + this.reportedForAccountId, + eventCallbackRequestEventMetadata.reportedForAccountId) + && Objects.equals( + this.reportedForAppId, eventCallbackRequestEventMetadata.reportedForAppId) + && Objects.equals( + this.eventMessage, eventCallbackRequestEventMetadata.eventMessage); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + relatedSignatureId, reportedForAccountId, reportedForAppId, eventMessage); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventCallbackRequestEventMetadata {\n"); + sb.append(" relatedSignatureId: ") + .append(toIndentedString(relatedSignatureId)) + .append("\n"); + sb.append(" reportedForAccountId: ") + .append(toIndentedString(reportedForAccountId)) + .append("\n"); + sb.append(" reportedForAppId: ").append(toIndentedString(reportedForAppId)).append("\n"); + sb.append(" eventMessage: ").append(toIndentedString(eventMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (relatedSignatureId != null) { + if (isFileTypeOrListOfFiles(relatedSignatureId)) { + fileTypeFound = true; + } + + if (relatedSignatureId.getClass().equals(java.io.File.class) + || relatedSignatureId.getClass().equals(Integer.class) + || relatedSignatureId.getClass().equals(String.class) + || relatedSignatureId.getClass().isEnum()) { + map.put("related_signature_id", relatedSignatureId); + } else if (isListOfFile(relatedSignatureId)) { + for (int i = 0; i < getListSize(relatedSignatureId); i++) { + map.put( + "related_signature_id[" + i + "]", + getFromList(relatedSignatureId, i)); + } + } else { + map.put( + "related_signature_id", + JSON.getDefault().getMapper().writeValueAsString(relatedSignatureId)); + } + } + if (reportedForAccountId != null) { + if (isFileTypeOrListOfFiles(reportedForAccountId)) { + fileTypeFound = true; + } + + if (reportedForAccountId.getClass().equals(java.io.File.class) + || reportedForAccountId.getClass().equals(Integer.class) + || reportedForAccountId.getClass().equals(String.class) + || reportedForAccountId.getClass().isEnum()) { + map.put("reported_for_account_id", reportedForAccountId); + } else if (isListOfFile(reportedForAccountId)) { + for (int i = 0; i < getListSize(reportedForAccountId); i++) { + map.put( + "reported_for_account_id[" + i + "]", + getFromList(reportedForAccountId, i)); + } + } else { + map.put( + "reported_for_account_id", + JSON.getDefault().getMapper().writeValueAsString(reportedForAccountId)); + } + } + if (reportedForAppId != null) { + if (isFileTypeOrListOfFiles(reportedForAppId)) { + fileTypeFound = true; + } + + if (reportedForAppId.getClass().equals(java.io.File.class) + || reportedForAppId.getClass().equals(Integer.class) + || reportedForAppId.getClass().equals(String.class) + || reportedForAppId.getClass().isEnum()) { + map.put("reported_for_app_id", reportedForAppId); + } else if (isListOfFile(reportedForAppId)) { + for (int i = 0; i < getListSize(reportedForAppId); i++) { + map.put("reported_for_app_id[" + i + "]", getFromList(reportedForAppId, i)); + } + } else { + map.put( + "reported_for_app_id", + JSON.getDefault().getMapper().writeValueAsString(reportedForAppId)); + } + } + if (eventMessage != null) { + if (isFileTypeOrListOfFiles(eventMessage)) { + fileTypeFound = true; + } + + if (eventMessage.getClass().equals(java.io.File.class) + || eventMessage.getClass().equals(Integer.class) + || eventMessage.getClass().equals(String.class) + || eventMessage.getClass().isEnum()) { + map.put("event_message", eventMessage); + } else if (isListOfFile(eventMessage)) { + for (int i = 0; i < getListSize(eventMessage); i++) { + map.put("event_message[" + i + "]", getFromList(eventMessage, i)); + } + } else { + map.put( + "event_message", + JSON.getDefault().getMapper().writeValueAsString(eventMessage)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java index d81de23..f1d8524 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineAddUserRequest.java @@ -10,269 +10,256 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FaxLineAddUserRequest - */ +/** FaxLineAddUserRequest */ @JsonPropertyOrder({ - FaxLineAddUserRequest.JSON_PROPERTY_NUMBER, - FaxLineAddUserRequest.JSON_PROPERTY_ACCOUNT_ID, - FaxLineAddUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + 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) +@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_NUMBER = "number"; + private String number; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - public FaxLineAddUserRequest() { - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - /** - * 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); - } + public FaxLineAddUserRequest() {} - 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) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxLineAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAddUserRequest.class); + } - public String getEmailAddress() { - return emailAddress; - } + public static 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; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } + /** + * 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 FaxLineAddUserRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FaxLineAddUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Account ID + * + * @return accountId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; } - 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); - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } - @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 FaxLineAddUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } + /** + * Email address + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - 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)); - } + /** Return true if this FaxLineAddUserRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + 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); } - 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)); - } + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @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(); } - return fileTypeFound ? map : new HashMap<>(); - } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java index d6ef808..2749d77 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetCountryEnum.java @@ -10,56 +10,42 @@ * 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 - */ +/** Gets or Sets FaxLineAreaCodeGetCountryEnum */ public enum FaxLineAreaCodeGetCountryEnum { - - CA("CA"), - - US("US"), - - UK("UK"); + CA("CA"), + + US("US"), - private String value; + UK("UK"); - FaxLineAreaCodeGetCountryEnum(String value) { - this.value = value; - } + private String value; - @JsonValue - public String getValue() { - return value; - } + FaxLineAreaCodeGetCountryEnum(String value) { + this.value = value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @JsonValue + public String getValue() { + return value; + } - @JsonCreator - public static FaxLineAreaCodeGetCountryEnum fromValue(String value) { - for (FaxLineAreaCodeGetCountryEnum b : FaxLineAreaCodeGetCountryEnum.values()) { - if (b.value.equals(value)) { - return b; - } + @Override + public String toString() { + return String.valueOf(value); } - throw new IllegalArgumentException("Unexpected value '" + 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/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java index 3c0b913..6016ba9 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetProvinceEnum.java @@ -10,76 +10,62 @@ * 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 - */ +/** 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; - } + 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; } - throw new IllegalArgumentException("Unexpected 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/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java index 08c418a..54674a7 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetResponse.java @@ -10,179 +10,171 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -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) +/** 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; + 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 + */ + public static FaxLineAreaCodeGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineAreaCodeGetResponse.class); + } + + public static 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; + } - 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)); - } + /** + * 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; } - else { - map.put("area_codes", JSON.getDefault().getMapper().writeValueAsString(areaCodes)); + 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); } - } catch (Exception e) { - throw new ApiException(e); + + @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(); } - return fileTypeFound ? map : new HashMap<>(); - } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java index c0e5ae4..2e9da9f 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineAreaCodeGetStateEnum.java @@ -10,152 +10,138 @@ * 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 - */ +/** 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; - } + 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; } - throw new IllegalArgumentException("Unexpected value '" + 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/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java index fc864b0..7f18d7b 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineCreateRequest.java @@ -10,356 +10,339 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FaxLineCreateRequest - */ +/** FaxLineCreateRequest */ @JsonPropertyOrder({ - FaxLineCreateRequest.JSON_PROPERTY_AREA_CODE, - FaxLineCreateRequest.JSON_PROPERTY_COUNTRY, - FaxLineCreateRequest.JSON_PROPERTY_CITY, - FaxLineCreateRequest.JSON_PROPERTY_ACCOUNT_ID + 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) +@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; + 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 + "'"); + } } - @JsonValue - public String getValue() { - return 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 + */ + public static FaxLineCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineCreateRequest.class); } - @Override - public String toString() { - return String.valueOf(value); + public static FaxLineCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxLineCreateRequest.class); } - @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 FaxLineCreateRequest areaCode(Integer areaCode) { + this.areaCode = areaCode; + return this; } - } - - 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; + + /** + * Area code + * + * @return areaCode + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getAreaCode() { + return areaCode; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_AREA_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAreaCode(Integer areaCode) { + this.areaCode = areaCode; } - 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)); - } + public FaxLineCreateRequest country(CountryEnum country) { + this.country = country; + return this; } - 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)); - } + /** + * Country + * + * @return country + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CountryEnum getCountry() { + return 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)); - } + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCountry(CountryEnum country) { + this.country = country; } - 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)); - } + 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; } - else { - map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + 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); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(areaCode, country, city, accountId); } - return fileTypeFound ? map : new HashMap<>(); - } + @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(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + 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 Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java index 46946fd..7a7bfdd 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineDeleteRequest.java @@ -10,169 +10,157 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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) +/** 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; + 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 + */ + public static FaxLineDeleteRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineDeleteRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static FaxLineDeleteRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxLineDeleteRequest.class); } - 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)); - } + 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; } - else { - map.put("number", JSON.getDefault().getMapper().writeValueAsString(number)); + if (o == null || getClass() != o.getClass()) { + return false; } + FaxLineDeleteRequest faxLineDeleteRequest = (FaxLineDeleteRequest) o; + return Objects.equals(this.number, faxLineDeleteRequest.number); } - } catch (Exception e) { - throw new ApiException(e); + + @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(); } - return fileTypeFound ? map : new HashMap<>(); - } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java index a6dddb7..9ad9847 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineListResponse.java @@ -10,282 +10,266 @@ * 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.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FaxLineListResponse - */ +/** FaxLineListResponse */ @JsonPropertyOrder({ - FaxLineListResponse.JSON_PROPERTY_LIST_INFO, - FaxLineListResponse.JSON_PROPERTY_FAX_LINES, - FaxLineListResponse.JSON_PROPERTY_WARNINGS + 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) +@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<>(); + 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 + */ + public static FaxLineListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineListResponse.class); } - 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; + + public static FaxLineListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FaxLineListResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public FaxLineListResponse listInfo(ListInfoResponse listInfo) { + this.listInfo = listInfo; + return this; } - 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)); - } + /** + * Get listInfo + * + * @return listInfo + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LIST_INFO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInfoResponse getListInfo() { + return 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)); - } + @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; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public FaxLineListResponse addFaxLinesItem(FaxLineResponseFaxLine faxLinesItem) { + if (this.faxLines == null) { + this.faxLines = new ArrayList<>(); } + this.faxLines.add(faxLinesItem); + return this; + } - 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)); - } + /** + * 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; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + 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); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(listInfo, faxLines, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @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(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java b/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java index 426d991..0347f58 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineRemoveUserRequest.java @@ -10,269 +10,257 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FaxLineRemoveUserRequest - */ +/** FaxLineRemoveUserRequest */ @JsonPropertyOrder({ - FaxLineRemoveUserRequest.JSON_PROPERTY_NUMBER, - FaxLineRemoveUserRequest.JSON_PROPERTY_ACCOUNT_ID, - FaxLineRemoveUserRequest.JSON_PROPERTY_EMAIL_ADDRESS + 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) +@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_NUMBER = "number"; + private String number; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - public FaxLineRemoveUserRequest() { - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - /** - * 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); - } + public FaxLineRemoveUserRequest() {} - 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) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FaxLineRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineRemoveUserRequest.class); + } - public String getEmailAddress() { - return emailAddress; - } + public static 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; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } + /** + * 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 FaxLineRemoveUserRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public FaxLineRemoveUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Account ID + * + * @return accountId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; } - 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); - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; + } - @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 FaxLineRemoveUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (number != null) { - if (isFileTypeOrListOfFiles(number)) { - fileTypeFound = true; - } + /** + * Email address + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - 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)); - } + /** Return true if this FaxLineRemoveUserRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("account_id", JSON.getDefault().getMapper().writeValueAsString(accountId)); + 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); } - 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)); - } + @Override + public int hashCode() { + return Objects.hash(number, accountId, emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @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(); } - return fileTypeFound ? map : new HashMap<>(); - } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineResponse.java b/src/main/java/com/dropbox/sign/model/FaxLineResponse.java index 8e9f3d9..24837c2 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineResponse.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineResponse.java @@ -10,221 +10,202 @@ * 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.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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) +/** 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; - } + public static final String JSON_PROPERTY_FAX_LINE = "fax_line"; + private FaxLineResponseFaxLine faxLine; - 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)); - } + 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 + */ + public static FaxLineResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponse.class); } - 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)); - } + public static 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; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + 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); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(faxLine, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @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(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java b/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java index f721698..63ef50b 100644 --- a/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java +++ b/src/main/java/com/dropbox/sign/model/FaxLineResponseFaxLine.java @@ -10,330 +10,311 @@ * 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.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FaxLineResponseFaxLine - */ +/** FaxLineResponseFaxLine */ @JsonPropertyOrder({ - FaxLineResponseFaxLine.JSON_PROPERTY_NUMBER, - FaxLineResponseFaxLine.JSON_PROPERTY_CREATED_AT, - FaxLineResponseFaxLine.JSON_PROPERTY_UPDATED_AT, - FaxLineResponseFaxLine.JSON_PROPERTY_ACCOUNTS + 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) +@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<>(); + 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 + */ + public static FaxLineResponseFaxLine init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FaxLineResponseFaxLine.class); } - 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; + + public static FaxLineResponseFaxLine init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), FaxLineResponseFaxLine.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public FaxLineResponseFaxLine number(String number) { + this.number = number; + return this; } - 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)); - } + /** + * Number + * + * @return number + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return 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)); - } + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; } - 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)); - } + 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; } - if (accounts != null) { - if (isFileTypeOrListOfFiles(accounts)) { - fileTypeFound = true; + + @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; + } - 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)); - } + /** + * 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; } - else { - map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + 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); } - } catch (Exception e) { - throw new ApiException(e); + + @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(); } - return fileTypeFound ? map : new HashMap<>(); - } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FileResponse.java b/src/main/java/com/dropbox/sign/model/FileResponse.java index fb26048..15282d4 100644 --- a/src/main/java/com/dropbox/sign/model/FileResponse.java +++ b/src/main/java/com/dropbox/sign/model/FileResponse.java @@ -10,219 +10,205 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FileResponse - */ -@JsonPropertyOrder({ - 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) +/** FileResponse */ +@JsonPropertyOrder({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) public class FileResponse { - public static final String JSON_PROPERTY_FILE_URL = "file_url"; - private String fileUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public FileResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public FileResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FileResponse.class); - } - - static public FileResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - FileResponse.class - ); - } - - public FileResponse fileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * URL to the file. - * @return fileUrl - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getFileUrl() { - return fileUrl; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - } - - - public FileResponse expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * When the link expires. - * @return expiresAt - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this FileResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileResponse fileResponse = (FileResponse) o; - return Objects.equals(this.fileUrl, fileResponse.fileUrl) && - Objects.equals(this.expiresAt, fileResponse.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(fileUrl, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileResponse {\n"); - sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (fileUrl != null) { - if (isFileTypeOrListOfFiles(fileUrl)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_FILE_URL = "file_url"; + private String fileUrl; - if (fileUrl.getClass().equals(java.io.File.class) || - fileUrl.getClass().equals(Integer.class) || - fileUrl.getClass().equals(String.class) || - fileUrl.getClass().isEnum()) { - map.put("file_url", fileUrl); - } else if (isListOfFile(fileUrl)) { - for(int i = 0; i< getListSize(fileUrl); i++) { - map.put("file_url[" + i + "]", getFromList(fileUrl, i)); - } - } - else { - map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); - } + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public FileResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FileResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FileResponse.class); } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + public static FileResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FileResponse.class); + } + + public FileResponse fileUrl(String fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * URL to the file. + * + * @return fileUrl + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFileUrl() { + return fileUrl; + } + + @JsonProperty(JSON_PROPERTY_FILE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public FileResponse expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * + * @return expiresAt + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this FileResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + FileResponse fileResponse = (FileResponse) o; + return Objects.equals(this.fileUrl, fileResponse.fileUrl) + && Objects.equals(this.expiresAt, fileResponse.expiresAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(fileUrl, expiresAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileResponse {\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (fileUrl != null) { + if (isFileTypeOrListOfFiles(fileUrl)) { + fileTypeFound = true; + } + + if (fileUrl.getClass().equals(java.io.File.class) + || fileUrl.getClass().equals(Integer.class) + || fileUrl.getClass().equals(String.class) + || fileUrl.getClass().isEnum()) { + map.put("file_url", fileUrl); + } else if (isListOfFile(fileUrl)) { + for (int i = 0; i < getListSize(fileUrl); i++) { + map.put("file_url[" + i + "]", getFromList(fileUrl, i)); + } + } else { + map.put("file_url", JSON.getDefault().getMapper().writeValueAsString(fileUrl)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java b/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java index 0a82c3f..995fca5 100644 --- a/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java +++ b/src/main/java/com/dropbox/sign/model/FileResponseDataUri.java @@ -10,169 +10,157 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * FileResponseDataUri - */ -@JsonPropertyOrder({ - FileResponseDataUri.JSON_PROPERTY_DATA_URI -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** FileResponseDataUri */ +@JsonPropertyOrder({FileResponseDataUri.JSON_PROPERTY_DATA_URI}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class FileResponseDataUri { - public static final String JSON_PROPERTY_DATA_URI = "data_uri"; - private String dataUri; - - public FileResponseDataUri() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public FileResponseDataUri init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, FileResponseDataUri.class); - } - - static public FileResponseDataUri init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - FileResponseDataUri.class - ); - } - - public FileResponseDataUri dataUri(String dataUri) { - this.dataUri = dataUri; - return this; - } - - /** - * File as base64 encoded string. - * @return dataUri - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getDataUri() { - return dataUri; - } - - - @JsonProperty(JSON_PROPERTY_DATA_URI) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDataUri(String dataUri) { - this.dataUri = dataUri; - } - - - /** - * Return true if this FileResponseDataUri object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_DATA_URI = "data_uri"; + private String dataUri; + + public FileResponseDataUri() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static FileResponseDataUri init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, FileResponseDataUri.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static FileResponseDataUri init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), FileResponseDataUri.class); } - FileResponseDataUri fileResponseDataUri = (FileResponseDataUri) o; - return Objects.equals(this.dataUri, fileResponseDataUri.dataUri); - } - - @Override - public int hashCode() { - return Objects.hash(dataUri); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileResponseDataUri {\n"); - sb.append(" dataUri: ").append(toIndentedString(dataUri)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (dataUri != null) { - if (isFileTypeOrListOfFiles(dataUri)) { - fileTypeFound = true; - } - if (dataUri.getClass().equals(java.io.File.class) || - dataUri.getClass().equals(Integer.class) || - dataUri.getClass().equals(String.class) || - dataUri.getClass().isEnum()) { - map.put("data_uri", dataUri); - } else if (isListOfFile(dataUri)) { - for(int i = 0; i< getListSize(dataUri); i++) { - map.put("data_uri[" + i + "]", getFromList(dataUri, i)); - } + public FileResponseDataUri dataUri(String dataUri) { + this.dataUri = dataUri; + return this; + } + + /** + * File as base64 encoded string. + * + * @return dataUri + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATA_URI) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDataUri() { + return dataUri; + } + + @JsonProperty(JSON_PROPERTY_DATA_URI) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDataUri(String dataUri) { + this.dataUri = dataUri; + } + + /** Return true if this FileResponseDataUri object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("data_uri", JSON.getDefault().getMapper().writeValueAsString(dataUri)); + if (o == null || getClass() != o.getClass()) { + return false; } + FileResponseDataUri fileResponseDataUri = (FileResponseDataUri) o; + return Objects.equals(this.dataUri, fileResponseDataUri.dataUri); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(dataUri); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileResponseDataUri {\n"); + sb.append(" dataUri: ").append(toIndentedString(dataUri)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (dataUri != null) { + if (isFileTypeOrListOfFiles(dataUri)) { + fileTypeFound = true; + } + + if (dataUri.getClass().equals(java.io.File.class) + || dataUri.getClass().equals(Integer.class) + || dataUri.getClass().equals(String.class) + || dataUri.getClass().isEnum()) { + map.put("data_uri", dataUri); + } else if (isListOfFile(dataUri)) { + for (int i = 0; i < getListSize(dataUri); i++) { + map.put("data_uri[" + i + "]", getFromList(dataUri, i)); + } + } else { + map.put("data_uri", JSON.getDefault().getMapper().writeValueAsString(dataUri)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ListInfoResponse.java b/src/main/java/com/dropbox/sign/model/ListInfoResponse.java index 05a6ad0..f8647d3 100644 --- a/src/main/java/com/dropbox/sign/model/ListInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/ListInfoResponse.java @@ -10,319 +10,302 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains pagination information about the data returned. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ListInfoResponse { - public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; - private Integer numPages; - - public static final String JSON_PROPERTY_NUM_RESULTS = "num_results"; - private Integer numResults; - - public static final String JSON_PROPERTY_PAGE = "page"; - private Integer page; - - public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; - private Integer pageSize; - - public ListInfoResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ListInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ListInfoResponse.class); - } - - static public ListInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ListInfoResponse.class - ); - } - - public ListInfoResponse numPages(Integer numPages) { - this.numPages = numPages; - return this; - } - - /** - * Total number of pages available. - * @return numPages - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_PAGES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumPages() { - return numPages; - } - - - @JsonProperty(JSON_PROPERTY_NUM_PAGES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumPages(Integer numPages) { - this.numPages = numPages; - } - - - public ListInfoResponse numResults(Integer numResults) { - this.numResults = numResults; - return this; - } - - /** - * Total number of objects available. - * @return numResults - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_RESULTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumResults() { - return numResults; - } - - - @JsonProperty(JSON_PROPERTY_NUM_RESULTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumResults(Integer numResults) { - this.numResults = numResults; - } - - - public ListInfoResponse page(Integer page) { - this.page = page; - return this; - } - - /** - * Number of the page being returned. - * @return page - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPage() { - return page; - } - - - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPage(Integer page) { - this.page = page; - } - - - public ListInfoResponse pageSize(Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Objects returned per page. - * @return pageSize - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAGE_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPageSize() { - return pageSize; - } - - - @JsonProperty(JSON_PROPERTY_PAGE_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageSize(Integer pageSize) { - this.pageSize = pageSize; - } - - - /** - * Return true if this ListInfoResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NUM_PAGES = "num_pages"; + private Integer numPages; + + public static final String JSON_PROPERTY_NUM_RESULTS = "num_results"; + private Integer numResults; + + public static final String JSON_PROPERTY_PAGE = "page"; + private Integer page; + + public static final String JSON_PROPERTY_PAGE_SIZE = "page_size"; + private Integer pageSize; + + public ListInfoResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ListInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ListInfoResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static ListInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ListInfoResponse.class); } - ListInfoResponse listInfoResponse = (ListInfoResponse) o; - return Objects.equals(this.numPages, listInfoResponse.numPages) && - Objects.equals(this.numResults, listInfoResponse.numResults) && - Objects.equals(this.page, listInfoResponse.page) && - Objects.equals(this.pageSize, listInfoResponse.pageSize); - } - - @Override - public int hashCode() { - return Objects.hash(numPages, numResults, page, pageSize); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ListInfoResponse {\n"); - sb.append(" numPages: ").append(toIndentedString(numPages)).append("\n"); - sb.append(" numResults: ").append(toIndentedString(numResults)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (numPages != null) { - if (isFileTypeOrListOfFiles(numPages)) { - fileTypeFound = true; - } - if (numPages.getClass().equals(java.io.File.class) || - numPages.getClass().equals(Integer.class) || - numPages.getClass().equals(String.class) || - numPages.getClass().isEnum()) { - map.put("num_pages", numPages); - } else if (isListOfFile(numPages)) { - for(int i = 0; i< getListSize(numPages); i++) { - map.put("num_pages[" + i + "]", getFromList(numPages, i)); - } - } - else { - map.put("num_pages", JSON.getDefault().getMapper().writeValueAsString(numPages)); - } + public ListInfoResponse numPages(Integer numPages) { + this.numPages = numPages; + return this; } - if (numResults != null) { - if (isFileTypeOrListOfFiles(numResults)) { - fileTypeFound = true; - } - if (numResults.getClass().equals(java.io.File.class) || - numResults.getClass().equals(Integer.class) || - numResults.getClass().equals(String.class) || - numResults.getClass().isEnum()) { - map.put("num_results", numResults); - } else if (isListOfFile(numResults)) { - for(int i = 0; i< getListSize(numResults); i++) { - map.put("num_results[" + i + "]", getFromList(numResults, i)); - } - } - else { - map.put("num_results", JSON.getDefault().getMapper().writeValueAsString(numResults)); - } + /** + * Total number of pages available. + * + * @return numPages + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumPages() { + return numPages; } - if (page != null) { - if (isFileTypeOrListOfFiles(page)) { - fileTypeFound = true; - } - if (page.getClass().equals(java.io.File.class) || - page.getClass().equals(Integer.class) || - page.getClass().equals(String.class) || - page.getClass().isEnum()) { - map.put("page", page); - } else if (isListOfFile(page)) { - for(int i = 0; i< getListSize(page); i++) { - map.put("page[" + i + "]", getFromList(page, i)); - } - } - else { - map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); - } + @JsonProperty(JSON_PROPERTY_NUM_PAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumPages(Integer numPages) { + this.numPages = numPages; } - if (pageSize != null) { - if (isFileTypeOrListOfFiles(pageSize)) { - fileTypeFound = true; - } - if (pageSize.getClass().equals(java.io.File.class) || - pageSize.getClass().equals(Integer.class) || - pageSize.getClass().equals(String.class) || - pageSize.getClass().isEnum()) { - map.put("page_size", pageSize); - } else if (isListOfFile(pageSize)) { - for(int i = 0; i< getListSize(pageSize); i++) { - map.put("page_size[" + i + "]", getFromList(pageSize, i)); - } + public ListInfoResponse numResults(Integer numResults) { + this.numResults = numResults; + return this; + } + + /** + * Total number of objects available. + * + * @return numResults + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumResults() { + return numResults; + } + + @JsonProperty(JSON_PROPERTY_NUM_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumResults(Integer numResults) { + this.numResults = numResults; + } + + public ListInfoResponse page(Integer page) { + this.page = page; + return this; + } + + /** + * Number of the page being returned. + * + * @return page + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPage() { + return page; + } + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPage(Integer page) { + this.page = page; + } + + public ListInfoResponse pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Objects returned per page. + * + * @return pageSize + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPageSize() { + return pageSize; + } + + @JsonProperty(JSON_PROPERTY_PAGE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + /** Return true if this ListInfoResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("page_size", JSON.getDefault().getMapper().writeValueAsString(pageSize)); + if (o == null || getClass() != o.getClass()) { + return false; } + ListInfoResponse listInfoResponse = (ListInfoResponse) o; + return Objects.equals(this.numPages, listInfoResponse.numPages) + && Objects.equals(this.numResults, listInfoResponse.numResults) + && Objects.equals(this.page, listInfoResponse.page) + && Objects.equals(this.pageSize, listInfoResponse.pageSize); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(numPages, numResults, page, pageSize); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInfoResponse {\n"); + sb.append(" numPages: ").append(toIndentedString(numPages)).append("\n"); + sb.append(" numResults: ").append(toIndentedString(numResults)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (numPages != null) { + if (isFileTypeOrListOfFiles(numPages)) { + fileTypeFound = true; + } + + if (numPages.getClass().equals(java.io.File.class) + || numPages.getClass().equals(Integer.class) + || numPages.getClass().equals(String.class) + || numPages.getClass().isEnum()) { + map.put("num_pages", numPages); + } else if (isListOfFile(numPages)) { + for (int i = 0; i < getListSize(numPages); i++) { + map.put("num_pages[" + i + "]", getFromList(numPages, i)); + } + } else { + map.put( + "num_pages", + JSON.getDefault().getMapper().writeValueAsString(numPages)); + } + } + if (numResults != null) { + if (isFileTypeOrListOfFiles(numResults)) { + fileTypeFound = true; + } + + if (numResults.getClass().equals(java.io.File.class) + || numResults.getClass().equals(Integer.class) + || numResults.getClass().equals(String.class) + || numResults.getClass().isEnum()) { + map.put("num_results", numResults); + } else if (isListOfFile(numResults)) { + for (int i = 0; i < getListSize(numResults); i++) { + map.put("num_results[" + i + "]", getFromList(numResults, i)); + } + } else { + map.put( + "num_results", + JSON.getDefault().getMapper().writeValueAsString(numResults)); + } + } + if (page != null) { + if (isFileTypeOrListOfFiles(page)) { + fileTypeFound = true; + } + + if (page.getClass().equals(java.io.File.class) + || page.getClass().equals(Integer.class) + || page.getClass().equals(String.class) + || page.getClass().isEnum()) { + map.put("page", page); + } else if (isListOfFile(page)) { + for (int i = 0; i < getListSize(page); i++) { + map.put("page[" + i + "]", getFromList(page, i)); + } + } else { + map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); + } + } + if (pageSize != null) { + if (isFileTypeOrListOfFiles(pageSize)) { + fileTypeFound = true; + } + + if (pageSize.getClass().equals(java.io.File.class) + || pageSize.getClass().equals(Integer.class) + || pageSize.getClass().equals(String.class) + || pageSize.getClass().isEnum()) { + map.put("page_size", pageSize); + } else if (isListOfFile(pageSize)) { + for (int i = 0; i < getListSize(pageSize); i++) { + map.put("page_size[" + i + "]", getFromList(pageSize, i)); + } + } else { + map.put( + "page_size", + JSON.getDefault().getMapper().writeValueAsString(pageSize)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java b/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java index abb0f74..b3dd4a1 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenGenerateRequest.java @@ -10,369 +10,355 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * OAuthTokenGenerateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class OAuthTokenGenerateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; - - public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; - private String clientSecret; - - public static final String JSON_PROPERTY_CODE = "code"; - private String code; - - public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; - private String grantType = "authorization_code"; - - public static final String JSON_PROPERTY_STATE = "state"; - private String state; - - public OAuthTokenGenerateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public OAuthTokenGenerateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenGenerateRequest.class); - } - - static public OAuthTokenGenerateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - OAuthTokenGenerateRequest.class - ); - } - - public OAuthTokenGenerateRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * The client id of the app requesting authorization. - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public OAuthTokenGenerateRequest clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * The secret token of your app. - * @return clientSecret - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClientSecret() { - return clientSecret; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - - public OAuthTokenGenerateRequest code(String code) { - this.code = code; - return this; - } - - /** - * The code passed to your callback when the user granted access. - * @return code - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getCode() { - return code; - } - - - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCode(String code) { - this.code = code; - } - - - public OAuthTokenGenerateRequest grantType(String grantType) { - this.grantType = grantType; - return this; - } - - /** - * When generating a new token use `authorization_code`. - * @return grantType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGrantType() { - return grantType; - } - - - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGrantType(String grantType) { - this.grantType = grantType; - } - - - public OAuthTokenGenerateRequest state(String state) { - this.state = state; - return this; - } - - /** - * Same as the state you specified earlier. - * @return state - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getState() { - return state; - } - - - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setState(String state) { - this.state = state; - } - - - /** - * Return true if this OAuthTokenGenerateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_CLIENT_SECRET = "client_secret"; + private String clientSecret; + + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + private String grantType = "authorization_code"; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public OAuthTokenGenerateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static OAuthTokenGenerateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenGenerateRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static OAuthTokenGenerateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + OAuthTokenGenerateRequest.class); } - OAuthTokenGenerateRequest oauthTokenGenerateRequest = (OAuthTokenGenerateRequest) o; - return Objects.equals(this.clientId, oauthTokenGenerateRequest.clientId) && - Objects.equals(this.clientSecret, oauthTokenGenerateRequest.clientSecret) && - Objects.equals(this.code, oauthTokenGenerateRequest.code) && - Objects.equals(this.grantType, oauthTokenGenerateRequest.grantType) && - Objects.equals(this.state, oauthTokenGenerateRequest.state); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, clientSecret, code, grantType, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenGenerateRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + public OAuthTokenGenerateRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (clientSecret != null) { - if (isFileTypeOrListOfFiles(clientSecret)) { - fileTypeFound = true; - } - if (clientSecret.getClass().equals(java.io.File.class) || - clientSecret.getClass().equals(Integer.class) || - clientSecret.getClass().equals(String.class) || - clientSecret.getClass().isEnum()) { - map.put("client_secret", clientSecret); - } else if (isListOfFile(clientSecret)) { - for(int i = 0; i< getListSize(clientSecret); i++) { - map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); - } - } - else { - map.put("client_secret", JSON.getDefault().getMapper().writeValueAsString(clientSecret)); - } + /** + * The client id of the app requesting authorization. + * + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; } - if (code != null) { - if (isFileTypeOrListOfFiles(code)) { - fileTypeFound = true; - } - if (code.getClass().equals(java.io.File.class) || - code.getClass().equals(Integer.class) || - code.getClass().equals(String.class) || - code.getClass().isEnum()) { - map.put("code", code); - } else if (isListOfFile(code)) { - for(int i = 0; i< getListSize(code); i++) { - map.put("code[" + i + "]", getFromList(code, i)); - } - } - else { - map.put("code", JSON.getDefault().getMapper().writeValueAsString(code)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (grantType != null) { - if (isFileTypeOrListOfFiles(grantType)) { - fileTypeFound = true; - } - if (grantType.getClass().equals(java.io.File.class) || - grantType.getClass().equals(Integer.class) || - grantType.getClass().equals(String.class) || - grantType.getClass().isEnum()) { - map.put("grant_type", grantType); - } else if (isListOfFile(grantType)) { - for(int i = 0; i< getListSize(grantType); i++) { - map.put("grant_type[" + i + "]", getFromList(grantType, i)); - } - } - else { - map.put("grant_type", JSON.getDefault().getMapper().writeValueAsString(grantType)); - } + public OAuthTokenGenerateRequest clientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; } - if (state != null) { - if (isFileTypeOrListOfFiles(state)) { - fileTypeFound = true; - } - if (state.getClass().equals(java.io.File.class) || - state.getClass().equals(Integer.class) || - state.getClass().equals(String.class) || - state.getClass().isEnum()) { - map.put("state", state); - } else if (isListOfFile(state)) { - for(int i = 0; i< getListSize(state); i++) { - map.put("state[" + i + "]", getFromList(state, i)); - } + /** + * The secret token of your app. + * + * @return clientSecret + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientSecret() { + return clientSecret; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_SECRET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public OAuthTokenGenerateRequest code(String code) { + this.code = code; + return this; + } + + /** + * The code passed to your callback when the user granted access. + * + * @return code + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCode() { + return code; + } + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(String code) { + this.code = code; + } + + public OAuthTokenGenerateRequest grantType(String grantType) { + this.grantType = grantType; + return this; + } + + /** + * When generating a new token use `authorization_code`. + * + * @return grantType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGrantType() { + return grantType; + } + + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGrantType(String grantType) { + this.grantType = grantType; + } + + public OAuthTokenGenerateRequest state(String state) { + this.state = state; + return this; + } + + /** + * Same as the state you specified earlier. + * + * @return state + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setState(String state) { + this.state = state; + } + + /** Return true if this OAuthTokenGenerateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenGenerateRequest oauthTokenGenerateRequest = (OAuthTokenGenerateRequest) o; + return Objects.equals(this.clientId, oauthTokenGenerateRequest.clientId) + && Objects.equals(this.clientSecret, oauthTokenGenerateRequest.clientSecret) + && Objects.equals(this.code, oauthTokenGenerateRequest.code) + && Objects.equals(this.grantType, oauthTokenGenerateRequest.grantType) + && Objects.equals(this.state, oauthTokenGenerateRequest.state); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, code, grantType, state); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenGenerateRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (clientSecret != null) { + if (isFileTypeOrListOfFiles(clientSecret)) { + fileTypeFound = true; + } + + if (clientSecret.getClass().equals(java.io.File.class) + || clientSecret.getClass().equals(Integer.class) + || clientSecret.getClass().equals(String.class) + || clientSecret.getClass().isEnum()) { + map.put("client_secret", clientSecret); + } else if (isListOfFile(clientSecret)) { + for (int i = 0; i < getListSize(clientSecret); i++) { + map.put("client_secret[" + i + "]", getFromList(clientSecret, i)); + } + } else { + map.put( + "client_secret", + JSON.getDefault().getMapper().writeValueAsString(clientSecret)); + } + } + if (code != null) { + if (isFileTypeOrListOfFiles(code)) { + fileTypeFound = true; + } + + if (code.getClass().equals(java.io.File.class) + || code.getClass().equals(Integer.class) + || code.getClass().equals(String.class) + || code.getClass().isEnum()) { + map.put("code", code); + } else if (isListOfFile(code)) { + for (int i = 0; i < getListSize(code); i++) { + map.put("code[" + i + "]", getFromList(code, i)); + } + } else { + map.put("code", JSON.getDefault().getMapper().writeValueAsString(code)); + } + } + if (grantType != null) { + if (isFileTypeOrListOfFiles(grantType)) { + fileTypeFound = true; + } + + if (grantType.getClass().equals(java.io.File.class) + || grantType.getClass().equals(Integer.class) + || grantType.getClass().equals(String.class) + || grantType.getClass().isEnum()) { + map.put("grant_type", grantType); + } else if (isListOfFile(grantType)) { + for (int i = 0; i < getListSize(grantType); i++) { + map.put("grant_type[" + i + "]", getFromList(grantType, i)); + } + } else { + map.put( + "grant_type", + JSON.getDefault().getMapper().writeValueAsString(grantType)); + } + } + if (state != null) { + if (isFileTypeOrListOfFiles(state)) { + fileTypeFound = true; + } + + if (state.getClass().equals(java.io.File.class) + || state.getClass().equals(Integer.class) + || state.getClass().equals(String.class) + || state.getClass().isEnum()) { + map.put("state", state); + } else if (isListOfFile(state)) { + for (int i = 0; i < getListSize(state); i++) { + map.put("state[" + i + "]", getFromList(state, i)); + } + } else { + map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index 4e9e198..6aa0a05 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -10,219 +10,212 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * OAuthTokenRefreshRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class OAuthTokenRefreshRequest { - public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; - private String grantType = "refresh_token"; - - public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; - private String refreshToken; - - public OAuthTokenRefreshRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public OAuthTokenRefreshRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenRefreshRequest.class); - } - - static public OAuthTokenRefreshRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - OAuthTokenRefreshRequest.class - ); - } - - public OAuthTokenRefreshRequest grantType(String grantType) { - this.grantType = grantType; - return this; - } - - /** - * When refreshing an existing token use `refresh_token`. - * @return grantType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGrantType() { - return grantType; - } - - - @JsonProperty(JSON_PROPERTY_GRANT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGrantType(String grantType) { - this.grantType = grantType; - } - - - public OAuthTokenRefreshRequest refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * The token provided when you got the expired access token. - * @return refreshToken - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getRefreshToken() { - return refreshToken; - } - - - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - - /** - * Return true if this OAuthTokenRefreshRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthTokenRefreshRequest oauthTokenRefreshRequest = (OAuthTokenRefreshRequest) o; - return Objects.equals(this.grantType, oauthTokenRefreshRequest.grantType) && - Objects.equals(this.refreshToken, oauthTokenRefreshRequest.refreshToken); - } - - @Override - public int hashCode() { - return Objects.hash(grantType, refreshToken); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenRefreshRequest {\n"); - sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (grantType != null) { - if (isFileTypeOrListOfFiles(grantType)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; + private String grantType = "refresh_token"; - if (grantType.getClass().equals(java.io.File.class) || - grantType.getClass().equals(Integer.class) || - grantType.getClass().equals(String.class) || - grantType.getClass().isEnum()) { - map.put("grant_type", grantType); - } else if (isListOfFile(grantType)) { - for(int i = 0; i< getListSize(grantType); i++) { - map.put("grant_type[" + i + "]", getFromList(grantType, i)); - } - } - else { - map.put("grant_type", JSON.getDefault().getMapper().writeValueAsString(grantType)); - } + public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; + private String refreshToken; + + public OAuthTokenRefreshRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static OAuthTokenRefreshRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenRefreshRequest.class); } - if (refreshToken != null) { - if (isFileTypeOrListOfFiles(refreshToken)) { - fileTypeFound = true; - } - if (refreshToken.getClass().equals(java.io.File.class) || - refreshToken.getClass().equals(Integer.class) || - refreshToken.getClass().equals(String.class) || - refreshToken.getClass().isEnum()) { - map.put("refresh_token", refreshToken); - } else if (isListOfFile(refreshToken)) { - for(int i = 0; i< getListSize(refreshToken); i++) { - map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); - } + public static OAuthTokenRefreshRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + OAuthTokenRefreshRequest.class); + } + + public OAuthTokenRefreshRequest grantType(String grantType) { + this.grantType = grantType; + return this; + } + + /** + * When refreshing an existing token use `refresh_token`. + * + * @return grantType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGrantType() { + return grantType; + } + + @JsonProperty(JSON_PROPERTY_GRANT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGrantType(String grantType) { + this.grantType = grantType; + } + + public OAuthTokenRefreshRequest refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The token provided when you got the expired access token. + * + * @return refreshToken + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRefreshToken() { + return refreshToken; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + /** Return true if this OAuthTokenRefreshRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("refresh_token", JSON.getDefault().getMapper().writeValueAsString(refreshToken)); + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenRefreshRequest oauthTokenRefreshRequest = (OAuthTokenRefreshRequest) o; + return Objects.equals(this.grantType, oauthTokenRefreshRequest.grantType) + && Objects.equals(this.refreshToken, oauthTokenRefreshRequest.refreshToken); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(grantType, refreshToken); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenRefreshRequest {\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (grantType != null) { + if (isFileTypeOrListOfFiles(grantType)) { + fileTypeFound = true; + } + + if (grantType.getClass().equals(java.io.File.class) + || grantType.getClass().equals(Integer.class) + || grantType.getClass().equals(String.class) + || grantType.getClass().isEnum()) { + map.put("grant_type", grantType); + } else if (isListOfFile(grantType)) { + for (int i = 0; i < getListSize(grantType); i++) { + map.put("grant_type[" + i + "]", getFromList(grantType, i)); + } + } else { + map.put( + "grant_type", + JSON.getDefault().getMapper().writeValueAsString(grantType)); + } + } + if (refreshToken != null) { + if (isFileTypeOrListOfFiles(refreshToken)) { + fileTypeFound = true; + } + + if (refreshToken.getClass().equals(java.io.File.class) + || refreshToken.getClass().equals(Integer.class) + || refreshToken.getClass().equals(String.class) + || refreshToken.getClass().isEnum()) { + map.put("refresh_token", refreshToken); + } else if (isListOfFile(refreshToken)) { + for (int i = 0; i < getListSize(refreshToken); i++) { + map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); + } + } else { + map.put( + "refresh_token", + JSON.getDefault().getMapper().writeValueAsString(refreshToken)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java b/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java index 7ec43ce..f7392f3 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenResponse.java @@ -10,369 +10,350 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * OAuthTokenResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class OAuthTokenResponse { - public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; - private String accessToken; - - public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; - private String tokenType; - - public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; - private String refreshToken; - - public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; - private Integer expiresIn; - - public static final String JSON_PROPERTY_STATE = "state"; - private String state; - - public OAuthTokenResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public OAuthTokenResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, OAuthTokenResponse.class); - } - - static public OAuthTokenResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - OAuthTokenResponse.class - ); - } - - public OAuthTokenResponse accessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Get accessToken - * @return accessToken - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getAccessToken() { - return accessToken; - } - - - @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - - public OAuthTokenResponse tokenType(String tokenType) { - this.tokenType = tokenType; - return this; - } - - /** - * Get tokenType - * @return tokenType - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTokenType() { - return tokenType; - } - - - @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTokenType(String tokenType) { - this.tokenType = tokenType; - } - - - public OAuthTokenResponse refreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get refreshToken - * @return refreshToken - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRefreshToken() { - return refreshToken; - } - - - @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - - public OAuthTokenResponse expiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - /** - * Number of seconds until the `access_token` expires. Uses epoch time. - * @return expiresIn - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_IN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresIn() { - return expiresIn; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_IN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresIn(Integer expiresIn) { - this.expiresIn = expiresIn; - } - - - public OAuthTokenResponse state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getState() { - return state; - } - - - @JsonProperty(JSON_PROPERTY_STATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(String state) { - this.state = state; - } - - - /** - * Return true if this OAuthTokenResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + private String accessToken; + + public static final String JSON_PROPERTY_TOKEN_TYPE = "token_type"; + private String tokenType; + + public static final String JSON_PROPERTY_REFRESH_TOKEN = "refresh_token"; + private String refreshToken; + + public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; + private Integer expiresIn; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public OAuthTokenResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static OAuthTokenResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, OAuthTokenResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static OAuthTokenResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), OAuthTokenResponse.class); } - OAuthTokenResponse oauthTokenResponse = (OAuthTokenResponse) o; - return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) && - Objects.equals(this.tokenType, oauthTokenResponse.tokenType) && - Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) && - Objects.equals(this.expiresIn, oauthTokenResponse.expiresIn) && - Objects.equals(this.state, oauthTokenResponse.state); - } - - @Override - public int hashCode() { - return Objects.hash(accessToken, tokenType, refreshToken, expiresIn, state); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthTokenResponse {\n"); - sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); - sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); - sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); - sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accessToken != null) { - if (isFileTypeOrListOfFiles(accessToken)) { - fileTypeFound = true; - } - if (accessToken.getClass().equals(java.io.File.class) || - accessToken.getClass().equals(Integer.class) || - accessToken.getClass().equals(String.class) || - accessToken.getClass().isEnum()) { - map.put("access_token", accessToken); - } else if (isListOfFile(accessToken)) { - for(int i = 0; i< getListSize(accessToken); i++) { - map.put("access_token[" + i + "]", getFromList(accessToken, i)); - } - } - else { - map.put("access_token", JSON.getDefault().getMapper().writeValueAsString(accessToken)); - } + public OAuthTokenResponse accessToken(String accessToken) { + this.accessToken = accessToken; + return this; } - if (tokenType != null) { - if (isFileTypeOrListOfFiles(tokenType)) { - fileTypeFound = true; - } - if (tokenType.getClass().equals(java.io.File.class) || - tokenType.getClass().equals(Integer.class) || - tokenType.getClass().equals(String.class) || - tokenType.getClass().isEnum()) { - map.put("token_type", tokenType); - } else if (isListOfFile(tokenType)) { - for(int i = 0; i< getListSize(tokenType); i++) { - map.put("token_type[" + i + "]", getFromList(tokenType, i)); - } - } - else { - map.put("token_type", JSON.getDefault().getMapper().writeValueAsString(tokenType)); - } + /** + * Get accessToken + * + * @return accessToken + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccessToken() { + return accessToken; } - if (refreshToken != null) { - if (isFileTypeOrListOfFiles(refreshToken)) { - fileTypeFound = true; - } - if (refreshToken.getClass().equals(java.io.File.class) || - refreshToken.getClass().equals(Integer.class) || - refreshToken.getClass().equals(String.class) || - refreshToken.getClass().isEnum()) { - map.put("refresh_token", refreshToken); - } else if (isListOfFile(refreshToken)) { - for(int i = 0; i< getListSize(refreshToken); i++) { - map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); - } - } - else { - map.put("refresh_token", JSON.getDefault().getMapper().writeValueAsString(refreshToken)); - } + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; } - if (expiresIn != null) { - if (isFileTypeOrListOfFiles(expiresIn)) { - fileTypeFound = true; - } - if (expiresIn.getClass().equals(java.io.File.class) || - expiresIn.getClass().equals(Integer.class) || - expiresIn.getClass().equals(String.class) || - expiresIn.getClass().isEnum()) { - map.put("expires_in", expiresIn); - } else if (isListOfFile(expiresIn)) { - for(int i = 0; i< getListSize(expiresIn); i++) { - map.put("expires_in[" + i + "]", getFromList(expiresIn, i)); - } - } - else { - map.put("expires_in", JSON.getDefault().getMapper().writeValueAsString(expiresIn)); - } + public OAuthTokenResponse tokenType(String tokenType) { + this.tokenType = tokenType; + return this; } - if (state != null) { - if (isFileTypeOrListOfFiles(state)) { - fileTypeFound = true; - } - if (state.getClass().equals(java.io.File.class) || - state.getClass().equals(Integer.class) || - state.getClass().equals(String.class) || - state.getClass().isEnum()) { - map.put("state", state); - } else if (isListOfFile(state)) { - for(int i = 0; i< getListSize(state); i++) { - map.put("state[" + i + "]", getFromList(state, i)); - } + /** + * Get tokenType + * + * @return tokenType + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTokenType() { + return tokenType; + } + + @JsonProperty(JSON_PROPERTY_TOKEN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenType(String tokenType) { + this.tokenType = tokenType; + } + + public OAuthTokenResponse refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get refreshToken + * + * @return refreshToken + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRefreshToken() { + return refreshToken; + } + + @JsonProperty(JSON_PROPERTY_REFRESH_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public OAuthTokenResponse expiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Number of seconds until the `access_token` expires. Uses epoch time. + * + * @return expiresIn + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresIn() { + return expiresIn; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + } + + public OAuthTokenResponse state(String state) { + this.state = state; + return this; + } + + /** + * Get state + * + * @return state + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getState() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(String state) { + this.state = state; + } + + /** Return true if this OAuthTokenResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + if (o == null || getClass() != o.getClass()) { + return false; } + OAuthTokenResponse oauthTokenResponse = (OAuthTokenResponse) o; + return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) + && Objects.equals(this.tokenType, oauthTokenResponse.tokenType) + && Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) + && Objects.equals(this.expiresIn, oauthTokenResponse.expiresIn) + && Objects.equals(this.state, oauthTokenResponse.state); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenType, refreshToken, expiresIn, state); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (accessToken != null) { + if (isFileTypeOrListOfFiles(accessToken)) { + fileTypeFound = true; + } + + if (accessToken.getClass().equals(java.io.File.class) + || accessToken.getClass().equals(Integer.class) + || accessToken.getClass().equals(String.class) + || accessToken.getClass().isEnum()) { + map.put("access_token", accessToken); + } else if (isListOfFile(accessToken)) { + for (int i = 0; i < getListSize(accessToken); i++) { + map.put("access_token[" + i + "]", getFromList(accessToken, i)); + } + } else { + map.put( + "access_token", + JSON.getDefault().getMapper().writeValueAsString(accessToken)); + } + } + if (tokenType != null) { + if (isFileTypeOrListOfFiles(tokenType)) { + fileTypeFound = true; + } + + if (tokenType.getClass().equals(java.io.File.class) + || tokenType.getClass().equals(Integer.class) + || tokenType.getClass().equals(String.class) + || tokenType.getClass().isEnum()) { + map.put("token_type", tokenType); + } else if (isListOfFile(tokenType)) { + for (int i = 0; i < getListSize(tokenType); i++) { + map.put("token_type[" + i + "]", getFromList(tokenType, i)); + } + } else { + map.put( + "token_type", + JSON.getDefault().getMapper().writeValueAsString(tokenType)); + } + } + if (refreshToken != null) { + if (isFileTypeOrListOfFiles(refreshToken)) { + fileTypeFound = true; + } + + if (refreshToken.getClass().equals(java.io.File.class) + || refreshToken.getClass().equals(Integer.class) + || refreshToken.getClass().equals(String.class) + || refreshToken.getClass().isEnum()) { + map.put("refresh_token", refreshToken); + } else if (isListOfFile(refreshToken)) { + for (int i = 0; i < getListSize(refreshToken); i++) { + map.put("refresh_token[" + i + "]", getFromList(refreshToken, i)); + } + } else { + map.put( + "refresh_token", + JSON.getDefault().getMapper().writeValueAsString(refreshToken)); + } + } + if (expiresIn != null) { + if (isFileTypeOrListOfFiles(expiresIn)) { + fileTypeFound = true; + } + + if (expiresIn.getClass().equals(java.io.File.class) + || expiresIn.getClass().equals(Integer.class) + || expiresIn.getClass().equals(String.class) + || expiresIn.getClass().isEnum()) { + map.put("expires_in", expiresIn); + } else if (isListOfFile(expiresIn)) { + for (int i = 0; i < getListSize(expiresIn); i++) { + map.put("expires_in[" + i + "]", getFromList(expiresIn, i)); + } + } else { + map.put( + "expires_in", + JSON.getDefault().getMapper().writeValueAsString(expiresIn)); + } + } + if (state != null) { + if (isFileTypeOrListOfFiles(state)) { + fileTypeFound = true; + } + + if (state.getClass().equals(java.io.File.class) + || state.getClass().equals(Integer.class) + || state.getClass().equals(String.class) + || state.getClass().isEnum()) { + map.put("state", state); + } else if (isListOfFile(state)) { + for (int i = 0; i < getListSize(state); i++) { + map.put("state[" + i + "]", getFromList(state, i)); + } + } else { + map.put("state", JSON.getDefault().getMapper().writeValueAsString(state)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index f156dfb..293fd15 100644 --- a/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -10,314 +10,305 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * ReportCreateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ReportCreateRequest { - public static final String JSON_PROPERTY_END_DATE = "end_date"; - private String endDate; + public static final String JSON_PROPERTY_END_DATE = "end_date"; + private String endDate; + + /** Gets or Sets reportType */ + public enum ReportTypeEnum { + USER_ACTIVITY("user_activity"), + + DOCUMENT_STATUS("document_status"); + + private String value; - /** - * Gets or Sets reportType - */ - public enum ReportTypeEnum { - USER_ACTIVITY("user_activity"), - - DOCUMENT_STATUS("document_status"); + ReportTypeEnum(String value) { + this.value = value; + } - private String value; + @JsonValue + public String getValue() { + return value; + } - ReportTypeEnum(String value) { - this.value = value; + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ReportTypeEnum fromValue(String value) { + for (ReportTypeEnum b : ReportTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; + private List reportType = new ArrayList<>(); + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private String startDate; + + public ReportCreateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ReportCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportCreateRequest.class); } - @Override - public String toString() { - return String.valueOf(value); + public static ReportCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ReportCreateRequest.class); } - @JsonCreator - public static ReportTypeEnum fromValue(String value) { - for (ReportTypeEnum b : ReportTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public ReportCreateRequest endDate(String endDate) { + this.endDate = endDate; + return this; } - } - - public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - private List reportType = new ArrayList<>(); - - public static final String JSON_PROPERTY_START_DATE = "start_date"; - private String startDate; - - public ReportCreateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ReportCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportCreateRequest.class); - } - - static public ReportCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ReportCreateRequest.class - ); - } - - public ReportCreateRequest endDate(String endDate) { - this.endDate = endDate; - return this; - } - - /** - * The (inclusive) end date for the report data in `MM/DD/YYYY` format. - * @return endDate - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEndDate() { - return endDate; - } - - - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - - public ReportCreateRequest reportType(List reportType) { - this.reportType = reportType; - return this; - } - - public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { - if (this.reportType == null) { - this.reportType = new ArrayList<>(); + + /** + * The (inclusive) end date for the report data in `MM/DD/YYYY` format. + * + * @return endDate + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEndDate() { + return endDate; } - 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 - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getReportType() { - return reportType; - } - - - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setReportType(List reportType) { - this.reportType = reportType; - } - - - public ReportCreateRequest startDate(String startDate) { - this.startDate = startDate; - return this; - } - - /** - * The (inclusive) start date for the report data in `MM/DD/YYYY` format. - * @return startDate - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getStartDate() { - return startDate; - } - - - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - - /** - * Return true if this ReportCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEndDate(String endDate) { + this.endDate = endDate; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ReportCreateRequest reportType(List reportType) { + this.reportType = reportType; + return this; } - ReportCreateRequest reportCreateRequest = (ReportCreateRequest) o; - return Objects.equals(this.endDate, reportCreateRequest.endDate) && - Objects.equals(this.reportType, reportCreateRequest.reportType) && - Objects.equals(this.startDate, reportCreateRequest.startDate); - } - - @Override - public int hashCode() { - return Objects.hash(endDate, reportType, startDate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportCreateRequest {\n"); - sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); - sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); - sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (endDate != null) { - if (isFileTypeOrListOfFiles(endDate)) { - fileTypeFound = true; - } - if (endDate.getClass().equals(java.io.File.class) || - endDate.getClass().equals(Integer.class) || - endDate.getClass().equals(String.class) || - endDate.getClass().isEnum()) { - map.put("end_date", endDate); - } else if (isListOfFile(endDate)) { - for(int i = 0; i< getListSize(endDate); i++) { - map.put("end_date[" + i + "]", getFromList(endDate, i)); - } - } - else { - map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); + public ReportCreateRequest addReportTypeItem(ReportTypeEnum reportTypeItem) { + if (this.reportType == null) { + this.reportType = new ArrayList<>(); } + this.reportType.add(reportTypeItem); + return this; } - if (reportType != null) { - if (isFileTypeOrListOfFiles(reportType)) { - fileTypeFound = true; - } - if (reportType.getClass().equals(java.io.File.class) || - reportType.getClass().equals(Integer.class) || - reportType.getClass().equals(String.class) || - reportType.getClass().isEnum()) { - map.put("report_type", reportType); - } else if (isListOfFile(reportType)) { - for(int i = 0; i< getListSize(reportType); i++) { - map.put("report_type[" + i + "]", getFromList(reportType, i)); - } - } - else { - map.put("report_type", JSON.getDefault().getMapper().writeValueAsString(reportType)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getReportType() { + return reportType; } - if (startDate != null) { - if (isFileTypeOrListOfFiles(startDate)) { - fileTypeFound = true; - } - if (startDate.getClass().equals(java.io.File.class) || - startDate.getClass().equals(Integer.class) || - startDate.getClass().equals(String.class) || - startDate.getClass().isEnum()) { - map.put("start_date", startDate); - } else if (isListOfFile(startDate)) { - for(int i = 0; i< getListSize(startDate); i++) { - map.put("start_date[" + i + "]", getFromList(startDate, i)); - } + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReportType(List reportType) { + this.reportType = reportType; + } + + public ReportCreateRequest startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The (inclusive) start date for the report data in `MM/DD/YYYY` format. + * + * @return startDate + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStartDate() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + /** Return true if this ReportCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("start_date", JSON.getDefault().getMapper().writeValueAsString(startDate)); + if (o == null || getClass() != o.getClass()) { + return false; } + ReportCreateRequest reportCreateRequest = (ReportCreateRequest) o; + return Objects.equals(this.endDate, reportCreateRequest.endDate) + && Objects.equals(this.reportType, reportCreateRequest.reportType) + && Objects.equals(this.startDate, reportCreateRequest.startDate); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(endDate, reportType, startDate); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCreateRequest {\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (endDate != null) { + if (isFileTypeOrListOfFiles(endDate)) { + fileTypeFound = true; + } + + if (endDate.getClass().equals(java.io.File.class) + || endDate.getClass().equals(Integer.class) + || endDate.getClass().equals(String.class) + || endDate.getClass().isEnum()) { + map.put("end_date", endDate); + } else if (isListOfFile(endDate)) { + for (int i = 0; i < getListSize(endDate); i++) { + map.put("end_date[" + i + "]", getFromList(endDate, i)); + } + } else { + map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); + } + } + if (reportType != null) { + if (isFileTypeOrListOfFiles(reportType)) { + fileTypeFound = true; + } + + if (reportType.getClass().equals(java.io.File.class) + || reportType.getClass().equals(Integer.class) + || reportType.getClass().equals(String.class) + || reportType.getClass().isEnum()) { + map.put("report_type", reportType); + } else if (isListOfFile(reportType)) { + for (int i = 0; i < getListSize(reportType); i++) { + map.put("report_type[" + i + "]", getFromList(reportType, i)); + } + } else { + map.put( + "report_type", + JSON.getDefault().getMapper().writeValueAsString(reportType)); + } + } + if (startDate != null) { + if (isFileTypeOrListOfFiles(startDate)) { + fileTypeFound = true; + } + + if (startDate.getClass().equals(java.io.File.class) + || startDate.getClass().equals(Integer.class) + || startDate.getClass().equals(String.class) + || startDate.getClass().isEnum()) { + map.put("start_date", startDate); + } else if (isListOfFile(startDate)) { + for (int i = 0; i < getListSize(startDate); i++) { + map.put("start_date[" + i + "]", getFromList(startDate, i)); + } + } else { + map.put( + "start_date", + JSON.getDefault().getMapper().writeValueAsString(startDate)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java b/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java index 21c5aa4..526daf0 100644 --- a/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/ReportCreateResponse.java @@ -10,231 +10,215 @@ * 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.ReportResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * ReportCreateResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public ReportCreateResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ReportCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportCreateResponse.class); - } - - static public ReportCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ReportCreateResponse.class - ); - } - - public ReportCreateResponse report(ReportResponse report) { - this.report = report; - return this; - } - - /** - * Get report - * @return report - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ReportResponse getReport() { - return report; - } - - - @JsonProperty(JSON_PROPERTY_REPORT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setReport(ReportResponse report) { - this.report = report; - } - - - public ReportCreateResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this ReportCreateResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReportCreateResponse reportCreateResponse = (ReportCreateResponse) o; - return Objects.equals(this.report, reportCreateResponse.report) && - Objects.equals(this.warnings, reportCreateResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(report, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportCreateResponse {\n"); - sb.append(" report: ").append(toIndentedString(report)).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 (report != null) { - if (isFileTypeOrListOfFiles(report)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_REPORT = "report"; + private ReportResponse report; - if (report.getClass().equals(java.io.File.class) || - report.getClass().equals(Integer.class) || - report.getClass().equals(String.class) || - report.getClass().isEnum()) { - map.put("report", report); - } else if (isListOfFile(report)) { - for(int i = 0; i< getListSize(report); i++) { - map.put("report[" + i + "]", getFromList(report, i)); - } - } - else { - map.put("report", JSON.getDefault().getMapper().writeValueAsString(report)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public ReportCreateResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ReportCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportCreateResponse.class); + } + + public static ReportCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ReportCreateResponse.class); + } + + public ReportCreateResponse report(ReportResponse report) { + this.report = report; + return this; + } + + /** + * Get report + * + * @return report + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REPORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReportResponse getReport() { + return report; + } + + @JsonProperty(JSON_PROPERTY_REPORT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setReport(ReportResponse report) { + this.report = report; + } + + public ReportCreateResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public ReportCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this ReportCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + ReportCreateResponse reportCreateResponse = (ReportCreateResponse) o; + return Objects.equals(this.report, reportCreateResponse.report) + && Objects.equals(this.warnings, reportCreateResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(report, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportCreateResponse {\n"); + sb.append(" report: ").append(toIndentedString(report)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (report != null) { + if (isFileTypeOrListOfFiles(report)) { + fileTypeFound = true; + } + + if (report.getClass().equals(java.io.File.class) + || report.getClass().equals(Integer.class) + || report.getClass().equals(String.class) + || report.getClass().isEnum()) { + map.put("report", report); + } else if (isListOfFile(report)) { + for (int i = 0; i < getListSize(report); i++) { + map.put("report[" + i + "]", getFromList(report, i)); + } + } else { + map.put("report", JSON.getDefault().getMapper().writeValueAsString(report)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/ReportResponse.java b/src/main/java/com/dropbox/sign/model/ReportResponse.java index 7952227..aec1902 100644 --- a/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -10,364 +10,348 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * Contains information about the report request. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class ReportResponse { - public static final String JSON_PROPERTY_SUCCESS = "success"; - private String success; + public static final String JSON_PROPERTY_SUCCESS = "success"; + private String success; - public static final String JSON_PROPERTY_START_DATE = "start_date"; - private String startDate; + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private String startDate; - public static final String JSON_PROPERTY_END_DATE = "end_date"; - private String endDate; + public static final String JSON_PROPERTY_END_DATE = "end_date"; + private String endDate; - /** - * Gets or Sets reportType - */ - public enum ReportTypeEnum { - USER_ACTIVITY("user_activity"), - - DOCUMENT_STATUS("document_status"); + /** Gets or Sets reportType */ + public enum ReportTypeEnum { + USER_ACTIVITY("user_activity"), - private String value; + DOCUMENT_STATUS("document_status"); - ReportTypeEnum(String value) { - this.value = value; + private String value; + + ReportTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ReportTypeEnum fromValue(String value) { + for (ReportTypeEnum b : ReportTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; + private List reportType = null; + + public ReportResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static ReportResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, ReportResponse.class); } - @Override - public String toString() { - return String.valueOf(value); + public static ReportResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), ReportResponse.class); } - @JsonCreator - public static ReportTypeEnum fromValue(String value) { - for (ReportTypeEnum b : ReportTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public ReportResponse success(String success) { + this.success = success; + return this; } - } - - public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; - private List reportType = null; - - public ReportResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public ReportResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, ReportResponse.class); - } - - static public ReportResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - ReportResponse.class - ); - } - - public ReportResponse success(String success) { - this.success = success; - return this; - } - - /** - * A message indicating the requested operation's success - * @return success - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUCCESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSuccess() { - return success; - } - - - @JsonProperty(JSON_PROPERTY_SUCCESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSuccess(String success) { - this.success = success; - } - - - public ReportResponse startDate(String startDate) { - this.startDate = startDate; - return this; - } - - /** - * The (inclusive) start date for the report data in MM/DD/YYYY format. - * @return startDate - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getStartDate() { - return startDate; - } - - - @JsonProperty(JSON_PROPERTY_START_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - - public ReportResponse endDate(String endDate) { - this.endDate = endDate; - return this; - } - - /** - * The (inclusive) end date for the report data in MM/DD/YYYY format. - * @return endDate - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEndDate() { - return endDate; - } - - - @JsonProperty(JSON_PROPERTY_END_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - - public ReportResponse reportType(List reportType) { - this.reportType = reportType; - return this; - } - - public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { - if (this.reportType == null) { - this.reportType = new ArrayList<>(); + + /** + * A message indicating the requested operation's success + * + * @return success + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSuccess() { + return success; } - 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.Nullable - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getReportType() { - return reportType; - } - - - @JsonProperty(JSON_PROPERTY_REPORT_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReportType(List reportType) { - this.reportType = reportType; - } - - - /** - * Return true if this ReportResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + @JsonProperty(JSON_PROPERTY_SUCCESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuccess(String success) { + this.success = success; } - if (o == null || getClass() != o.getClass()) { - return false; + + public ReportResponse startDate(String startDate) { + this.startDate = startDate; + return this; } - ReportResponse reportResponse = (ReportResponse) o; - return Objects.equals(this.success, reportResponse.success) && - Objects.equals(this.startDate, reportResponse.startDate) && - Objects.equals(this.endDate, reportResponse.endDate) && - Objects.equals(this.reportType, reportResponse.reportType); - } - - @Override - public int hashCode() { - return Objects.hash(success, startDate, endDate, reportType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReportResponse {\n"); - sb.append(" success: ").append(toIndentedString(success)).append("\n"); - sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); - sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (success != null) { - if (isFileTypeOrListOfFiles(success)) { - fileTypeFound = true; - } - if (success.getClass().equals(java.io.File.class) || - success.getClass().equals(Integer.class) || - success.getClass().equals(String.class) || - success.getClass().isEnum()) { - map.put("success", success); - } else if (isListOfFile(success)) { - for(int i = 0; i< getListSize(success); i++) { - map.put("success[" + i + "]", getFromList(success, i)); - } - } - else { - map.put("success", JSON.getDefault().getMapper().writeValueAsString(success)); - } + /** + * The (inclusive) start date for the report data in MM/DD/YYYY format. + * + * @return startDate + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; } - if (startDate != null) { - if (isFileTypeOrListOfFiles(startDate)) { - fileTypeFound = true; - } - if (startDate.getClass().equals(java.io.File.class) || - startDate.getClass().equals(Integer.class) || - startDate.getClass().equals(String.class) || - startDate.getClass().isEnum()) { - map.put("start_date", startDate); - } else if (isListOfFile(startDate)) { - for(int i = 0; i< getListSize(startDate); i++) { - map.put("start_date[" + i + "]", getFromList(startDate, i)); - } - } - else { - map.put("start_date", JSON.getDefault().getMapper().writeValueAsString(startDate)); - } + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDate(String startDate) { + this.startDate = startDate; } - if (endDate != null) { - if (isFileTypeOrListOfFiles(endDate)) { - fileTypeFound = true; - } - if (endDate.getClass().equals(java.io.File.class) || - endDate.getClass().equals(Integer.class) || - endDate.getClass().equals(String.class) || - endDate.getClass().isEnum()) { - map.put("end_date", endDate); - } else if (isListOfFile(endDate)) { - for(int i = 0; i< getListSize(endDate); i++) { - map.put("end_date[" + i + "]", getFromList(endDate, i)); - } - } - else { - map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); - } + public ReportResponse endDate(String endDate) { + this.endDate = endDate; + return this; } - if (reportType != null) { - if (isFileTypeOrListOfFiles(reportType)) { - fileTypeFound = true; + + /** + * The (inclusive) end date for the report data in MM/DD/YYYY format. + * + * @return endDate + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEndDate() { + return endDate; + } + + @JsonProperty(JSON_PROPERTY_END_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public ReportResponse reportType(List reportType) { + this.reportType = reportType; + return this; + } + + public ReportResponse addReportTypeItem(ReportTypeEnum reportTypeItem) { + if (this.reportType == null) { + this.reportType = new ArrayList<>(); } + this.reportType.add(reportTypeItem); + return this; + } - if (reportType.getClass().equals(java.io.File.class) || - reportType.getClass().equals(Integer.class) || - reportType.getClass().equals(String.class) || - reportType.getClass().isEnum()) { - map.put("report_type", reportType); - } else if (isListOfFile(reportType)) { - for(int i = 0; i< getListSize(reportType); i++) { - map.put("report_type[" + i + "]", getFromList(reportType, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getReportType() { + return reportType; + } + + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReportType(List reportType) { + this.reportType = reportType; + } + + /** Return true if this ReportResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("report_type", JSON.getDefault().getMapper().writeValueAsString(reportType)); + if (o == null || getClass() != o.getClass()) { + return false; } + ReportResponse reportResponse = (ReportResponse) o; + return Objects.equals(this.success, reportResponse.success) + && Objects.equals(this.startDate, reportResponse.startDate) + && Objects.equals(this.endDate, reportResponse.endDate) + && Objects.equals(this.reportType, reportResponse.reportType); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(success, startDate, endDate, reportType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (success != null) { + if (isFileTypeOrListOfFiles(success)) { + fileTypeFound = true; + } + + if (success.getClass().equals(java.io.File.class) + || success.getClass().equals(Integer.class) + || success.getClass().equals(String.class) + || success.getClass().isEnum()) { + map.put("success", success); + } else if (isListOfFile(success)) { + for (int i = 0; i < getListSize(success); i++) { + map.put("success[" + i + "]", getFromList(success, i)); + } + } else { + map.put("success", JSON.getDefault().getMapper().writeValueAsString(success)); + } + } + if (startDate != null) { + if (isFileTypeOrListOfFiles(startDate)) { + fileTypeFound = true; + } + + if (startDate.getClass().equals(java.io.File.class) + || startDate.getClass().equals(Integer.class) + || startDate.getClass().equals(String.class) + || startDate.getClass().isEnum()) { + map.put("start_date", startDate); + } else if (isListOfFile(startDate)) { + for (int i = 0; i < getListSize(startDate); i++) { + map.put("start_date[" + i + "]", getFromList(startDate, i)); + } + } else { + map.put( + "start_date", + JSON.getDefault().getMapper().writeValueAsString(startDate)); + } + } + if (endDate != null) { + if (isFileTypeOrListOfFiles(endDate)) { + fileTypeFound = true; + } + + if (endDate.getClass().equals(java.io.File.class) + || endDate.getClass().equals(Integer.class) + || endDate.getClass().equals(String.class) + || endDate.getClass().isEnum()) { + map.put("end_date", endDate); + } else if (isListOfFile(endDate)) { + for (int i = 0; i < getListSize(endDate); i++) { + map.put("end_date[" + i + "]", getFromList(endDate, i)); + } + } else { + map.put("end_date", JSON.getDefault().getMapper().writeValueAsString(endDate)); + } + } + if (reportType != null) { + if (isFileTypeOrListOfFiles(reportType)) { + fileTypeFound = true; + } + + if (reportType.getClass().equals(java.io.File.class) + || reportType.getClass().equals(Integer.class) + || reportType.getClass().equals(String.class) + || reportType.getClass().isEnum()) { + map.put("report_type", reportType); + } else if (isListOfFile(reportType)) { + for (int i = 0; i < getListSize(reportType); i++) { + map.put("report_type[" + i + "]", getFromList(reportType, i)); + } + } else { + map.put( + "report_type", + JSON.getDefault().getMapper().writeValueAsString(reportType)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java index 5a27c1f..d1d7453 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.java @@ -10,817 +10,866 @@ * 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.SubBulkSignerList; -import com.dropbox.sign.model.SubCC; -import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SignatureRequestBulkCreateEmbeddedWithTemplateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestBulkCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; - private File signerFile; + public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; + private File signerFile; - public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList = null; + public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; + private List signerList = null; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + 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 = null; + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() { - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); - } - - static public SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class - ); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class); + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest templateIds( + List templateIds) { + this.templateIds = templateIds; + return this; } - 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 - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addTemplateIdsItem( + String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } - public List getTemplateIds() { - return templateIds; - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } - + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest clientId(String clientId) { - this.clientId = 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for security purposes. - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } - public String getClientId() { - return clientId; - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(File signerFile) { + this.signerFile = 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 @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getSignerFile() { + return signerFile; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerFile(File signerFile) { - this.signerFile = 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 - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public File getSignerFile() { - return signerFile; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerFile(File signerFile) { - this.signerFile = signerFile; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerList(List signerList) { - this.signerList = signerList; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem(SubBulkSignerList signerListItem) { - if (this.signerList == null) { - this.signerList = new ArrayList<>(); - } - this.signerList.add(signerListItem); - 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 - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignerList() { - return signerList; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerList(List signerList) { - this.signerList = signerList; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest ccs(List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); - } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * @return ccs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcs() { - return ccs; - } - - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(List ccs) { - this.ccs = ccs; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerFile(File signerFile) { + this.signerFile = signerFile; + } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signerList( + List signerList) { + this.signerList = signerList; + return this; + } - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - /** - * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest = (SignatureRequestBulkCreateEmbeddedWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestBulkCreateEmbeddedWithTemplateRequest.templateIds) && - Objects.equals(this.clientId, signatureRequestBulkCreateEmbeddedWithTemplateRequest.clientId) && - Objects.equals(this.signerFile, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerFile) && - Objects.equals(this.signerList, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerList) && - Objects.equals(this.allowDecline, signatureRequestBulkCreateEmbeddedWithTemplateRequest.allowDecline) && - Objects.equals(this.ccs, signatureRequestBulkCreateEmbeddedWithTemplateRequest.ccs) && - Objects.equals(this.customFields, signatureRequestBulkCreateEmbeddedWithTemplateRequest.customFields) && - Objects.equals(this.message, signatureRequestBulkCreateEmbeddedWithTemplateRequest.message) && - Objects.equals(this.metadata, signatureRequestBulkCreateEmbeddedWithTemplateRequest.metadata) && - Objects.equals(this.signingRedirectUrl, signatureRequestBulkCreateEmbeddedWithTemplateRequest.signingRedirectUrl) && - Objects.equals(this.subject, signatureRequestBulkCreateEmbeddedWithTemplateRequest.subject) && - Objects.equals(this.testMode, signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); - } - - @Override - public int hashCode() { - return Objects.hash(templateIds, clientId, signerFile, signerList, allowDecline, ccs, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestBulkCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); - sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addSignerListItem( + SubBulkSignerList signerListItem) { + if (this.signerList == null) { + this.signerList = new ArrayList<>(); } + this.signerList.add(signerListItem); + return this; + } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + /** + * `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 @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignerList() { + return signerList; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerList(List signerList) { + this.signerList = signerList; } - if (signerFile != null) { - if (isFileTypeOrListOfFiles(signerFile)) { - fileTypeFound = true; - } - if (signerFile.getClass().equals(java.io.File.class) || - signerFile.getClass().equals(Integer.class) || - signerFile.getClass().equals(String.class) || - signerFile.getClass().isEnum()) { - map.put("signer_file", signerFile); - } else if (isListOfFile(signerFile)) { - for(int i = 0; i< getListSize(signerFile); i++) { - map.put("signer_file[" + i + "]", getFromList(signerFile, i)); - } - } - else { - map.put("signer_file", JSON.getDefault().getMapper().writeValueAsString(signerFile)); - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest allowDecline( + Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; } - if (signerList != null) { - if (isFileTypeOrListOfFiles(signerList)) { - fileTypeFound = true; - } - if (signerList.getClass().equals(java.io.File.class) || - signerList.getClass().equals(Integer.class) || - signerList.getClass().equals(String.class) || - signerList.getClass().isEnum()) { - map.put("signer_list", signerList); - } else if (isListOfFile(signerList)) { - for(int i = 0; i< getListSize(signerList); i++) { - map.put("signer_list[" + i + "]", getFromList(signerList, i)); - } - } - else { - map.put("signer_list", JSON.getDefault().getMapper().writeValueAsString(signerList)); - } + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - if (ccs.getClass().equals(java.io.File.class) || - ccs.getClass().equals(Integer.class) || - ccs.getClass().equals(String.class) || - ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for(int i = 0; i< getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } - else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } + this.ccs.add(ccsItem); + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest customFields( + List customFields) { + this.customFields = customFields; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest metadata( + Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; } - } catch (Exception e) { - throw new ApiException(e); + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; } - return fileTypeFound ? map : new HashMap<>(); - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest signingRedirectUrl( + String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } - /** - * 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"; + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; } - return o.toString().replace("\n", "\n "); - } -} + /** + * 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestBulkCreateEmbeddedWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + /** + * Return true if this SignatureRequestBulkCreateEmbeddedWithTemplateRequest object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestBulkCreateEmbeddedWithTemplateRequest + signatureRequestBulkCreateEmbeddedWithTemplateRequest = + (SignatureRequestBulkCreateEmbeddedWithTemplateRequest) o; + return Objects.equals( + this.templateIds, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.templateIds) + && Objects.equals( + this.clientId, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.clientId) + && Objects.equals( + this.signerFile, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerFile) + && Objects.equals( + this.signerList, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.signerList) + && Objects.equals( + this.allowDecline, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.allowDecline) + && Objects.equals( + this.ccs, signatureRequestBulkCreateEmbeddedWithTemplateRequest.ccs) + && Objects.equals( + this.customFields, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.customFields) + && Objects.equals( + this.message, signatureRequestBulkCreateEmbeddedWithTemplateRequest.message) + && Objects.equals( + this.metadata, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.metadata) + && Objects.equals( + this.signingRedirectUrl, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.signingRedirectUrl) + && Objects.equals( + this.subject, signatureRequestBulkCreateEmbeddedWithTemplateRequest.subject) + && Objects.equals( + this.testMode, + signatureRequestBulkCreateEmbeddedWithTemplateRequest.testMode) + && Objects.equals( + this.title, signatureRequestBulkCreateEmbeddedWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + clientId, + signerFile, + signerList, + allowDecline, + ccs, + customFields, + message, + metadata, + signingRedirectUrl, + subject, + testMode, + title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestBulkCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); + sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (signerFile != null) { + if (isFileTypeOrListOfFiles(signerFile)) { + fileTypeFound = true; + } + + if (signerFile.getClass().equals(java.io.File.class) + || signerFile.getClass().equals(Integer.class) + || signerFile.getClass().equals(String.class) + || signerFile.getClass().isEnum()) { + map.put("signer_file", signerFile); + } else if (isListOfFile(signerFile)) { + for (int i = 0; i < getListSize(signerFile); i++) { + map.put("signer_file[" + i + "]", getFromList(signerFile, i)); + } + } else { + map.put( + "signer_file", + JSON.getDefault().getMapper().writeValueAsString(signerFile)); + } + } + if (signerList != null) { + if (isFileTypeOrListOfFiles(signerList)) { + fileTypeFound = true; + } + + if (signerList.getClass().equals(java.io.File.class) + || signerList.getClass().equals(Integer.class) + || signerList.getClass().equals(String.class) + || signerList.getClass().isEnum()) { + map.put("signer_list", signerList); + } else if (isListOfFile(signerList)) { + for (int i = 0; i < getListSize(signerList); i++) { + map.put("signer_list[" + i + "]", getFromList(signerList, i)); + } + } else { + map.put( + "signer_list", + JSON.getDefault().getMapper().writeValueAsString(signerList)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java index 73ed989..0d61875 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestBulkSendWithTemplateRequest.java @@ -10,817 +10,844 @@ * 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.SubBulkSignerList; -import com.dropbox.sign.model.SubCC; -import com.dropbox.sign.model.SubCustomField; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SignatureRequestBulkSendWithTemplateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestBulkSendWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; - private File signerFile; + public static final String JSON_PROPERTY_SIGNER_FILE = "signer_file"; + private File signerFile; - public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; - private List signerList = null; + public static final String JSON_PROPERTY_SIGNER_LIST = "signer_list"; + private List signerList = null; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + 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 = null; + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + 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 = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public SignatureRequestBulkSendWithTemplateRequest() { - } + public SignatureRequestBulkSendWithTemplateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestBulkSendWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestBulkSendWithTemplateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestBulkSendWithTemplateRequest init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestBulkSendWithTemplateRequest.class); + } - static public SignatureRequestBulkSendWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestBulkSendWithTemplateRequest.class - ); - } + public static SignatureRequestBulkSendWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestBulkSendWithTemplateRequest.class); + } - public SignatureRequestBulkSendWithTemplateRequest templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + public SignatureRequestBulkSendWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } - public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestBulkSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; } - 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 - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } - public List getTemplateIds() { - return templateIds; - } + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + public SignatureRequestBulkSendWithTemplateRequest signerFile(File signerFile) { + this.signerFile = signerFile; + return this; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } + /** + * `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 @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getSignerFile() { + return signerFile; + } + @JsonProperty(JSON_PROPERTY_SIGNER_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerFile(File signerFile) { + this.signerFile = signerFile; + } - public SignatureRequestBulkSendWithTemplateRequest signerFile(File signerFile) { - this.signerFile = signerFile; - return this; - } + public SignatureRequestBulkSendWithTemplateRequest signerList( + List signerList) { + this.signerList = signerList; + 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 - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SignatureRequestBulkSendWithTemplateRequest addSignerListItem( + SubBulkSignerList signerListItem) { + if (this.signerList == null) { + this.signerList = new ArrayList<>(); + } + this.signerList.add(signerListItem); + return this; + } - public File getSignerFile() { - return signerFile; - } + /** + * `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 @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignerList() { + return signerList; + } + @JsonProperty(JSON_PROPERTY_SIGNER_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerList(List signerList) { + this.signerList = signerList; + } - @JsonProperty(JSON_PROPERTY_SIGNER_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerFile(File signerFile) { - this.signerFile = signerFile; - } - - - public SignatureRequestBulkSendWithTemplateRequest signerList(List signerList) { - this.signerList = signerList; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addSignerListItem(SubBulkSignerList signerListItem) { - if (this.signerList == null) { - this.signerList = new ArrayList<>(); - } - this.signerList.add(signerListItem); - 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 - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignerList() { - return signerList; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerList(List signerList) { - this.signerList = signerList; - } - - - public SignatureRequestBulkSendWithTemplateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public SignatureRequestBulkSendWithTemplateRequest ccs(List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + public SignatureRequestBulkSendWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * @return ccs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcs() { - return ccs; - } - - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(List ccs) { - this.ccs = ccs; - } - - - public SignatureRequestBulkSendWithTemplateRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public SignatureRequestBulkSendWithTemplateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public SignatureRequestBulkSendWithTemplateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestBulkSendWithTemplateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestBulkSendWithTemplateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public SignatureRequestBulkSendWithTemplateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestBulkSendWithTemplateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestBulkSendWithTemplateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - /** - * Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest = (SignatureRequestBulkSendWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestBulkSendWithTemplateRequest.templateIds) && - Objects.equals(this.signerFile, signatureRequestBulkSendWithTemplateRequest.signerFile) && - Objects.equals(this.signerList, signatureRequestBulkSendWithTemplateRequest.signerList) && - Objects.equals(this.allowDecline, signatureRequestBulkSendWithTemplateRequest.allowDecline) && - Objects.equals(this.ccs, signatureRequestBulkSendWithTemplateRequest.ccs) && - Objects.equals(this.clientId, signatureRequestBulkSendWithTemplateRequest.clientId) && - Objects.equals(this.customFields, signatureRequestBulkSendWithTemplateRequest.customFields) && - Objects.equals(this.message, signatureRequestBulkSendWithTemplateRequest.message) && - Objects.equals(this.metadata, signatureRequestBulkSendWithTemplateRequest.metadata) && - Objects.equals(this.signingRedirectUrl, signatureRequestBulkSendWithTemplateRequest.signingRedirectUrl) && - Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) && - Objects.equals(this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); - } - - @Override - public int hashCode() { - return Objects.hash(templateIds, signerFile, signerList, allowDecline, ccs, clientId, customFields, message, metadata, signingRedirectUrl, subject, testMode, title); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestBulkSendWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); - sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } + public SignatureRequestBulkSendWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); + public SignatureRequestBulkSendWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } + this.ccs.add(ccsItem); + return this; } - if (signerFile != null) { - if (isFileTypeOrListOfFiles(signerFile)) { - fileTypeFound = true; - } - if (signerFile.getClass().equals(java.io.File.class) || - signerFile.getClass().equals(Integer.class) || - signerFile.getClass().equals(String.class) || - signerFile.getClass().isEnum()) { - map.put("signer_file", signerFile); - } else if (isListOfFile(signerFile)) { - for(int i = 0; i< getListSize(signerFile); i++) { - map.put("signer_file[" + i + "]", getFromList(signerFile, i)); - } - } - else { - map.put("signer_file", JSON.getDefault().getMapper().writeValueAsString(signerFile)); - } + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; } - if (signerList != null) { - if (isFileTypeOrListOfFiles(signerList)) { - fileTypeFound = true; - } - if (signerList.getClass().equals(java.io.File.class) || - signerList.getClass().equals(Integer.class) || - signerList.getClass().equals(String.class) || - signerList.getClass().isEnum()) { - map.put("signer_list", signerList); - } else if (isListOfFile(signerList)) { - for(int i = 0; i< getListSize(signerList); i++) { - map.put("signer_list[" + i + "]", getFromList(signerList, i)); - } - } - else { - map.put("signer_list", JSON.getDefault().getMapper().writeValueAsString(signerList)); - } + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + public SignatureRequestBulkSendWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - if (ccs.getClass().equals(java.io.File.class) || - ccs.getClass().equals(Integer.class) || - ccs.getClass().equals(String.class) || - ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for(int i = 0; i< getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } - else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + public SignatureRequestBulkSendWithTemplateRequest customFields( + List customFields) { + this.customFields = customFields; + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + public SignatureRequestBulkSendWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + public SignatureRequestBulkSendWithTemplateRequest message(String message) { + this.message = message; + return this; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestBulkSendWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestBulkSendWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; } - } catch (Exception e) { - throw new ApiException(e); + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; } - return fileTypeFound ? map : new HashMap<>(); - } + public SignatureRequestBulkSendWithTemplateRequest signingRedirectUrl( + String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + public SignatureRequestBulkSendWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } - /** - * 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"; + public SignatureRequestBulkSendWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; } - return o.toString().replace("\n", "\n "); - } -} + /** + * 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestBulkSendWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + /** Return true if this SignatureRequestBulkSendWithTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest = + (SignatureRequestBulkSendWithTemplateRequest) o; + return Objects.equals( + this.templateIds, signatureRequestBulkSendWithTemplateRequest.templateIds) + && Objects.equals( + this.signerFile, signatureRequestBulkSendWithTemplateRequest.signerFile) + && Objects.equals( + this.signerList, signatureRequestBulkSendWithTemplateRequest.signerList) + && Objects.equals( + this.allowDecline, signatureRequestBulkSendWithTemplateRequest.allowDecline) + && Objects.equals(this.ccs, signatureRequestBulkSendWithTemplateRequest.ccs) + && Objects.equals( + this.clientId, signatureRequestBulkSendWithTemplateRequest.clientId) + && Objects.equals( + this.customFields, signatureRequestBulkSendWithTemplateRequest.customFields) + && Objects.equals(this.message, signatureRequestBulkSendWithTemplateRequest.message) + && Objects.equals( + this.metadata, signatureRequestBulkSendWithTemplateRequest.metadata) + && Objects.equals( + this.signingRedirectUrl, + signatureRequestBulkSendWithTemplateRequest.signingRedirectUrl) + && Objects.equals(this.subject, signatureRequestBulkSendWithTemplateRequest.subject) + && Objects.equals( + this.testMode, signatureRequestBulkSendWithTemplateRequest.testMode) + && Objects.equals(this.title, signatureRequestBulkSendWithTemplateRequest.title); + } + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + signerFile, + signerList, + allowDecline, + ccs, + clientId, + customFields, + message, + metadata, + signingRedirectUrl, + subject, + testMode, + title); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestBulkSendWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signerFile: ").append(toIndentedString(signerFile)).append("\n"); + sb.append(" signerList: ").append(toIndentedString(signerList)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (signerFile != null) { + if (isFileTypeOrListOfFiles(signerFile)) { + fileTypeFound = true; + } + + if (signerFile.getClass().equals(java.io.File.class) + || signerFile.getClass().equals(Integer.class) + || signerFile.getClass().equals(String.class) + || signerFile.getClass().isEnum()) { + map.put("signer_file", signerFile); + } else if (isListOfFile(signerFile)) { + for (int i = 0; i < getListSize(signerFile); i++) { + map.put("signer_file[" + i + "]", getFromList(signerFile, i)); + } + } else { + map.put( + "signer_file", + JSON.getDefault().getMapper().writeValueAsString(signerFile)); + } + } + if (signerList != null) { + if (isFileTypeOrListOfFiles(signerList)) { + fileTypeFound = true; + } + + if (signerList.getClass().equals(java.io.File.class) + || signerList.getClass().equals(Integer.class) + || signerList.getClass().equals(String.class) + || signerList.getClass().isEnum()) { + map.put("signer_list", signerList); + } else if (isListOfFile(signerList)) { + for (int i = 0; i < getListSize(signerList); i++) { + map.put("signer_list[" + i + "]", getFromList(signerList, i)); + } + } else { + map.put( + "signer_list", + JSON.getDefault().getMapper().writeValueAsString(signerList)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java index db7b7d5..6652702 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedRequest.java @@ -10,1421 +10,1465 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; -import com.dropbox.sign.model.SubSignatureRequestSigner; -import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SignatureRequestCreateEmbeddedRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestCreateEmbeddedRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = null; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners = null; + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + 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 = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + 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 = null; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + 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_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - private Boolean useTextTags = false; + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; - private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; - public SignatureRequestCreateEmbeddedRequest() { - } + public SignatureRequestCreateEmbeddedRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestCreateEmbeddedRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestCreateEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedRequest.class); + } - static public SignatureRequestCreateEmbeddedRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestCreateEmbeddedRequest.class - ); - } + public static SignatureRequestCreateEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestCreateEmbeddedRequest.class); + } - public SignatureRequestCreateEmbeddedRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } + public SignatureRequestCreateEmbeddedRequest clientId(String clientId) { + this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * Client id of the app you're using to create this embedded signature request. Used for + * security purposes. + * + * @return clientId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } - public String getClientId() { - return clientId; - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + public SignatureRequestCreateEmbeddedRequest files(List files) { + this.files = files; + return this; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } + public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - public SignatureRequestCreateEmbeddedRequest files(List files) { - this.files = files; - return this; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } - public SignatureRequestCreateEmbeddedRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public SignatureRequestCreateEmbeddedRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } - public List getFiles() { - return files; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } + public SignatureRequestCreateEmbeddedRequest signers(List signers) { + this.signers = signers; + return this; + } + public SignatureRequestCreateEmbeddedRequest addSignersItem( + SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } - public SignatureRequestCreateEmbeddedRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public SignatureRequestCreateEmbeddedRequest signers(List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. - * @return signers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } - public List getSigners() { - return signers; - } + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + public SignatureRequestCreateEmbeddedRequest groupedSigners( + List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public SignatureRequestCreateEmbeddedRequest groupedSigners(List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); - } - this.groupedSigners.add(groupedSignersItem); - 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 - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SignatureRequestCreateEmbeddedRequest addGroupedSignersItem( + SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; + } - public List getGroupedSigners() { - return groupedSigners; - } + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return groupedSigners + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedSigners() { + return groupedSigners; + } + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners(List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - - public SignatureRequestCreateEmbeddedRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - + public SignatureRequestCreateEmbeddedRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } - public SignatureRequestCreateEmbeddedRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public SignatureRequestCreateEmbeddedRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } - public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public SignatureRequestCreateEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); - } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * @return ccEmailAddresses - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + public SignatureRequestCreateEmbeddedRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - public SignatureRequestCreateEmbeddedRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - + public SignatureRequestCreateEmbeddedRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } - public SignatureRequestCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } + public SignatureRequestCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } - public SignatureRequestCreateEmbeddedRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public SignatureRequestCreateEmbeddedRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); - } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - - public SignatureRequestCreateEmbeddedRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - 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.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - - public SignatureRequestCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { - this.hideTextTags = 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 - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHideTextTags() { - return hideTextTags; - } - - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - - public SignatureRequestCreateEmbeddedRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestCreateEmbeddedRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + public SignatureRequestCreateEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public SignatureRequestCreateEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public SignatureRequestCreateEmbeddedRequest subject(String subject) { - this.subject = subject; - return this; - } + public SignatureRequestCreateEmbeddedRequest addCcEmailAddressesItem( + String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestCreateEmbeddedRequest testMode(Boolean testMode) { - this.testMode = testMode; - return this; - } + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } - /** - * 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestCreateEmbeddedRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public SignatureRequestCreateEmbeddedRequest useTextTags(Boolean useTextTags) { - this.useTextTags = 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 - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUseTextTags() { - return useTextTags; - } - - - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(Boolean useTextTags) { - this.useTextTags = useTextTags; - } - - - public SignatureRequestCreateEmbeddedRequest populateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = 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 - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; - } - - - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - } - - - public SignatureRequestCreateEmbeddedRequest expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this SignatureRequestCreateEmbeddedRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest = (SignatureRequestCreateEmbeddedRequest) o; - return Objects.equals(this.clientId, signatureRequestCreateEmbeddedRequest.clientId) && - Objects.equals(this.files, signatureRequestCreateEmbeddedRequest.files) && - Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedRequest.fileUrls) && - Objects.equals(this.signers, signatureRequestCreateEmbeddedRequest.signers) && - Objects.equals(this.groupedSigners, signatureRequestCreateEmbeddedRequest.groupedSigners) && - Objects.equals(this.allowDecline, signatureRequestCreateEmbeddedRequest.allowDecline) && - Objects.equals(this.allowReassign, signatureRequestCreateEmbeddedRequest.allowReassign) && - Objects.equals(this.attachments, signatureRequestCreateEmbeddedRequest.attachments) && - Objects.equals(this.ccEmailAddresses, signatureRequestCreateEmbeddedRequest.ccEmailAddresses) && - Objects.equals(this.customFields, signatureRequestCreateEmbeddedRequest.customFields) && - Objects.equals(this.fieldOptions, signatureRequestCreateEmbeddedRequest.fieldOptions) && - Objects.equals(this.formFieldGroups, signatureRequestCreateEmbeddedRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, signatureRequestCreateEmbeddedRequest.formFieldRules) && - Objects.equals(this.formFieldsPerDocument, signatureRequestCreateEmbeddedRequest.formFieldsPerDocument) && - Objects.equals(this.hideTextTags, signatureRequestCreateEmbeddedRequest.hideTextTags) && - Objects.equals(this.message, signatureRequestCreateEmbeddedRequest.message) && - Objects.equals(this.metadata, signatureRequestCreateEmbeddedRequest.metadata) && - Objects.equals(this.signingOptions, signatureRequestCreateEmbeddedRequest.signingOptions) && - Objects.equals(this.subject, signatureRequestCreateEmbeddedRequest.subject) && - Objects.equals(this.testMode, signatureRequestCreateEmbeddedRequest.testMode) && - Objects.equals(this.title, signatureRequestCreateEmbeddedRequest.title) && - Objects.equals(this.useTextTags, signatureRequestCreateEmbeddedRequest.useTextTags) && - Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedRequest.populateAutoFillFields) && - Objects.equals(this.expiresAt, signatureRequestCreateEmbeddedRequest.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, files, fileUrls, signers, groupedSigners, allowDecline, allowReassign, attachments, ccEmailAddresses, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, signingOptions, subject, testMode, title, useTextTags, populateAutoFillFields, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestCreateEmbeddedRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + public SignatureRequestCreateEmbeddedRequest customFields(List customFields) { + this.customFields = customFields; + return this; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + public SignatureRequestCreateEmbeddedRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - if (groupedSigners.getClass().equals(java.io.File.class) || - groupedSigners.getClass().equals(Integer.class) || - groupedSigners.getClass().equals(String.class) || - groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for(int i = 0; i< getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } - else { - map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } + public SignatureRequestCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + public SignatureRequestCreateEmbeddedRequest formFieldGroups( + List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + public SignatureRequestCreateEmbeddedRequest addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + public SignatureRequestCreateEmbeddedRequest formFieldRules( + List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + public SignatureRequestCreateEmbeddedRequest addFormFieldRulesItem( + SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); - } + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - if (hideTextTags.getClass().equals(java.io.File.class) || - hideTextTags.getClass().equals(Integer.class) || - hideTextTags.getClass().equals(String.class) || - hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for(int i = 0; i< getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } - else { - map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + public SignatureRequestCreateEmbeddedRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + public SignatureRequestCreateEmbeddedRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + public SignatureRequestCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - if (useTextTags.getClass().equals(java.io.File.class) || - useTextTags.getClass().equals(Integer.class) || - useTextTags.getClass().equals(String.class) || - useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for(int i = 0; i< getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } - else { - map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - if (populateAutoFillFields.getClass().equals(java.io.File.class) || - populateAutoFillFields.getClass().equals(Integer.class) || - populateAutoFillFields.getClass().equals(String.class) || - populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for(int i = 0; i< getListSize(populateAutoFillFields); i++) { - map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); - } - } - else { - map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); - } + public SignatureRequestCreateEmbeddedRequest message(String message) { + this.message = message; + return this; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestCreateEmbeddedRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public SignatureRequestCreateEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public SignatureRequestCreateEmbeddedRequest subject(String subject) { + this.subject = subject; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; } - return o.toString().replace("\n", "\n "); - } -} + public SignatureRequestCreateEmbeddedRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestCreateEmbeddedRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestCreateEmbeddedRequest useTextTags(Boolean useTextTags) { + this.useTextTags = 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 @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + public SignatureRequestCreateEmbeddedRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = 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 @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + public SignatureRequestCreateEmbeddedRequest expiresAt(Integer expiresAt) { + this.expiresAt = 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this SignatureRequestCreateEmbeddedRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest = + (SignatureRequestCreateEmbeddedRequest) o; + return Objects.equals(this.clientId, signatureRequestCreateEmbeddedRequest.clientId) + && Objects.equals(this.files, signatureRequestCreateEmbeddedRequest.files) + && Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedRequest.fileUrls) + && Objects.equals(this.signers, signatureRequestCreateEmbeddedRequest.signers) + && Objects.equals( + this.groupedSigners, signatureRequestCreateEmbeddedRequest.groupedSigners) + && Objects.equals( + this.allowDecline, signatureRequestCreateEmbeddedRequest.allowDecline) + && Objects.equals( + this.allowReassign, signatureRequestCreateEmbeddedRequest.allowReassign) + && Objects.equals( + this.attachments, signatureRequestCreateEmbeddedRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, + signatureRequestCreateEmbeddedRequest.ccEmailAddresses) + && Objects.equals( + this.customFields, signatureRequestCreateEmbeddedRequest.customFields) + && Objects.equals( + this.fieldOptions, signatureRequestCreateEmbeddedRequest.fieldOptions) + && Objects.equals( + this.formFieldGroups, signatureRequestCreateEmbeddedRequest.formFieldGroups) + && Objects.equals( + this.formFieldRules, signatureRequestCreateEmbeddedRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + signatureRequestCreateEmbeddedRequest.formFieldsPerDocument) + && Objects.equals( + this.hideTextTags, signatureRequestCreateEmbeddedRequest.hideTextTags) + && Objects.equals(this.message, signatureRequestCreateEmbeddedRequest.message) + && Objects.equals(this.metadata, signatureRequestCreateEmbeddedRequest.metadata) + && Objects.equals( + this.signingOptions, signatureRequestCreateEmbeddedRequest.signingOptions) + && Objects.equals(this.subject, signatureRequestCreateEmbeddedRequest.subject) + && Objects.equals(this.testMode, signatureRequestCreateEmbeddedRequest.testMode) + && Objects.equals(this.title, signatureRequestCreateEmbeddedRequest.title) + && Objects.equals( + this.useTextTags, signatureRequestCreateEmbeddedRequest.useTextTags) + && Objects.equals( + this.populateAutoFillFields, + signatureRequestCreateEmbeddedRequest.populateAutoFillFields) + && Objects.equals(this.expiresAt, signatureRequestCreateEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + files, + fileUrls, + signers, + groupedSigners, + allowDecline, + allowReassign, + attachments, + ccEmailAddresses, + customFields, + fieldOptions, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + message, + metadata, + signingOptions, + subject, + testMode, + title, + useTextTags, + populateAutoFillFields, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestCreateEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) + || groupedSigners.getClass().equals(Integer.class) + || groupedSigners.getClass().equals(String.class) + || groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for (int i = 0; i < getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } else { + map.put( + "grouped_signers", + JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java index f43cbef..7769ade 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestCreateEmbeddedWithTemplateRequest.java @@ -10,934 +10,954 @@ * 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.SubCC; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; -import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SignatureRequestCreateEmbeddedWithTemplateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = new ArrayList<>(); + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); - public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs = null; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; - private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public SignatureRequestCreateEmbeddedWithTemplateRequest() { - } + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestCreateEmbeddedWithTemplateRequest.class); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest() {} - static public SignatureRequestCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestCreateEmbeddedWithTemplateRequest.class - ); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestCreateEmbeddedWithTemplateRequest init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestCreateEmbeddedWithTemplateRequest.class); + } - public SignatureRequestCreateEmbeddedWithTemplateRequest templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + public static SignatureRequestCreateEmbeddedWithTemplateRequest init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestCreateEmbeddedWithTemplateRequest.class); + } - public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestCreateEmbeddedWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; } - 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 - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SignatureRequestCreateEmbeddedWithTemplateRequest addTemplateIdsItem( + String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } - public List getTemplateIds() { - return templateIds; - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(String clientId) { + this.clientId = 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } - /** - * Client id of the app you're using to create this embedded signature request. Used for security purposes. - * @return clientId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SignatureRequestCreateEmbeddedWithTemplateRequest signers( + List signers) { + this.signers = signers; + return this; + } - public String getClientId() { - return clientId; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem( + SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + /** + * Add Signers to your Templated-based Signature Request. + * + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSigners() { + return signers; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest signers(List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Templated-based Signature Request. - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest ccs(List ccs) { - this.ccs = ccs; - return this; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * @return ccs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcs() { - return ccs; - } - - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(List ccs) { - this.ccs = ccs; - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - + public SignatureRequestCreateEmbeddedWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest files(List files) { - this.files = files; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } + public SignatureRequestCreateEmbeddedWithTemplateRequest customFields( + List customFields) { + this.customFields = customFields; + return this; + } - public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = 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 - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; - } - - - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - } - - - /** - * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest = (SignatureRequestCreateEmbeddedWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestCreateEmbeddedWithTemplateRequest.templateIds) && - Objects.equals(this.clientId, signatureRequestCreateEmbeddedWithTemplateRequest.clientId) && - Objects.equals(this.signers, signatureRequestCreateEmbeddedWithTemplateRequest.signers) && - Objects.equals(this.allowDecline, signatureRequestCreateEmbeddedWithTemplateRequest.allowDecline) && - Objects.equals(this.ccs, signatureRequestCreateEmbeddedWithTemplateRequest.ccs) && - Objects.equals(this.customFields, signatureRequestCreateEmbeddedWithTemplateRequest.customFields) && - Objects.equals(this.files, signatureRequestCreateEmbeddedWithTemplateRequest.files) && - Objects.equals(this.fileUrls, signatureRequestCreateEmbeddedWithTemplateRequest.fileUrls) && - Objects.equals(this.message, signatureRequestCreateEmbeddedWithTemplateRequest.message) && - Objects.equals(this.metadata, signatureRequestCreateEmbeddedWithTemplateRequest.metadata) && - Objects.equals(this.signingOptions, signatureRequestCreateEmbeddedWithTemplateRequest.signingOptions) && - Objects.equals(this.subject, signatureRequestCreateEmbeddedWithTemplateRequest.subject) && - Objects.equals(this.testMode, signatureRequestCreateEmbeddedWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) && - Objects.equals(this.populateAutoFillFields, signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); - } - - @Override - public int hashCode() { - return Objects.hash(templateIds, clientId, signers, allowDecline, ccs, customFields, files, fileUrls, message, metadata, signingOptions, subject, testMode, title, populateAutoFillFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; + public SignatureRequestCreateEmbeddedWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + /** + * An array defining values and options for custom fields. Required when a custom field exists + * in the Template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest files(List files) { + this.files = files; + return this; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + public SignatureRequestCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } + this.files.add(filesItem); + return this; } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - if (ccs.getClass().equals(java.io.File.class) || - ccs.getClass().equals(Integer.class) || - ccs.getClass().equals(String.class) || - ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for(int i = 0; i< getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } - else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + public SignatureRequestCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } + this.fileUrls.add(fileUrlsItem); + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest message(String message) { + this.message = message; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest metadata( + Map metadata) { + this.metadata = metadata; + return this; } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - if (populateAutoFillFields.getClass().equals(java.io.File.class) || - populateAutoFillFields.getClass().equals(Integer.class) || - populateAutoFillFields.getClass().equals(String.class) || - populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for(int i = 0; i< getListSize(populateAutoFillFields); i++) { - map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); - } - } - else { - map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + public SignatureRequestCreateEmbeddedWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; } - } catch (Exception e) { - throw new ApiException(e); + + public SignatureRequestCreateEmbeddedWithTemplateRequest signingOptions( + SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; } - return fileTypeFound ? map : new HashMap<>(); - } + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + public SignatureRequestCreateEmbeddedWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + public SignatureRequestCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } - /** - * 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"; + /** + * 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; } - return o.toString().replace("\n", "\n "); - } -} + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestCreateEmbeddedWithTemplateRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = 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 @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + /** + * Return true if this SignatureRequestCreateEmbeddedWithTemplateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestCreateEmbeddedWithTemplateRequest + signatureRequestCreateEmbeddedWithTemplateRequest = + (SignatureRequestCreateEmbeddedWithTemplateRequest) o; + return Objects.equals( + this.templateIds, + signatureRequestCreateEmbeddedWithTemplateRequest.templateIds) + && Objects.equals( + this.clientId, signatureRequestCreateEmbeddedWithTemplateRequest.clientId) + && Objects.equals( + this.signers, signatureRequestCreateEmbeddedWithTemplateRequest.signers) + && Objects.equals( + this.allowDecline, + signatureRequestCreateEmbeddedWithTemplateRequest.allowDecline) + && Objects.equals(this.ccs, signatureRequestCreateEmbeddedWithTemplateRequest.ccs) + && Objects.equals( + this.customFields, + signatureRequestCreateEmbeddedWithTemplateRequest.customFields) + && Objects.equals( + this.files, signatureRequestCreateEmbeddedWithTemplateRequest.files) + && Objects.equals( + this.fileUrls, signatureRequestCreateEmbeddedWithTemplateRequest.fileUrls) + && Objects.equals( + this.message, signatureRequestCreateEmbeddedWithTemplateRequest.message) + && Objects.equals( + this.metadata, signatureRequestCreateEmbeddedWithTemplateRequest.metadata) + && Objects.equals( + this.signingOptions, + signatureRequestCreateEmbeddedWithTemplateRequest.signingOptions) + && Objects.equals( + this.subject, signatureRequestCreateEmbeddedWithTemplateRequest.subject) + && Objects.equals( + this.testMode, signatureRequestCreateEmbeddedWithTemplateRequest.testMode) + && Objects.equals( + this.title, signatureRequestCreateEmbeddedWithTemplateRequest.title) + && Objects.equals( + this.populateAutoFillFields, + signatureRequestCreateEmbeddedWithTemplateRequest.populateAutoFillFields); + } + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + clientId, + signers, + allowDecline, + ccs, + customFields, + files, + fileUrls, + message, + metadata, + signingOptions, + subject, + testMode, + title, + populateAutoFillFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + } 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/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java index 1813af9..3e7064c 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestGetResponse.java @@ -10,231 +10,219 @@ * 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.SignatureRequestResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestGetResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public SignatureRequestGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestGetResponse.class); - } - - static public SignatureRequestGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestGetResponse.class - ); - } - - public SignatureRequestGetResponse signatureRequest(SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - return this; - } - - /** - * Get signatureRequest - * @return signatureRequest - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public SignatureRequestResponse getSignatureRequest() { - return signatureRequest; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequest(SignatureRequestResponse signatureRequest) { - this.signatureRequest = signatureRequest; - } - - - public SignatureRequestGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this SignatureRequestGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestGetResponse signatureRequestGetResponse = (SignatureRequestGetResponse) o; - return Objects.equals(this.signatureRequest, signatureRequestGetResponse.signatureRequest) && - Objects.equals(this.warnings, signatureRequestGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(signatureRequest, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestGetResponse {\n"); - sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).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 (signatureRequest != null) { - if (isFileTypeOrListOfFiles(signatureRequest)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_SIGNATURE_REQUEST = "signature_request"; + private SignatureRequestResponse signatureRequest; - if (signatureRequest.getClass().equals(java.io.File.class) || - signatureRequest.getClass().equals(Integer.class) || - signatureRequest.getClass().equals(String.class) || - signatureRequest.getClass().isEnum()) { - map.put("signature_request", signatureRequest); - } else if (isListOfFile(signatureRequest)) { - for(int i = 0; i< getListSize(signatureRequest); i++) { - map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); - } - } - else { - map.put("signature_request", JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public SignatureRequestGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestGetResponse.class); + } + + public static SignatureRequestGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestGetResponse.class); + } + + public SignatureRequestGetResponse signatureRequest(SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + return this; + } + + /** + * Get signatureRequest + * + * @return signatureRequest + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SignatureRequestResponse getSignatureRequest() { + return signatureRequest; + } + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequest(SignatureRequestResponse signatureRequest) { + this.signatureRequest = signatureRequest; + } + + public SignatureRequestGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public SignatureRequestGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this SignatureRequestGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestGetResponse signatureRequestGetResponse = (SignatureRequestGetResponse) o; + return Objects.equals(this.signatureRequest, signatureRequestGetResponse.signatureRequest) + && Objects.equals(this.warnings, signatureRequestGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(signatureRequest, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestGetResponse {\n"); + sb.append(" signatureRequest: ").append(toIndentedString(signatureRequest)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequest != null) { + if (isFileTypeOrListOfFiles(signatureRequest)) { + fileTypeFound = true; + } + + if (signatureRequest.getClass().equals(java.io.File.class) + || signatureRequest.getClass().equals(Integer.class) + || signatureRequest.getClass().equals(String.class) + || signatureRequest.getClass().isEnum()) { + map.put("signature_request", signatureRequest); + } else if (isListOfFile(signatureRequest)) { + for (int i = 0; i < getListSize(signatureRequest); i++) { + map.put("signature_request[" + i + "]", getFromList(signatureRequest, i)); + } + } else { + map.put( + "signature_request", + JSON.getDefault().getMapper().writeValueAsString(signatureRequest)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java index de380ad..4ae9712 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestListResponse.java @@ -10,290 +10,282 @@ * 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.ListInfoResponse; -import com.dropbox.sign.model.SignatureRequestResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestListResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestListResponse { - public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; - 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 = null; - - public SignatureRequestListResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestListResponse.class); - } - - static public SignatureRequestListResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestListResponse.class - ); - } - - public SignatureRequestListResponse signatureRequests(List signatureRequests) { - this.signatureRequests = signatureRequests; - return this; - } - - public SignatureRequestListResponse addSignatureRequestsItem(SignatureRequestResponse signatureRequestsItem) { - if (this.signatureRequests == null) { - this.signatureRequests = new ArrayList<>(); - } - this.signatureRequests.add(signatureRequestsItem); - return this; - } - - /** - * Contains information about signature requests. - * @return signatureRequests - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSignatureRequests() { - return signatureRequests; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureRequests(List signatureRequests) { - this.signatureRequests = signatureRequests; - } - - - public SignatureRequestListResponse 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 SignatureRequestListResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_SIGNATURE_REQUESTS = "signature_requests"; + 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 = null; + + public SignatureRequestListResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestListResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this SignatureRequestListResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static SignatureRequestListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestListResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public SignatureRequestListResponse signatureRequests( + List signatureRequests) { + this.signatureRequests = signatureRequests; + return this; } - SignatureRequestListResponse signatureRequestListResponse = (SignatureRequestListResponse) o; - return Objects.equals(this.signatureRequests, signatureRequestListResponse.signatureRequests) && - Objects.equals(this.listInfo, signatureRequestListResponse.listInfo) && - Objects.equals(this.warnings, signatureRequestListResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(signatureRequests, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestListResponse {\n"); - sb.append(" signatureRequests: ").append(toIndentedString(signatureRequests)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (signatureRequests != null) { - if (isFileTypeOrListOfFiles(signatureRequests)) { - fileTypeFound = true; - } - if (signatureRequests.getClass().equals(java.io.File.class) || - signatureRequests.getClass().equals(Integer.class) || - signatureRequests.getClass().equals(String.class) || - signatureRequests.getClass().isEnum()) { - map.put("signature_requests", signatureRequests); - } else if (isListOfFile(signatureRequests)) { - for(int i = 0; i< getListSize(signatureRequests); i++) { - map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); - } - } - else { - map.put("signature_requests", JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); + public SignatureRequestListResponse addSignatureRequestsItem( + SignatureRequestResponse signatureRequestsItem) { + if (this.signatureRequests == null) { + this.signatureRequests = new ArrayList<>(); } + this.signatureRequests.add(signatureRequestsItem); + return this; } - 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)); - } + /** + * Contains information about signature requests. + * + * @return signatureRequests + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSignatureRequests() { + return signatureRequests; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureRequests(List signatureRequests) { + this.signatureRequests = signatureRequests; + } + + public SignatureRequestListResponse 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 SignatureRequestListResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public SignatureRequestListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this SignatureRequestListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestListResponse signatureRequestListResponse = + (SignatureRequestListResponse) o; + return Objects.equals( + this.signatureRequests, signatureRequestListResponse.signatureRequests) + && Objects.equals(this.listInfo, signatureRequestListResponse.listInfo) + && Objects.equals(this.warnings, signatureRequestListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(signatureRequests, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestListResponse {\n"); + sb.append(" signatureRequests: ") + .append(toIndentedString(signatureRequests)) + .append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequests != null) { + if (isFileTypeOrListOfFiles(signatureRequests)) { + fileTypeFound = true; + } + + if (signatureRequests.getClass().equals(java.io.File.class) + || signatureRequests.getClass().equals(Integer.class) + || signatureRequests.getClass().equals(String.class) + || signatureRequests.getClass().isEnum()) { + map.put("signature_requests", signatureRequests); + } else if (isListOfFile(signatureRequests)) { + for (int i = 0; i < getListSize(signatureRequests); i++) { + map.put("signature_requests[" + i + "]", getFromList(signatureRequests, i)); + } + } else { + map.put( + "signature_requests", + JSON.getDefault().getMapper().writeValueAsString(signatureRequests)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java index b300412..b4343b7 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestRemindRequest.java @@ -10,219 +10,211 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestRemindRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestRemindRequest { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public SignatureRequestRemindRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestRemindRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestRemindRequest.class); - } - - static public SignatureRequestRemindRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestRemindRequest.class - ); - } - - public SignatureRequestRemindRequest emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer to send a reminder to. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - public SignatureRequestRemindRequest name(String name) { - this.name = 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 - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this SignatureRequestRemindRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestRemindRequest signatureRequestRemindRequest = (SignatureRequestRemindRequest) o; - return Objects.equals(this.emailAddress, signatureRequestRemindRequest.emailAddress) && - Objects.equals(this.name, signatureRequestRemindRequest.name); - } - - @Override - public int hashCode() { - return Objects.hash(emailAddress, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestRemindRequest {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - 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)); - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SignatureRequestRemindRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestRemindRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestRemindRequest.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public static SignatureRequestRemindRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestRemindRequest.class); + } + + public SignatureRequestRemindRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the signer to send a reminder to. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; + } + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public SignatureRequestRemindRequest name(String name) { + this.name = 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 @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this SignatureRequestRemindRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestRemindRequest signatureRequestRemindRequest = + (SignatureRequestRemindRequest) o; + return Objects.equals(this.emailAddress, signatureRequestRemindRequest.emailAddress) + && Objects.equals(this.name, signatureRequestRemindRequest.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(emailAddress, name); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestRemindRequest {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java index da6e723..ac3cf88 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponse.java @@ -10,1423 +10,1417 @@ * 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.SignatureRequestResponseAttachment; -import com.dropbox.sign.model.SignatureRequestResponseCustomFieldBase; -import com.dropbox.sign.model.SignatureRequestResponseDataBase; -import com.dropbox.sign.model.SignatureRequestResponseSignatures; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains information about a signature request. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestResponse { - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - private String signatureRequestId; + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + private String signatureRequestId; - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - private String requesterEmailAddress; + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + private String requesterEmailAddress; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; - private String originalTitle; + public static final String JSON_PROPERTY_ORIGINAL_TITLE = "original_title"; + private String originalTitle; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Object metadata; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Object metadata; - public static final String JSON_PROPERTY_CREATED_AT = "created_at"; - private Integer createdAt; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Integer createdAt; - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; - public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; - private Boolean isComplete; + public static final String JSON_PROPERTY_IS_COMPLETE = "is_complete"; + private Boolean isComplete; - public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; - private Boolean isDeclined; + public static final String JSON_PROPERTY_IS_DECLINED = "is_declined"; + private Boolean isDeclined; - public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; - private Boolean hasError; + public static final String JSON_PROPERTY_HAS_ERROR = "has_error"; + private Boolean hasError; - public static final String JSON_PROPERTY_FILES_URL = "files_url"; - private String filesUrl; + public static final String JSON_PROPERTY_FILES_URL = "files_url"; + private String filesUrl; - public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; - private String signingUrl; + public static final String JSON_PROPERTY_SIGNING_URL = "signing_url"; + private String signingUrl; - public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; - private String detailsUrl; + public static final String JSON_PROPERTY_DETAILS_URL = "details_url"; + private String detailsUrl; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; - private String finalCopyUri; + public static final String JSON_PROPERTY_FINAL_COPY_URI = "final_copy_uri"; + private String finalCopyUri; - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = null; + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; - private List responseData = null; + public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; + private List responseData = null; - public static final String JSON_PROPERTY_SIGNATURES = "signatures"; - private List signatures = null; + public static final String JSON_PROPERTY_SIGNATURES = "signatures"; + private List signatures = null; - public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; - private String bulkSendJobId; + public static final String JSON_PROPERTY_BULK_SEND_JOB_ID = "bulk_send_job_id"; + private String bulkSendJobId; - public SignatureRequestResponse() { - } + public SignatureRequestResponse() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponse.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponse.class); + } - static public SignatureRequestResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponse.class - ); - } + public static SignatureRequestResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponse.class); + } - public SignatureRequestResponse testMode(Boolean testMode) { - this.testMode = testMode; - return this; - } + public SignatureRequestResponse testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } - /** - * Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. - * @return testMode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Whether this is a test signature request. Test requests have no legal value. Defaults to + * `false`. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } - public Boolean getTestMode() { - return testMode; - } + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + public SignatureRequestResponse signatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; + } - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } + /** + * The id of the SignatureRequest. + * + * @return signatureRequestId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignatureRequestId() { + return signatureRequestId; + } + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + } - public SignatureRequestResponse signatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } + public SignatureRequestResponse requesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } - /** - * The id of the SignatureRequest. - * @return signatureRequestId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The email address of the initiator of the SignatureRequest. + * + * @return requesterEmailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } - public String getSignatureRequestId() { - return signatureRequestId; - } + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + public SignatureRequestResponse title(String title) { + this.title = title; + return this; + } - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } + /** + * The title the specified Account uses for the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } - public SignatureRequestResponse requesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } + public SignatureRequestResponse originalTitle(String originalTitle) { + this.originalTitle = originalTitle; + return this; + } - /** - * The email address of the initiator of the SignatureRequest. - * @return requesterEmailAddress - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - - public SignatureRequestResponse title(String title) { - this.title = title; - return this; - } - - /** - * The title the specified Account uses for the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public SignatureRequestResponse originalTitle(String originalTitle) { - this.originalTitle = originalTitle; - return this; - } - - /** - * Default Label for account. - * @return originalTitle - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getOriginalTitle() { - return originalTitle; - } - - - @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalTitle(String originalTitle) { - this.originalTitle = originalTitle; - } - - - public SignatureRequestResponse subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that was initially sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestResponse message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that was initially sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestResponse metadata(Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * The metadata attached to the signature request. - * @return metadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Object metadata) { - this.metadata = metadata; - } - - - public SignatureRequestResponse createdAt(Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Time the signature request was created. - * @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 SignatureRequestResponse expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - public SignatureRequestResponse isComplete(Boolean isComplete) { - this.isComplete = isComplete; - return this; - } - - /** - * Whether or not the SignatureRequest has been fully executed by all signers. - * @return isComplete - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsComplete() { - return isComplete; - } - - - @JsonProperty(JSON_PROPERTY_IS_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsComplete(Boolean isComplete) { - this.isComplete = isComplete; - } - - - public SignatureRequestResponse isDeclined(Boolean isDeclined) { - this.isDeclined = isDeclined; - return this; - } - - /** - * Whether or not the SignatureRequest has been declined by a signer. - * @return isDeclined - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsDeclined() { - return isDeclined; - } - - - @JsonProperty(JSON_PROPERTY_IS_DECLINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsDeclined(Boolean isDeclined) { - this.isDeclined = isDeclined; - } - - - public SignatureRequestResponse hasError(Boolean hasError) { - this.hasError = 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 - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Default Label for account. + * + * @return originalTitle + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOriginalTitle() { + return originalTitle; + } - public Boolean getHasError() { - return hasError; - } - - - @JsonProperty(JSON_PROPERTY_HAS_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasError(Boolean hasError) { - this.hasError = hasError; - } - - - public SignatureRequestResponse filesUrl(String filesUrl) { - this.filesUrl = filesUrl; - return this; - } - - /** - * The URL where a copy of the request's documents can be downloaded. - * @return filesUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_ORIGINAL_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalTitle(String originalTitle) { + this.originalTitle = originalTitle; + } - public String getFilesUrl() { - return filesUrl; - } - - - @JsonProperty(JSON_PROPERTY_FILES_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilesUrl(String filesUrl) { - this.filesUrl = filesUrl; - } - - - public SignatureRequestResponse signingUrl(String signingUrl) { - this.signingUrl = 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 - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SignatureRequestResponse subject(String subject) { + this.subject = subject; + return this; + } - public String getSigningUrl() { - return signingUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningUrl(String signingUrl) { - this.signingUrl = signingUrl; - } - - - public SignatureRequestResponse detailsUrl(String detailsUrl) { - this.detailsUrl = detailsUrl; - return this; - } - - /** - * The URL where the requester and the signers can view the current status of the SignatureRequest. - * @return detailsUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The subject in the email that was initially sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - public String getDetailsUrl() { - return detailsUrl; - } + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + public SignatureRequestResponse message(String message) { + this.message = message; + return this; + } - @JsonProperty(JSON_PROPERTY_DETAILS_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDetailsUrl(String detailsUrl) { - this.detailsUrl = detailsUrl; - } - - - public SignatureRequestResponse ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); - } - this.ccEmailAddresses.add(ccEmailAddressesItem); - 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 - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - - public SignatureRequestResponse signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want the signer redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public SignatureRequestResponse finalCopyUri(String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - return this; - } - - /** - * The path where the completed document can be downloaded - * @return finalCopyUri - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFinalCopyUri() { - return finalCopyUri; - } - - - @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFinalCopyUri(String finalCopyUri) { - this.finalCopyUri = finalCopyUri; - } - - - public SignatureRequestResponse templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + /** + * The custom message in the email that was initially sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } - public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; } - this.templateIds.add(templateIdsItem); - return this; - } - - /** - * Templates IDs used in this SignatureRequest (if any). - * @return templateIds - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getTemplateIds() { - return templateIds; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } - - - public SignatureRequestResponse customFields(List customFields) { - this.customFields = customFields; - return this; - } - public SignatureRequestResponse addCustomFieldsItem(SignatureRequestResponseCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + public SignatureRequestResponse metadata(Object metadata) { + this.metadata = metadata; + return this; } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } + /** + * The metadata attached to the signature request. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMetadata() { + return metadata; + } - public SignatureRequestResponse attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public SignatureRequestResponse addAttachmentsItem(SignatureRequestResponseAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * Signer attachments. - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + public SignatureRequestResponse createdAt(Integer createdAt) { + this.createdAt = createdAt; + return this; + } - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public SignatureRequestResponse responseData(List responseData) { - this.responseData = responseData; - return this; - } - - public SignatureRequestResponse addResponseDataItem(SignatureRequestResponseDataBase responseDataItem) { - if (this.responseData == null) { - this.responseData = new ArrayList<>(); - } - this.responseData.add(responseDataItem); - 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 - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getResponseData() { - return responseData; - } - - - @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseData(List responseData) { - this.responseData = responseData; - } - - - public SignatureRequestResponse signatures(List signatures) { - this.signatures = signatures; - return this; - } - - public SignatureRequestResponse addSignaturesItem(SignatureRequestResponseSignatures signaturesItem) { - if (this.signatures == null) { - this.signatures = new ArrayList<>(); - } - this.signatures.add(signaturesItem); - return this; - } - - /** - * An array of signature objects, 1 for each signer. - * @return signatures - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignatures() { - return signatures; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatures(List signatures) { - this.signatures = signatures; - } - - - public SignatureRequestResponse bulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - return this; - } - - /** - * The ID of the Bulk Send job which sent the signature request, if applicable. - * @return bulkSendJobId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBulkSendJobId() { - return bulkSendJobId; - } - - - @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBulkSendJobId(String bulkSendJobId) { - this.bulkSendJobId = bulkSendJobId; - } - - - /** - * Return true if this SignatureRequestResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponse signatureRequestResponse = (SignatureRequestResponse) o; - return Objects.equals(this.testMode, signatureRequestResponse.testMode) && - Objects.equals(this.signatureRequestId, signatureRequestResponse.signatureRequestId) && - Objects.equals(this.requesterEmailAddress, signatureRequestResponse.requesterEmailAddress) && - Objects.equals(this.title, signatureRequestResponse.title) && - Objects.equals(this.originalTitle, signatureRequestResponse.originalTitle) && - Objects.equals(this.subject, signatureRequestResponse.subject) && - Objects.equals(this.message, signatureRequestResponse.message) && - Objects.equals(this.metadata, signatureRequestResponse.metadata) && - Objects.equals(this.createdAt, signatureRequestResponse.createdAt) && - Objects.equals(this.expiresAt, signatureRequestResponse.expiresAt) && - Objects.equals(this.isComplete, signatureRequestResponse.isComplete) && - Objects.equals(this.isDeclined, signatureRequestResponse.isDeclined) && - Objects.equals(this.hasError, signatureRequestResponse.hasError) && - Objects.equals(this.filesUrl, signatureRequestResponse.filesUrl) && - Objects.equals(this.signingUrl, signatureRequestResponse.signingUrl) && - Objects.equals(this.detailsUrl, signatureRequestResponse.detailsUrl) && - Objects.equals(this.ccEmailAddresses, signatureRequestResponse.ccEmailAddresses) && - Objects.equals(this.signingRedirectUrl, signatureRequestResponse.signingRedirectUrl) && - Objects.equals(this.finalCopyUri, signatureRequestResponse.finalCopyUri) && - Objects.equals(this.templateIds, signatureRequestResponse.templateIds) && - Objects.equals(this.customFields, signatureRequestResponse.customFields) && - Objects.equals(this.attachments, signatureRequestResponse.attachments) && - Objects.equals(this.responseData, signatureRequestResponse.responseData) && - Objects.equals(this.signatures, signatureRequestResponse.signatures) && - Objects.equals(this.bulkSendJobId, signatureRequestResponse.bulkSendJobId); - } - - @Override - public int hashCode() { - return Objects.hash(testMode, signatureRequestId, requesterEmailAddress, title, originalTitle, subject, message, metadata, createdAt, expiresAt, isComplete, isDeclined, hasError, filesUrl, signingUrl, detailsUrl, ccEmailAddresses, signingRedirectUrl, finalCopyUri, templateIds, customFields, attachments, responseData, signatures, bulkSendJobId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponse {\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); - sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); - sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); - sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); - sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); - sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); - sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); - sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); - sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } + /** + * Time the signature request was created. + * + * @return createdAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCreatedAt() { + return createdAt; + } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; } - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - if (signatureRequestId.getClass().equals(java.io.File.class) || - signatureRequestId.getClass().equals(Integer.class) || - signatureRequestId.getClass().equals(String.class) || - signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for(int i = 0; i< getListSize(signatureRequestId); i++) { - map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); - } - } - else { - map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } + public SignatureRequestResponse expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - if (requesterEmailAddress.getClass().equals(java.io.File.class) || - requesterEmailAddress.getClass().equals(Integer.class) || - requesterEmailAddress.getClass().equals(String.class) || - requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for(int i = 0; i< getListSize(requesterEmailAddress); i++) { - map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); - } - } - else { - map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; } - if (originalTitle != null) { - if (isFileTypeOrListOfFiles(originalTitle)) { - fileTypeFound = true; - } - if (originalTitle.getClass().equals(java.io.File.class) || - originalTitle.getClass().equals(Integer.class) || - originalTitle.getClass().equals(String.class) || - originalTitle.getClass().isEnum()) { - map.put("original_title", originalTitle); - } else if (isListOfFile(originalTitle)) { - for(int i = 0; i< getListSize(originalTitle); i++) { - map.put("original_title[" + i + "]", getFromList(originalTitle, i)); - } - } - else { - map.put("original_title", JSON.getDefault().getMapper().writeValueAsString(originalTitle)); - } + public SignatureRequestResponse isComplete(Boolean isComplete) { + this.isComplete = isComplete; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + /** + * Whether or not the SignatureRequest has been fully executed by all signers. + * + * @return isComplete + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsComplete() { + return isComplete; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + @JsonProperty(JSON_PROPERTY_IS_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsComplete(Boolean isComplete) { + this.isComplete = isComplete; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + public SignatureRequestResponse isDeclined(Boolean isDeclined) { + this.isDeclined = isDeclined; + return this; } - 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)); - } + /** + * Whether or not the SignatureRequest has been declined by a signer. + * + * @return isDeclined + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDeclined() { + return isDeclined; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } + @JsonProperty(JSON_PROPERTY_IS_DECLINED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsDeclined(Boolean isDeclined) { + this.isDeclined = isDeclined; } - if (isComplete != null) { - if (isFileTypeOrListOfFiles(isComplete)) { - fileTypeFound = true; - } - if (isComplete.getClass().equals(java.io.File.class) || - isComplete.getClass().equals(Integer.class) || - isComplete.getClass().equals(String.class) || - isComplete.getClass().isEnum()) { - map.put("is_complete", isComplete); - } else if (isListOfFile(isComplete)) { - for(int i = 0; i< getListSize(isComplete); i++) { - map.put("is_complete[" + i + "]", getFromList(isComplete, i)); - } - } - else { - map.put("is_complete", JSON.getDefault().getMapper().writeValueAsString(isComplete)); - } + public SignatureRequestResponse hasError(Boolean hasError) { + this.hasError = hasError; + return this; } - if (isDeclined != null) { - if (isFileTypeOrListOfFiles(isDeclined)) { - fileTypeFound = true; - } - if (isDeclined.getClass().equals(java.io.File.class) || - isDeclined.getClass().equals(Integer.class) || - isDeclined.getClass().equals(String.class) || - isDeclined.getClass().isEnum()) { - map.put("is_declined", isDeclined); - } else if (isListOfFile(isDeclined)) { - for(int i = 0; i< getListSize(isDeclined); i++) { - map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); - } - } - else { - map.put("is_declined", JSON.getDefault().getMapper().writeValueAsString(isDeclined)); - } + /** + * Whether or not an error occurred (either during the creation of the SignatureRequest or + * during one of the signings). + * + * @return hasError + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasError() { + return hasError; } - if (hasError != null) { - if (isFileTypeOrListOfFiles(hasError)) { - fileTypeFound = true; - } - if (hasError.getClass().equals(java.io.File.class) || - hasError.getClass().equals(Integer.class) || - hasError.getClass().equals(String.class) || - hasError.getClass().isEnum()) { - map.put("has_error", hasError); - } else if (isListOfFile(hasError)) { - for(int i = 0; i< getListSize(hasError); i++) { - map.put("has_error[" + i + "]", getFromList(hasError, i)); - } - } - else { - map.put("has_error", JSON.getDefault().getMapper().writeValueAsString(hasError)); - } + @JsonProperty(JSON_PROPERTY_HAS_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasError(Boolean hasError) { + this.hasError = hasError; } - if (filesUrl != null) { - if (isFileTypeOrListOfFiles(filesUrl)) { - fileTypeFound = true; - } - if (filesUrl.getClass().equals(java.io.File.class) || - filesUrl.getClass().equals(Integer.class) || - filesUrl.getClass().equals(String.class) || - filesUrl.getClass().isEnum()) { - map.put("files_url", filesUrl); - } else if (isListOfFile(filesUrl)) { - for(int i = 0; i< getListSize(filesUrl); i++) { - map.put("files_url[" + i + "]", getFromList(filesUrl, i)); - } - } - else { - map.put("files_url", JSON.getDefault().getMapper().writeValueAsString(filesUrl)); - } + public SignatureRequestResponse filesUrl(String filesUrl) { + this.filesUrl = filesUrl; + return this; } - if (signingUrl != null) { - if (isFileTypeOrListOfFiles(signingUrl)) { - fileTypeFound = true; - } - if (signingUrl.getClass().equals(java.io.File.class) || - signingUrl.getClass().equals(Integer.class) || - signingUrl.getClass().equals(String.class) || - signingUrl.getClass().isEnum()) { - map.put("signing_url", signingUrl); - } else if (isListOfFile(signingUrl)) { - for(int i = 0; i< getListSize(signingUrl); i++) { - map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); - } - } - else { - map.put("signing_url", JSON.getDefault().getMapper().writeValueAsString(signingUrl)); - } + /** + * The URL where a copy of the request's documents can be downloaded. + * + * @return filesUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilesUrl() { + return filesUrl; } - if (detailsUrl != null) { - if (isFileTypeOrListOfFiles(detailsUrl)) { - fileTypeFound = true; - } - if (detailsUrl.getClass().equals(java.io.File.class) || - detailsUrl.getClass().equals(Integer.class) || - detailsUrl.getClass().equals(String.class) || - detailsUrl.getClass().isEnum()) { - map.put("details_url", detailsUrl); - } else if (isListOfFile(detailsUrl)) { - for(int i = 0; i< getListSize(detailsUrl); i++) { - map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); - } - } - else { - map.put("details_url", JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); - } + @JsonProperty(JSON_PROPERTY_FILES_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesUrl(String filesUrl) { + this.filesUrl = filesUrl; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } + public SignatureRequestResponse signingUrl(String signingUrl) { + this.signingUrl = signingUrl; + return this; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningUrl() { + return signingUrl; } - if (finalCopyUri != null) { - if (isFileTypeOrListOfFiles(finalCopyUri)) { - fileTypeFound = true; - } - if (finalCopyUri.getClass().equals(java.io.File.class) || - finalCopyUri.getClass().equals(Integer.class) || - finalCopyUri.getClass().equals(String.class) || - finalCopyUri.getClass().isEnum()) { - map.put("final_copy_uri", finalCopyUri); - } else if (isListOfFile(finalCopyUri)) { - for(int i = 0; i< getListSize(finalCopyUri); i++) { - map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); - } - } - else { - map.put("final_copy_uri", JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); - } + @JsonProperty(JSON_PROPERTY_SIGNING_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningUrl(String signingUrl) { + this.signingUrl = signingUrl; } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + public SignatureRequestResponse detailsUrl(String detailsUrl) { + this.detailsUrl = detailsUrl; + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + /** + * The URL where the requester and the signers can view the current status of the + * SignatureRequest. + * + * @return detailsUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetailsUrl() { + return detailsUrl; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + @JsonProperty(JSON_PROPERTY_DETAILS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetailsUrl(String detailsUrl) { + this.detailsUrl = detailsUrl; } - if (responseData != null) { - if (isFileTypeOrListOfFiles(responseData)) { - fileTypeFound = true; - } - if (responseData.getClass().equals(java.io.File.class) || - responseData.getClass().equals(Integer.class) || - responseData.getClass().equals(String.class) || - responseData.getClass().isEnum()) { - map.put("response_data", responseData); - } else if (isListOfFile(responseData)) { - for(int i = 0; i< getListSize(responseData); i++) { - map.put("response_data[" + i + "]", getFromList(responseData, i)); - } - } - else { - map.put("response_data", JSON.getDefault().getMapper().writeValueAsString(responseData)); - } + public SignatureRequestResponse ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - if (signatures != null) { - if (isFileTypeOrListOfFiles(signatures)) { - fileTypeFound = true; + + public SignatureRequestResponse addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } - if (signatures.getClass().equals(java.io.File.class) || - signatures.getClass().equals(Integer.class) || - signatures.getClass().equals(String.class) || - signatures.getClass().isEnum()) { - map.put("signatures", signatures); - } else if (isListOfFile(signatures)) { - for(int i = 0; i< getListSize(signatures); i++) { - map.put("signatures[" + i + "]", getFromList(signatures, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } + + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } + + public SignatureRequestResponse signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want the signer redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public SignatureRequestResponse finalCopyUri(String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + return this; + } + + /** + * The path where the completed document can be downloaded + * + * @return finalCopyUri + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFinalCopyUri() { + return finalCopyUri; + } + + @JsonProperty(JSON_PROPERTY_FINAL_COPY_URI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFinalCopyUri(String finalCopyUri) { + this.finalCopyUri = finalCopyUri; + } + + public SignatureRequestResponse templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } + + public SignatureRequestResponse addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); } - else { - map.put("signatures", JSON.getDefault().getMapper().writeValueAsString(signatures)); + this.templateIds.add(templateIdsItem); + return this; + } + + /** + * Templates IDs used in this SignatureRequest (if any). + * + * @return templateIds + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTemplateIds() { + return templateIds; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + + public SignatureRequestResponse customFields( + List customFields) { + this.customFields = customFields; + return this; + } + + public SignatureRequestResponse addCustomFieldsItem( + SignatureRequestResponseCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SignatureRequestResponse attachments( + List attachments) { + this.attachments = attachments; + return this; } - if (bulkSendJobId != null) { - if (isFileTypeOrListOfFiles(bulkSendJobId)) { - fileTypeFound = true; + + public SignatureRequestResponse addAttachmentsItem( + SignatureRequestResponseAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } + this.attachments.add(attachmentsItem); + return this; + } - if (bulkSendJobId.getClass().equals(java.io.File.class) || - bulkSendJobId.getClass().equals(Integer.class) || - bulkSendJobId.getClass().equals(String.class) || - bulkSendJobId.getClass().isEnum()) { - map.put("bulk_send_job_id", bulkSendJobId); - } else if (isListOfFile(bulkSendJobId)) { - for(int i = 0; i< getListSize(bulkSendJobId); i++) { - map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); - } + /** + * Signer attachments. + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + public SignatureRequestResponse responseData( + List responseData) { + this.responseData = responseData; + return this; + } + + public SignatureRequestResponse addResponseDataItem( + SignatureRequestResponseDataBase responseDataItem) { + if (this.responseData == null) { + this.responseData = new ArrayList<>(); } - else { - map.put("bulk_send_job_id", JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + this.responseData.add(responseDataItem); + 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 @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getResponseData() { + return responseData; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseData(List responseData) { + this.responseData = responseData; + } + + public SignatureRequestResponse signatures( + List signatures) { + this.signatures = signatures; + return this; + } + + public SignatureRequestResponse addSignaturesItem( + SignatureRequestResponseSignatures signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); } + this.signatures.add(signaturesItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * An array of signature objects, 1 for each signer. + * + * @return signatures + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignatures() { + return signatures; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatures(List signatures) { + this.signatures = signatures; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public SignatureRequestResponse bulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * The ID of the Bulk Send job which sent the signature request, if applicable. + * + * @return bulkSendJobId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBulkSendJobId() { + return bulkSendJobId; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_BULK_SEND_JOB_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBulkSendJobId(String bulkSendJobId) { + this.bulkSendJobId = bulkSendJobId; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + /** Return true if this SignatureRequestResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestResponse signatureRequestResponse = (SignatureRequestResponse) o; + return Objects.equals(this.testMode, signatureRequestResponse.testMode) + && Objects.equals( + this.signatureRequestId, signatureRequestResponse.signatureRequestId) + && Objects.equals( + this.requesterEmailAddress, signatureRequestResponse.requesterEmailAddress) + && Objects.equals(this.title, signatureRequestResponse.title) + && Objects.equals(this.originalTitle, signatureRequestResponse.originalTitle) + && Objects.equals(this.subject, signatureRequestResponse.subject) + && Objects.equals(this.message, signatureRequestResponse.message) + && Objects.equals(this.metadata, signatureRequestResponse.metadata) + && Objects.equals(this.createdAt, signatureRequestResponse.createdAt) + && Objects.equals(this.expiresAt, signatureRequestResponse.expiresAt) + && Objects.equals(this.isComplete, signatureRequestResponse.isComplete) + && Objects.equals(this.isDeclined, signatureRequestResponse.isDeclined) + && Objects.equals(this.hasError, signatureRequestResponse.hasError) + && Objects.equals(this.filesUrl, signatureRequestResponse.filesUrl) + && Objects.equals(this.signingUrl, signatureRequestResponse.signingUrl) + && Objects.equals(this.detailsUrl, signatureRequestResponse.detailsUrl) + && Objects.equals(this.ccEmailAddresses, signatureRequestResponse.ccEmailAddresses) + && Objects.equals( + this.signingRedirectUrl, signatureRequestResponse.signingRedirectUrl) + && Objects.equals(this.finalCopyUri, signatureRequestResponse.finalCopyUri) + && Objects.equals(this.templateIds, signatureRequestResponse.templateIds) + && Objects.equals(this.customFields, signatureRequestResponse.customFields) + && Objects.equals(this.attachments, signatureRequestResponse.attachments) + && Objects.equals(this.responseData, signatureRequestResponse.responseData) + && Objects.equals(this.signatures, signatureRequestResponse.signatures) + && Objects.equals(this.bulkSendJobId, signatureRequestResponse.bulkSendJobId); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + @Override + public int hashCode() { + return Objects.hash( + testMode, + signatureRequestId, + requesterEmailAddress, + title, + originalTitle, + subject, + message, + metadata, + createdAt, + expiresAt, + isComplete, + isDeclined, + hasError, + filesUrl, + signingUrl, + detailsUrl, + ccEmailAddresses, + signingRedirectUrl, + finalCopyUri, + templateIds, + customFields, + attachments, + responseData, + signatures, + bulkSendJobId); + } - /** - * 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"; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponse {\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" signatureRequestId: ") + .append(toIndentedString(signatureRequestId)) + .append("\n"); + sb.append(" requesterEmailAddress: ") + .append(toIndentedString(requesterEmailAddress)) + .append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" originalTitle: ").append(toIndentedString(originalTitle)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" isComplete: ").append(toIndentedString(isComplete)).append("\n"); + sb.append(" isDeclined: ").append(toIndentedString(isDeclined)).append("\n"); + sb.append(" hasError: ").append(toIndentedString(hasError)).append("\n"); + sb.append(" filesUrl: ").append(toIndentedString(filesUrl)).append("\n"); + sb.append(" signingUrl: ").append(toIndentedString(signingUrl)).append("\n"); + sb.append(" detailsUrl: ").append(toIndentedString(detailsUrl)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" finalCopyUri: ").append(toIndentedString(finalCopyUri)).append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" responseData: ").append(toIndentedString(responseData)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append(" bulkSendJobId: ").append(toIndentedString(bulkSendJobId)).append("\n"); + sb.append("}"); + return sb.toString(); } - return o.toString().replace("\n", "\n "); - } -} + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } + + if (signatureRequestId.getClass().equals(java.io.File.class) + || signatureRequestId.getClass().equals(Integer.class) + || signatureRequestId.getClass().equals(String.class) + || signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for (int i = 0; i < getListSize(signatureRequestId); i++) { + map.put( + "signature_request_id[" + i + "]", + getFromList(signatureRequestId, i)); + } + } else { + map.put( + "signature_request_id", + JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); + } + } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } + + if (requesterEmailAddress.getClass().equals(java.io.File.class) + || requesterEmailAddress.getClass().equals(Integer.class) + || requesterEmailAddress.getClass().equals(String.class) + || requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for (int i = 0; i < getListSize(requesterEmailAddress); i++) { + map.put( + "requester_email_address[" + i + "]", + getFromList(requesterEmailAddress, i)); + } + } else { + map.put( + "requester_email_address", + JSON.getDefault() + .getMapper() + .writeValueAsString(requesterEmailAddress)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (originalTitle != null) { + if (isFileTypeOrListOfFiles(originalTitle)) { + fileTypeFound = true; + } + + if (originalTitle.getClass().equals(java.io.File.class) + || originalTitle.getClass().equals(Integer.class) + || originalTitle.getClass().equals(String.class) + || originalTitle.getClass().isEnum()) { + map.put("original_title", originalTitle); + } else if (isListOfFile(originalTitle)) { + for (int i = 0; i < getListSize(originalTitle); i++) { + map.put("original_title[" + i + "]", getFromList(originalTitle, i)); + } + } else { + map.put( + "original_title", + JSON.getDefault().getMapper().writeValueAsString(originalTitle)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (createdAt != null) { + if (isFileTypeOrListOfFiles(createdAt)) { + fileTypeFound = true; + } + + if (createdAt.getClass().equals(java.io.File.class) + || createdAt.getClass().equals(Integer.class) + || createdAt.getClass().equals(String.class) + || createdAt.getClass().isEnum()) { + map.put("created_at", createdAt); + } else if (isListOfFile(createdAt)) { + for (int i = 0; i < getListSize(createdAt); i++) { + map.put("created_at[" + i + "]", getFromList(createdAt, i)); + } + } else { + map.put( + "created_at", + JSON.getDefault().getMapper().writeValueAsString(createdAt)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + if (isComplete != null) { + if (isFileTypeOrListOfFiles(isComplete)) { + fileTypeFound = true; + } + + if (isComplete.getClass().equals(java.io.File.class) + || isComplete.getClass().equals(Integer.class) + || isComplete.getClass().equals(String.class) + || isComplete.getClass().isEnum()) { + map.put("is_complete", isComplete); + } else if (isListOfFile(isComplete)) { + for (int i = 0; i < getListSize(isComplete); i++) { + map.put("is_complete[" + i + "]", getFromList(isComplete, i)); + } + } else { + map.put( + "is_complete", + JSON.getDefault().getMapper().writeValueAsString(isComplete)); + } + } + if (isDeclined != null) { + if (isFileTypeOrListOfFiles(isDeclined)) { + fileTypeFound = true; + } + + if (isDeclined.getClass().equals(java.io.File.class) + || isDeclined.getClass().equals(Integer.class) + || isDeclined.getClass().equals(String.class) + || isDeclined.getClass().isEnum()) { + map.put("is_declined", isDeclined); + } else if (isListOfFile(isDeclined)) { + for (int i = 0; i < getListSize(isDeclined); i++) { + map.put("is_declined[" + i + "]", getFromList(isDeclined, i)); + } + } else { + map.put( + "is_declined", + JSON.getDefault().getMapper().writeValueAsString(isDeclined)); + } + } + if (hasError != null) { + if (isFileTypeOrListOfFiles(hasError)) { + fileTypeFound = true; + } + + if (hasError.getClass().equals(java.io.File.class) + || hasError.getClass().equals(Integer.class) + || hasError.getClass().equals(String.class) + || hasError.getClass().isEnum()) { + map.put("has_error", hasError); + } else if (isListOfFile(hasError)) { + for (int i = 0; i < getListSize(hasError); i++) { + map.put("has_error[" + i + "]", getFromList(hasError, i)); + } + } else { + map.put( + "has_error", + JSON.getDefault().getMapper().writeValueAsString(hasError)); + } + } + if (filesUrl != null) { + if (isFileTypeOrListOfFiles(filesUrl)) { + fileTypeFound = true; + } + + if (filesUrl.getClass().equals(java.io.File.class) + || filesUrl.getClass().equals(Integer.class) + || filesUrl.getClass().equals(String.class) + || filesUrl.getClass().isEnum()) { + map.put("files_url", filesUrl); + } else if (isListOfFile(filesUrl)) { + for (int i = 0; i < getListSize(filesUrl); i++) { + map.put("files_url[" + i + "]", getFromList(filesUrl, i)); + } + } else { + map.put( + "files_url", + JSON.getDefault().getMapper().writeValueAsString(filesUrl)); + } + } + if (signingUrl != null) { + if (isFileTypeOrListOfFiles(signingUrl)) { + fileTypeFound = true; + } + + if (signingUrl.getClass().equals(java.io.File.class) + || signingUrl.getClass().equals(Integer.class) + || signingUrl.getClass().equals(String.class) + || signingUrl.getClass().isEnum()) { + map.put("signing_url", signingUrl); + } else if (isListOfFile(signingUrl)) { + for (int i = 0; i < getListSize(signingUrl); i++) { + map.put("signing_url[" + i + "]", getFromList(signingUrl, i)); + } + } else { + map.put( + "signing_url", + JSON.getDefault().getMapper().writeValueAsString(signingUrl)); + } + } + if (detailsUrl != null) { + if (isFileTypeOrListOfFiles(detailsUrl)) { + fileTypeFound = true; + } + + if (detailsUrl.getClass().equals(java.io.File.class) + || detailsUrl.getClass().equals(Integer.class) + || detailsUrl.getClass().equals(String.class) + || detailsUrl.getClass().isEnum()) { + map.put("details_url", detailsUrl); + } else if (isListOfFile(detailsUrl)) { + for (int i = 0; i < getListSize(detailsUrl); i++) { + map.put("details_url[" + i + "]", getFromList(detailsUrl, i)); + } + } else { + map.put( + "details_url", + JSON.getDefault().getMapper().writeValueAsString(detailsUrl)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (finalCopyUri != null) { + if (isFileTypeOrListOfFiles(finalCopyUri)) { + fileTypeFound = true; + } + + if (finalCopyUri.getClass().equals(java.io.File.class) + || finalCopyUri.getClass().equals(Integer.class) + || finalCopyUri.getClass().equals(String.class) + || finalCopyUri.getClass().isEnum()) { + map.put("final_copy_uri", finalCopyUri); + } else if (isListOfFile(finalCopyUri)) { + for (int i = 0; i < getListSize(finalCopyUri); i++) { + map.put("final_copy_uri[" + i + "]", getFromList(finalCopyUri, i)); + } + } else { + map.put( + "final_copy_uri", + JSON.getDefault().getMapper().writeValueAsString(finalCopyUri)); + } + } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (responseData != null) { + if (isFileTypeOrListOfFiles(responseData)) { + fileTypeFound = true; + } + + if (responseData.getClass().equals(java.io.File.class) + || responseData.getClass().equals(Integer.class) + || responseData.getClass().equals(String.class) + || responseData.getClass().isEnum()) { + map.put("response_data", responseData); + } else if (isListOfFile(responseData)) { + for (int i = 0; i < getListSize(responseData); i++) { + map.put("response_data[" + i + "]", getFromList(responseData, i)); + } + } else { + map.put( + "response_data", + JSON.getDefault().getMapper().writeValueAsString(responseData)); + } + } + if (signatures != null) { + if (isFileTypeOrListOfFiles(signatures)) { + fileTypeFound = true; + } + + if (signatures.getClass().equals(java.io.File.class) + || signatures.getClass().equals(Integer.class) + || signatures.getClass().equals(String.class) + || signatures.getClass().isEnum()) { + map.put("signatures", signatures); + } else if (isListOfFile(signatures)) { + for (int i = 0; i < getListSize(signatures); i++) { + map.put("signatures[" + i + "]", getFromList(signatures, i)); + } + } else { + map.put( + "signatures", + JSON.getDefault().getMapper().writeValueAsString(signatures)); + } + } + if (bulkSendJobId != null) { + if (isFileTypeOrListOfFiles(bulkSendJobId)) { + fileTypeFound = true; + } + + if (bulkSendJobId.getClass().equals(java.io.File.class) + || bulkSendJobId.getClass().equals(Integer.class) + || bulkSendJobId.getClass().equals(String.class) + || bulkSendJobId.getClass().isEnum()) { + map.put("bulk_send_job_id", bulkSendJobId); + } else if (isListOfFile(bulkSendJobId)) { + for (int i = 0; i < getListSize(bulkSendJobId); i++) { + map.put("bulk_send_job_id[" + i + "]", getFromList(bulkSendJobId, i)); + } + } else { + map.put( + "bulk_send_job_id", + JSON.getDefault().getMapper().writeValueAsString(bulkSendJobId)); + } + } + } 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java index 3230732..8d4e942 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseAttachment.java @@ -10,427 +10,409 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Signer attachments. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestResponseAttachment { - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - private String signer; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; - - public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; - private String instructions; - - public static final String JSON_PROPERTY_UPLOADED_AT = "uploaded_at"; - private Integer uploadedAt; - - public SignatureRequestResponseAttachment() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseAttachment init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseAttachment.class); - } - - static public SignatureRequestResponseAttachment init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseAttachment.class - ); - } - - public SignatureRequestResponseAttachment id(String id) { - this.id = id; - return this; - } - - /** - * The unique ID for this attachment. - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(String id) { - this.id = id; - } - - - 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 - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getSigner() { - return signer; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - 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 - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SignatureRequestResponseAttachment required(Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this attachment is required. - * @return required - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public SignatureRequestResponseAttachment instructions(String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Instructions for Signer. - * @return instructions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getInstructions() { - return instructions; - } - - - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInstructions(String instructions) { - this.instructions = instructions; - } - - - public SignatureRequestResponseAttachment uploadedAt(Integer uploadedAt) { - this.uploadedAt = uploadedAt; - return this; - } - - /** - * Timestamp when attachment was uploaded by Signer. - * @return uploadedAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UPLOADED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getUploadedAt() { - return uploadedAt; - } - - - @JsonProperty(JSON_PROPERTY_UPLOADED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUploadedAt(Integer uploadedAt) { - this.uploadedAt = uploadedAt; - } - - - /** - * Return true if this SignatureRequestResponseAttachment object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseAttachment signatureRequestResponseAttachment = (SignatureRequestResponseAttachment) o; - return Objects.equals(this.id, signatureRequestResponseAttachment.id) && - Objects.equals(this.signer, signatureRequestResponseAttachment.signer) && - Objects.equals(this.name, signatureRequestResponseAttachment.name) && - Objects.equals(this.required, signatureRequestResponseAttachment.required) && - Objects.equals(this.instructions, signatureRequestResponseAttachment.instructions) && - Objects.equals(this.uploadedAt, signatureRequestResponseAttachment.uploadedAt); - } - - @Override - public int hashCode() { - return Objects.hash(id, signer, name, required, instructions, uploadedAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseAttachment {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" uploadedAt: ").append(toIndentedString(uploadedAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ID = "id"; + private String id; - if (id.getClass().equals(java.io.File.class) || - id.getClass().equals(Integer.class) || - id.getClass().equals(String.class) || - id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for(int i = 0; i< getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } - else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } + public static final String JSON_PROPERTY_SIGNER = "signer"; + private String signer; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + private String instructions; + + public static final String JSON_PROPERTY_UPLOADED_AT = "uploaded_at"; + private Integer uploadedAt; + + public SignatureRequestResponseAttachment() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseAttachment init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseAttachment.class); } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - if (signer.getClass().equals(java.io.File.class) || - signer.getClass().equals(Integer.class) || - signer.getClass().equals(String.class) || - signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for(int i = 0; i< getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } - else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } + public static SignatureRequestResponseAttachment init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseAttachment.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public SignatureRequestResponseAttachment id(String id) { + this.id = id; + return this; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } + /** + * The unique ID for this attachment. + * + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; } - if (instructions != null) { - if (isFileTypeOrListOfFiles(instructions)) { - fileTypeFound = true; - } - if (instructions.getClass().equals(java.io.File.class) || - instructions.getClass().equals(Integer.class) || - instructions.getClass().equals(String.class) || - instructions.getClass().isEnum()) { - map.put("instructions", instructions); - } else if (isListOfFile(instructions)) { - for(int i = 0; i< getListSize(instructions); i++) { - map.put("instructions[" + i + "]", getFromList(instructions, i)); - } - } - else { - map.put("instructions", JSON.getDefault().getMapper().writeValueAsString(instructions)); - } + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; } - if (uploadedAt != null) { - if (isFileTypeOrListOfFiles(uploadedAt)) { - fileTypeFound = true; - } - if (uploadedAt.getClass().equals(java.io.File.class) || - uploadedAt.getClass().equals(Integer.class) || - uploadedAt.getClass().equals(String.class) || - uploadedAt.getClass().isEnum()) { - map.put("uploaded_at", uploadedAt); - } else if (isListOfFile(uploadedAt)) { - for(int i = 0; i< getListSize(uploadedAt); i++) { - map.put("uploaded_at[" + i + "]", getFromList(uploadedAt, i)); - } + 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 + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSigner() { + return signer; + } + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public SignatureRequestResponseAttachment required(Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this attachment is required. + * + * @return required + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequired(Boolean required) { + this.required = required; + } + + public SignatureRequestResponseAttachment instructions(String instructions) { + this.instructions = instructions; + return this; + } + + /** + * Instructions for Signer. + * + * @return instructions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstructions() { + return instructions; + } + + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(String instructions) { + this.instructions = instructions; + } + + public SignatureRequestResponseAttachment uploadedAt(Integer uploadedAt) { + this.uploadedAt = uploadedAt; + return this; + } + + /** + * Timestamp when attachment was uploaded by Signer. + * + * @return uploadedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPLOADED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUploadedAt() { + return uploadedAt; + } + + @JsonProperty(JSON_PROPERTY_UPLOADED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadedAt(Integer uploadedAt) { + this.uploadedAt = uploadedAt; + } + + /** Return true if this SignatureRequestResponseAttachment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("uploaded_at", JSON.getDefault().getMapper().writeValueAsString(uploadedAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseAttachment signatureRequestResponseAttachment = + (SignatureRequestResponseAttachment) o; + return Objects.equals(this.id, signatureRequestResponseAttachment.id) + && Objects.equals(this.signer, signatureRequestResponseAttachment.signer) + && Objects.equals(this.name, signatureRequestResponseAttachment.name) + && Objects.equals(this.required, signatureRequestResponseAttachment.required) + && Objects.equals( + this.instructions, signatureRequestResponseAttachment.instructions) + && Objects.equals(this.uploadedAt, signatureRequestResponseAttachment.uploadedAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(id, signer, name, required, instructions, uploadedAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseAttachment {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" uploadedAt: ").append(toIndentedString(uploadedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; + } + + if (id.getClass().equals(java.io.File.class) + || id.getClass().equals(Integer.class) + || id.getClass().equals(String.class) + || id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for (int i = 0; i < getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); + } + } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } + + if (signer.getClass().equals(java.io.File.class) + || signer.getClass().equals(Integer.class) + || signer.getClass().equals(String.class) + || signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for (int i = 0; i < getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (instructions != null) { + if (isFileTypeOrListOfFiles(instructions)) { + fileTypeFound = true; + } + + if (instructions.getClass().equals(java.io.File.class) + || instructions.getClass().equals(Integer.class) + || instructions.getClass().equals(String.class) + || instructions.getClass().isEnum()) { + map.put("instructions", instructions); + } else if (isListOfFile(instructions)) { + for (int i = 0; i < getListSize(instructions); i++) { + map.put("instructions[" + i + "]", getFromList(instructions, i)); + } + } else { + map.put( + "instructions", + JSON.getDefault().getMapper().writeValueAsString(instructions)); + } + } + if (uploadedAt != null) { + if (isFileTypeOrListOfFiles(uploadedAt)) { + fileTypeFound = true; + } + + if (uploadedAt.getClass().equals(java.io.File.class) + || uploadedAt.getClass().equals(Integer.class) + || uploadedAt.getClass().equals(String.class) + || uploadedAt.getClass().isEnum()) { + map.put("uploaded_at", uploadedAt); + } else if (isListOfFile(uploadedAt)) { + for (int i = 0; i < getListSize(uploadedAt); i++) { + map.put("uploaded_at[" + i + "]", getFromList(uploadedAt, i)); + } + } else { + map.put( + "uploaded_at", + JSON.getDefault().getMapper().writeValueAsString(uploadedAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java index fcde00f..eff1614 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldBase.java @@ -10,389 +10,379 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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` + * 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @JsonSubTypes.Type( + value = SignatureRequestResponseCustomFieldCheckbox.class, + name = "checkbox"), + @JsonSubTypes.Type(value = SignatureRequestResponseCustomFieldText.class, name = "text"), }) - public class SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; - - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; - - public static final String JSON_PROPERTY_EDITOR = "editor"; - private String editor; - - public SignatureRequestResponseCustomFieldBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseCustomFieldBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldBase.class); - } - - static public SignatureRequestResponseCustomFieldBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldBase.class - ); - } - - public SignatureRequestResponseCustomFieldBase type(String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseCustomFieldBase name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Custom Field. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SignatureRequestResponseCustomFieldBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this field is required. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public SignatureRequestResponseCustomFieldBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * @return apiId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getApiId() { - return apiId; - } - - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - - - public SignatureRequestResponseCustomFieldBase editor(String editor) { - this.editor = editor; - return this; - } - - /** - * The name of the Role that is able to edit this field. - * @return editor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEditor() { - return editor; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditor(String editor) { - this.editor = editor; - } - - - /** - * Return true if this SignatureRequestResponseCustomFieldBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; + + public static final String JSON_PROPERTY_EDITOR = "editor"; + private String editor; + + public SignatureRequestResponseCustomFieldBase() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseCustomFieldBase init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseCustomFieldBase.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SignatureRequestResponseCustomFieldBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldBase.class); } - SignatureRequestResponseCustomFieldBase signatureRequestResponseCustomFieldBase = (SignatureRequestResponseCustomFieldBase) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldBase.type) && - Objects.equals(this.name, signatureRequestResponseCustomFieldBase.name) && - Objects.equals(this.required, signatureRequestResponseCustomFieldBase.required) && - Objects.equals(this.apiId, signatureRequestResponseCustomFieldBase.apiId) && - Objects.equals(this.editor, signatureRequestResponseCustomFieldBase.editor); - } - - @Override - public int hashCode() { - return Objects.hash(type, name, required, apiId, editor); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SignatureRequestResponseCustomFieldBase type(String type) { + this.type = type; + return this; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently + * supported. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } + public SignatureRequestResponseCustomFieldBase name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Custom Field. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public SignatureRequestResponseCustomFieldBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this field is required. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public SignatureRequestResponseCustomFieldBase apiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * The unique ID for this field. + * + * @return apiId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiId() { + return apiId; + } + + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(String apiId) { + this.apiId = apiId; + } + + public SignatureRequestResponseCustomFieldBase editor(String editor) { + this.editor = editor; + return this; + } + + /** + * The name of the Role that is able to edit this field. + * + * @return editor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEditor() { + return editor; + } + + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditor(String editor) { + this.editor = editor; + } + + /** Return true if this SignatureRequestResponseCustomFieldBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseCustomFieldBase signatureRequestResponseCustomFieldBase = + (SignatureRequestResponseCustomFieldBase) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldBase.type) + && Objects.equals(this.name, signatureRequestResponseCustomFieldBase.name) + && Objects.equals(this.required, signatureRequestResponseCustomFieldBase.required) + && Objects.equals(this.apiId, signatureRequestResponseCustomFieldBase.apiId) + && Objects.equals(this.editor, signatureRequestResponseCustomFieldBase.editor); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, required, apiId, editor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (editor != null) { - if (isFileTypeOrListOfFiles(editor)) { - fileTypeFound = true; - } - if (editor.getClass().equals(java.io.File.class) || - editor.getClass().equals(Integer.class) || - editor.getClass().equals(String.class) || - editor.getClass().isEnum()) { - map.put("editor", editor); - } else if (isListOfFile(editor)) { - for(int i = 0; i< getListSize(editor); i++) { - map.put("editor[" + i + "]", getFromList(editor, i)); + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } + } + if (editor != null) { + if (isFileTypeOrListOfFiles(editor)) { + fileTypeFound = true; + } + + if (editor.getClass().equals(java.io.File.class) + || editor.getClass().equals(Integer.class) + || editor.getClass().equals(String.class) + || editor.getClass().isEnum()) { + map.put("editor", editor); + } else if (isListOfFile(editor)) { + for (int i = 0; i < getListSize(editor); i++) { + map.put("editor[" + i + "]", getFromList(editor, i)); + } + } else { + map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + 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); } - 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("SignatureRequestResponseCustomFieldBase", SignatureRequestResponseCustomFieldBase.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldBase.class, "type", mappings); - } } - diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java index e4eb1e3..f2f207e 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldCheckbox.java @@ -10,237 +10,233 @@ * 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.SignatureRequestResponseCustomFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SignatureRequestResponseCustomFieldBase`. - */ +/** This class extends `SignatureRequestResponseCustomFieldBase`. */ @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldCheckbox.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - -public class SignatureRequestResponseCustomFieldCheckbox extends SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private Boolean value; - - public SignatureRequestResponseCustomFieldCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseCustomFieldCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldCheckbox.class); - } - - static public SignatureRequestResponseCustomFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldCheckbox.class - ); - } - - public SignatureRequestResponseCustomFieldCheckbox type(String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseCustomFieldCheckbox value(Boolean value) { - this.value = value; - return this; - } - - /** - * A true/false for checkbox fields - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(Boolean value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseCustomFieldCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseCustomFieldCheckbox signatureRequestResponseCustomFieldCheckbox = (SignatureRequestResponseCustomFieldCheckbox) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldCheckbox.type) && - Objects.equals(this.value, signatureRequestResponseCustomFieldCheckbox.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Boolean value; + + public SignatureRequestResponseCustomFieldCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseCustomFieldCheckbox init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseCustomFieldCheckbox.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseCustomFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldCheckbox.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseCustomFieldCheckbox type(String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently + * supported. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseCustomFieldCheckbox value(Boolean value) { + this.value = value; + return this; + } + + /** + * A true/false for checkbox fields + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Boolean value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseCustomFieldCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseCustomFieldCheckbox signatureRequestResponseCustomFieldCheckbox = + (SignatureRequestResponseCustomFieldCheckbox) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldCheckbox.type) + && Objects.equals(this.value, signatureRequestResponseCustomFieldCheckbox.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseCustomFieldCheckbox", SignatureRequestResponseCustomFieldCheckbox.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldCheckbox.class, "type", mappings); - } -} + 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java index f4284d6..31c911d 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldText.java @@ -10,237 +10,231 @@ * 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.SignatureRequestResponseCustomFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SignatureRequestResponseCustomFieldBase`. - */ +/** This class extends `SignatureRequestResponseCustomFieldBase`. */ @JsonPropertyOrder({ - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, - SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_TYPE, + SignatureRequestResponseCustomFieldText.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - -public class SignatureRequestResponseCustomFieldText extends SignatureRequestResponseCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseCustomFieldText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseCustomFieldText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseCustomFieldText.class); - } - - static public SignatureRequestResponseCustomFieldText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseCustomFieldText.class - ); - } - - public SignatureRequestResponseCustomFieldText type(String type) { - this.type = type; - return this; - } - - /** - * The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseCustomFieldText value(String value) { - this.value = value; - return this; - } - - /** - * A text string for text fields - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseCustomFieldText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseCustomFieldText signatureRequestResponseCustomFieldText = (SignatureRequestResponseCustomFieldText) o; - return Objects.equals(this.type, signatureRequestResponseCustomFieldText.type) && - Objects.equals(this.value, signatureRequestResponseCustomFieldText.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseCustomFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseCustomFieldText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseCustomFieldText init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseCustomFieldText.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseCustomFieldText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseCustomFieldText.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseCustomFieldText type(String type) { + this.type = type; + return this; + } + + /** + * The type of this Custom Field. Only 'text' and 'checkbox' are currently + * supported. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseCustomFieldText value(String value) { + this.value = value; + return this; + } + + /** + * A text string for text fields + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseCustomFieldText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseCustomFieldText signatureRequestResponseCustomFieldText = + (SignatureRequestResponseCustomFieldText) o; + return Objects.equals(this.type, signatureRequestResponseCustomFieldText.type) + && Objects.equals(this.value, signatureRequestResponseCustomFieldText.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseCustomFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseCustomFieldText", SignatureRequestResponseCustomFieldText.class); - JSON.registerDiscriminator(SignatureRequestResponseCustomFieldText.class, "type", mappings); - } -} + 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java index c4ae5b3..356385d 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseCustomFieldTypeEnum.java @@ -10,54 +10,41 @@ * 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 SignatureRequestResponseCustomFieldTypeEnum - */ +/** Gets or Sets SignatureRequestResponseCustomFieldTypeEnum */ public enum SignatureRequestResponseCustomFieldTypeEnum { - - TEXT("text"), - - CHECKBOX("checkbox"); - - private String value; - - SignatureRequestResponseCustomFieldTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SignatureRequestResponseCustomFieldTypeEnum fromValue(String value) { - for (SignatureRequestResponseCustomFieldTypeEnum b : SignatureRequestResponseCustomFieldTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } + TEXT("text"), + + CHECKBOX("checkbox"); + + private String value; + + SignatureRequestResponseCustomFieldTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SignatureRequestResponseCustomFieldTypeEnum fromValue(String value) { + for (SignatureRequestResponseCustomFieldTypeEnum b : + SignatureRequestResponseCustomFieldTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java index c1a23eb..1b5606c 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataBase.java @@ -10,403 +10,394 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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. + * 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @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 SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; - - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - private String signatureId; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; - - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; - - public SignatureRequestResponseDataBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataBase.class); - } - - static public SignatureRequestResponseDataBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataBase.class - ); - } - - public SignatureRequestResponseDataBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * @return apiId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getApiId() { - return apiId; - } - - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - - - public SignatureRequestResponseDataBase signatureId(String signatureId) { - this.signatureId = signatureId; - return this; - } - - /** - * The ID of the signature to which this response is linked. - * @return signatureId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignatureId() { - return signatureId; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureId(String signatureId) { - this.signatureId = signatureId; - } - - - public SignatureRequestResponseDataBase name(String name) { - this.name = name; - return this; - } - - /** - * The name of the form field. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public SignatureRequestResponseDataBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * A boolean value denoting if this field is required. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public SignatureRequestResponseDataBase type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this SignatureRequestResponseDataBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; + + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + private String signatureId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public SignatureRequestResponseDataBase() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataBase.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SignatureRequestResponseDataBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataBase.class); } - SignatureRequestResponseDataBase signatureRequestResponseDataBase = (SignatureRequestResponseDataBase) o; - return Objects.equals(this.apiId, signatureRequestResponseDataBase.apiId) && - Objects.equals(this.signatureId, signatureRequestResponseDataBase.signatureId) && - Objects.equals(this.name, signatureRequestResponseDataBase.name) && - Objects.equals(this.required, signatureRequestResponseDataBase.required) && - Objects.equals(this.type, signatureRequestResponseDataBase.type); - } - - @Override - public int hashCode() { - return Objects.hash(apiId, signatureId, name, required, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataBase {\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + public SignatureRequestResponseDataBase apiId(String apiId) { + this.apiId = apiId; + return this; } - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } - if (signatureId.getClass().equals(java.io.File.class) || - signatureId.getClass().equals(Integer.class) || - signatureId.getClass().equals(String.class) || - signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for(int i = 0; i< getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } - else { - map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } + /** + * The unique ID for this field. + * + * @return apiId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiId() { + return apiId; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(String apiId) { + this.apiId = apiId; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } + public SignatureRequestResponseDataBase signatureId(String signatureId) { + this.signatureId = signatureId; + return this; + } + + /** + * The ID of the signature to which this response is linked. + * + * @return signatureId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignatureId() { + return signatureId; + } + + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureId(String signatureId) { + this.signatureId = signatureId; + } + + public SignatureRequestResponseDataBase name(String name) { + this.name = name; + return this; + } + + /** + * The name of the form field. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public SignatureRequestResponseDataBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * A boolean value denoting if this field is required. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public SignatureRequestResponseDataBase type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this SignatureRequestResponseDataBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataBase signatureRequestResponseDataBase = + (SignatureRequestResponseDataBase) o; + return Objects.equals(this.apiId, signatureRequestResponseDataBase.apiId) + && Objects.equals(this.signatureId, signatureRequestResponseDataBase.signatureId) + && Objects.equals(this.name, signatureRequestResponseDataBase.name) + && Objects.equals(this.required, signatureRequestResponseDataBase.required) + && Objects.equals(this.type, signatureRequestResponseDataBase.type); + } + + @Override + public int hashCode() { + return Objects.hash(apiId, signatureId, name, required, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataBase {\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } } + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } + + if (signatureId.getClass().equals(java.io.File.class) + || signatureId.getClass().equals(Integer.class) + || signatureId.getClass().equals(String.class) + || signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for (int i = 0; i < getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } + } else { + map.put( + "signature_id", + JSON.getDefault().getMapper().writeValueAsString(signatureId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + 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); } - 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("SignatureRequestResponseDataBase", SignatureRequestResponseDataBase.class); - JSON.registerDiscriminator(SignatureRequestResponseDataBase.class, "type", mappings); - } } - diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java index b2e6295..35e89e0 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataTypeEnum.java @@ -10,68 +10,55 @@ * 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 SignatureRequestResponseDataTypeEnum - */ +/** Gets or Sets SignatureRequestResponseDataTypeEnum */ public enum SignatureRequestResponseDataTypeEnum { - - TEXT("text"), - - CHECKBOX("checkbox"), - - DATE_SIGNED("date_signed"), - - DROPDOWN("dropdown"), - - INITIALS("initials"), - - RADIO("radio"), - - SIGNATURE("signature"), - - TEXT_MERGE("text-merge"), - - CHECKBOX_MERGE("checkbox-merge"); - - private String value; - - SignatureRequestResponseDataTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SignatureRequestResponseDataTypeEnum fromValue(String value) { - for (SignatureRequestResponseDataTypeEnum b : SignatureRequestResponseDataTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } + TEXT("text"), + + CHECKBOX("checkbox"), + + DATE_SIGNED("date_signed"), + + DROPDOWN("dropdown"), + + INITIALS("initials"), + + RADIO("radio"), + + SIGNATURE("signature"), + + TEXT_MERGE("text-merge"), + + CHECKBOX_MERGE("checkbox-merge"); + + private String value; + + SignatureRequestResponseDataTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} + @JsonCreator + public static SignatureRequestResponseDataTypeEnum fromValue(String value) { + for (SignatureRequestResponseDataTypeEnum b : + SignatureRequestResponseDataTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java index ef3a930..656b827 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckbox.java @@ -10,237 +10,229 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueCheckbox - */ +/** SignatureRequestResponseDataValueCheckbox */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckbox.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private Boolean value; - - public SignatureRequestResponseDataValueCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueCheckbox.class); - } - - static public SignatureRequestResponseDataValueCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueCheckbox.class - ); - } - - public SignatureRequestResponseDataValueCheckbox type(String type) { - this.type = type; - return this; - } - - /** - * A yes/no checkbox - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueCheckbox value(Boolean value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(Boolean value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueCheckbox signatureRequestResponseDataValueCheckbox = (SignatureRequestResponseDataValueCheckbox) o; - return Objects.equals(this.type, signatureRequestResponseDataValueCheckbox.type) && - Objects.equals(this.value, signatureRequestResponseDataValueCheckbox.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Boolean value; + + public SignatureRequestResponseDataValueCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueCheckbox init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueCheckbox.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueCheckbox.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueCheckbox type(String type) { + this.type = type; + return this; + } + + /** + * A yes/no checkbox + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueCheckbox value(Boolean value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Boolean value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueCheckbox signatureRequestResponseDataValueCheckbox = + (SignatureRequestResponseDataValueCheckbox) o; + return Objects.equals(this.type, signatureRequestResponseDataValueCheckbox.type) + && Objects.equals(this.value, signatureRequestResponseDataValueCheckbox.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueCheckbox", SignatureRequestResponseDataValueCheckbox.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckbox.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java index 7fafbf2..9127f68 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueCheckboxMerge.java @@ -10,237 +10,233 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueCheckboxMerge - */ +/** SignatureRequestResponseDataValueCheckboxMerge */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueCheckboxMerge.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - -public class SignatureRequestResponseDataValueCheckboxMerge extends SignatureRequestResponseDataBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox-merge"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueCheckboxMerge() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueCheckboxMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueCheckboxMerge.class); - } - - static public SignatureRequestResponseDataValueCheckboxMerge init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueCheckboxMerge.class - ); - } - - public SignatureRequestResponseDataValueCheckboxMerge type(String type) { - this.type = type; - return this; - } - - /** - * A checkbox field that has default value set by the api - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueCheckboxMerge value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueCheckboxMerge object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueCheckboxMerge signatureRequestResponseDataValueCheckboxMerge = (SignatureRequestResponseDataValueCheckboxMerge) o; - return Objects.equals(this.type, signatureRequestResponseDataValueCheckboxMerge.type) && - Objects.equals(this.value, signatureRequestResponseDataValueCheckboxMerge.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueCheckboxMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox-merge"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueCheckboxMerge() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueCheckboxMerge init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueCheckboxMerge.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueCheckboxMerge init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueCheckboxMerge.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueCheckboxMerge type(String type) { + this.type = type; + return this; + } + + /** + * A checkbox field that has default value set by the api + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueCheckboxMerge value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueCheckboxMerge object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueCheckboxMerge + signatureRequestResponseDataValueCheckboxMerge = + (SignatureRequestResponseDataValueCheckboxMerge) o; + return Objects.equals(this.type, signatureRequestResponseDataValueCheckboxMerge.type) + && Objects.equals(this.value, signatureRequestResponseDataValueCheckboxMerge.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueCheckboxMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueCheckboxMerge", SignatureRequestResponseDataValueCheckboxMerge.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueCheckboxMerge.class, "type", mappings); - } -} + 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java index bbd474a..b93a262 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDateSigned.java @@ -10,237 +10,230 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueDateSigned - */ +/** SignatureRequestResponseDataValueDateSigned */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDateSigned.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "date_signed"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueDateSigned() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueDateSigned init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueDateSigned.class); - } - - static public SignatureRequestResponseDataValueDateSigned init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueDateSigned.class - ); - } - - public SignatureRequestResponseDataValueDateSigned type(String type) { - this.type = type; - return this; - } - - /** - * A date - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueDateSigned value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueDateSigned object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueDateSigned signatureRequestResponseDataValueDateSigned = (SignatureRequestResponseDataValueDateSigned) o; - return Objects.equals(this.type, signatureRequestResponseDataValueDateSigned.type) && - Objects.equals(this.value, signatureRequestResponseDataValueDateSigned.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "date_signed"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueDateSigned() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueDateSigned init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueDateSigned.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueDateSigned init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueDateSigned.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueDateSigned type(String type) { + this.type = type; + return this; + } + + /** + * A date + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueDateSigned value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueDateSigned object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueDateSigned signatureRequestResponseDataValueDateSigned = + (SignatureRequestResponseDataValueDateSigned) o; + return Objects.equals(this.type, signatureRequestResponseDataValueDateSigned.type) + && Objects.equals(this.value, signatureRequestResponseDataValueDateSigned.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueDateSigned", SignatureRequestResponseDataValueDateSigned.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueDateSigned.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java index f8cf79d..b52dee3 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueDropdown.java @@ -10,237 +10,229 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueDropdown - */ +/** SignatureRequestResponseDataValueDropdown */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueDropdown.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "dropdown"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueDropdown() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueDropdown init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueDropdown.class); - } - - static public SignatureRequestResponseDataValueDropdown init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueDropdown.class - ); - } - - public SignatureRequestResponseDataValueDropdown type(String type) { - this.type = type; - return this; - } - - /** - * An input field for dropdowns - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueDropdown value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueDropdown object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueDropdown signatureRequestResponseDataValueDropdown = (SignatureRequestResponseDataValueDropdown) o; - return Objects.equals(this.type, signatureRequestResponseDataValueDropdown.type) && - Objects.equals(this.value, signatureRequestResponseDataValueDropdown.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "dropdown"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueDropdown() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueDropdown init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueDropdown.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueDropdown init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueDropdown.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueDropdown type(String type) { + this.type = type; + return this; + } + + /** + * An input field for dropdowns + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueDropdown value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueDropdown object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueDropdown signatureRequestResponseDataValueDropdown = + (SignatureRequestResponseDataValueDropdown) o; + return Objects.equals(this.type, signatureRequestResponseDataValueDropdown.type) + && Objects.equals(this.value, signatureRequestResponseDataValueDropdown.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueDropdown", SignatureRequestResponseDataValueDropdown.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueDropdown.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java index 9fca409..976036e 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueInitials.java @@ -10,237 +10,229 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueInitials - */ +/** SignatureRequestResponseDataValueInitials */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueInitials.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "initials"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueInitials() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueInitials init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueInitials.class); - } - - static public SignatureRequestResponseDataValueInitials init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueInitials.class - ); - } - - public SignatureRequestResponseDataValueInitials type(String type) { - this.type = type; - return this; - } - - /** - * An input field for initials - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueInitials value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueInitials object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueInitials signatureRequestResponseDataValueInitials = (SignatureRequestResponseDataValueInitials) o; - return Objects.equals(this.type, signatureRequestResponseDataValueInitials.type) && - Objects.equals(this.value, signatureRequestResponseDataValueInitials.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "initials"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueInitials() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueInitials init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueInitials.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueInitials init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueInitials.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueInitials type(String type) { + this.type = type; + return this; + } + + /** + * An input field for initials + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueInitials value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueInitials object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueInitials signatureRequestResponseDataValueInitials = + (SignatureRequestResponseDataValueInitials) o; + return Objects.equals(this.type, signatureRequestResponseDataValueInitials.type) + && Objects.equals(this.value, signatureRequestResponseDataValueInitials.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueInitials", SignatureRequestResponseDataValueInitials.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueInitials.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java index e5bce3d..a5d63ae 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueRadio.java @@ -10,237 +10,227 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueRadio - */ +/** SignatureRequestResponseDataValueRadio */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueRadio.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "radio"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private Boolean value; - - public SignatureRequestResponseDataValueRadio() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueRadio.class); - } - - static public SignatureRequestResponseDataValueRadio init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueRadio.class - ); - } - - public SignatureRequestResponseDataValueRadio type(String type) { - this.type = type; - return this; - } - - /** - * An input field for radios - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueRadio value(Boolean value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(Boolean value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueRadio object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueRadio signatureRequestResponseDataValueRadio = (SignatureRequestResponseDataValueRadio) o; - return Objects.equals(this.type, signatureRequestResponseDataValueRadio.type) && - Objects.equals(this.value, signatureRequestResponseDataValueRadio.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "radio"; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static final String JSON_PROPERTY_VALUE = "value"; + private Boolean value; + + public SignatureRequestResponseDataValueRadio() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueRadio.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public static SignatureRequestResponseDataValueRadio init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueRadio.class); + } + + public SignatureRequestResponseDataValueRadio type(String type) { + this.type = type; + return this; + } + + /** + * An input field for radios + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueRadio value(Boolean value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Boolean value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueRadio object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueRadio signatureRequestResponseDataValueRadio = + (SignatureRequestResponseDataValueRadio) o; + return Objects.equals(this.type, signatureRequestResponseDataValueRadio.type) + && Objects.equals(this.value, signatureRequestResponseDataValueRadio.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueRadio", SignatureRequestResponseDataValueRadio.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueRadio.class, "type", mappings); - } -} + 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java index 228d800..8fc3e43 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueSignature.java @@ -10,237 +10,230 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueSignature - */ +/** SignatureRequestResponseDataValueSignature */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueSignature.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "signature"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueSignature() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueSignature init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueSignature.class); - } - - static public SignatureRequestResponseDataValueSignature init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueSignature.class - ); - } - - public SignatureRequestResponseDataValueSignature type(String type) { - this.type = type; - return this; - } - - /** - * A signature input field - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueSignature value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueSignature object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueSignature signatureRequestResponseDataValueSignature = (SignatureRequestResponseDataValueSignature) o; - return Objects.equals(this.type, signatureRequestResponseDataValueSignature.type) && - Objects.equals(this.value, signatureRequestResponseDataValueSignature.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "signature"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueSignature() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueSignature init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueSignature.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueSignature init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueSignature.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueSignature type(String type) { + this.type = type; + return this; + } + + /** + * A signature input field + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueSignature value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueSignature object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueSignature signatureRequestResponseDataValueSignature = + (SignatureRequestResponseDataValueSignature) o; + return Objects.equals(this.type, signatureRequestResponseDataValueSignature.type) + && Objects.equals(this.value, signatureRequestResponseDataValueSignature.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueSignature", SignatureRequestResponseDataValueSignature.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueSignature.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java index fa15216..d9c7af0 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueText.java @@ -10,237 +10,227 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueText - */ +/** SignatureRequestResponseDataValueText */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueText.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueText.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueText.class); - } - - static public SignatureRequestResponseDataValueText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueText.class - ); - } - - public SignatureRequestResponseDataValueText type(String type) { - this.type = type; - return this; - } - - /** - * A text input field - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueText value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueText signatureRequestResponseDataValueText = (SignatureRequestResponseDataValueText) o; - return Objects.equals(this.type, signatureRequestResponseDataValueText.type) && - Objects.equals(this.value, signatureRequestResponseDataValueText.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueText.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public static SignatureRequestResponseDataValueText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueText.class); + } + + public SignatureRequestResponseDataValueText type(String type) { + this.type = type; + return this; + } + + /** + * A text input field + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueText value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueText signatureRequestResponseDataValueText = + (SignatureRequestResponseDataValueText) o; + return Objects.equals(this.type, signatureRequestResponseDataValueText.type) + && Objects.equals(this.value, signatureRequestResponseDataValueText.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueText", SignatureRequestResponseDataValueText.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueText.class, "type", mappings); - } -} + 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java index 9ba6578..1b796db 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseDataValueTextMerge.java @@ -10,237 +10,230 @@ * 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.SignatureRequestResponseDataBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestResponseDataValueTextMerge - */ +/** SignatureRequestResponseDataValueTextMerge */ @JsonPropertyOrder({ - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, - SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_TYPE, + SignatureRequestResponseDataValueTextMerge.JSON_PROPERTY_VALUE }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text-merge"; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SignatureRequestResponseDataValueTextMerge() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseDataValueTextMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseDataValueTextMerge.class); - } - - static public SignatureRequestResponseDataValueTextMerge init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseDataValueTextMerge.class - ); - } - - public SignatureRequestResponseDataValueTextMerge type(String type) { - this.type = type; - return this; - } - - /** - * A text field that has default text set by the api - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public SignatureRequestResponseDataValueTextMerge value(String value) { - this.value = value; - return this; - } - - /** - * The value of the form field. - * @return value - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SignatureRequestResponseDataValueTextMerge object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseDataValueTextMerge signatureRequestResponseDataValueTextMerge = (SignatureRequestResponseDataValueTextMerge) o; - return Objects.equals(this.type, signatureRequestResponseDataValueTextMerge.type) && - Objects.equals(this.value, signatureRequestResponseDataValueTextMerge.value) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, value, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseDataValueTextMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text-merge"; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SignatureRequestResponseDataValueTextMerge() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseDataValueTextMerge init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestResponseDataValueTextMerge.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static SignatureRequestResponseDataValueTextMerge init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseDataValueTextMerge.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SignatureRequestResponseDataValueTextMerge type(String type) { + this.type = type; + return this; + } + + /** + * A text field that has default text set by the api + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public SignatureRequestResponseDataValueTextMerge value(String value) { + this.value = value; + return this; + } + + /** + * The value of the form field. + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SignatureRequestResponseDataValueTextMerge object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseDataValueTextMerge signatureRequestResponseDataValueTextMerge = + (SignatureRequestResponseDataValueTextMerge) o; + return Objects.equals(this.type, signatureRequestResponseDataValueTextMerge.type) + && Objects.equals(this.value, signatureRequestResponseDataValueTextMerge.value) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, value, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseDataValueTextMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SignatureRequestResponseDataValueTextMerge", SignatureRequestResponseDataValueTextMerge.class); - JSON.registerDiscriminator(SignatureRequestResponseDataValueTextMerge.class, "type", mappings); - } -} + /** + * 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 "); + } + 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/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java index ea70c95..6dbe111 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestResponseSignatures.java @@ -10,1069 +10,1060 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * An array of signature objects, 1 for each signer. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestResponseSignatures { - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - private String signatureId; + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + private String signatureId; - public static final String JSON_PROPERTY_SIGNER_GROUP_GUID = "signer_group_guid"; - private String signerGroupGuid; + public static final String JSON_PROPERTY_SIGNER_GROUP_GUID = "signer_group_guid"; + private String signerGroupGuid; - public static final String JSON_PROPERTY_SIGNER_EMAIL_ADDRESS = "signer_email_address"; - private String signerEmailAddress; + public static final String JSON_PROPERTY_SIGNER_EMAIL_ADDRESS = "signer_email_address"; + private String signerEmailAddress; - public static final String JSON_PROPERTY_SIGNER_NAME = "signer_name"; - private String signerName; + public static final String JSON_PROPERTY_SIGNER_NAME = "signer_name"; + private String signerName; - public static final String JSON_PROPERTY_SIGNER_ROLE = "signer_role"; - private String signerRole; + public static final String JSON_PROPERTY_SIGNER_ROLE = "signer_role"; + private String signerRole; - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; - public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - private String statusCode; + public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; + private String statusCode; - public static final String JSON_PROPERTY_DECLINE_REASON = "decline_reason"; - private String declineReason; + public static final String JSON_PROPERTY_DECLINE_REASON = "decline_reason"; + private String declineReason; - public static final String JSON_PROPERTY_SIGNED_AT = "signed_at"; - private Integer signedAt; + public static final String JSON_PROPERTY_SIGNED_AT = "signed_at"; + private Integer signedAt; - public static final String JSON_PROPERTY_LAST_VIEWED_AT = "last_viewed_at"; - private Integer lastViewedAt; + public static final String JSON_PROPERTY_LAST_VIEWED_AT = "last_viewed_at"; + private Integer lastViewedAt; - public static final String JSON_PROPERTY_LAST_REMINDED_AT = "last_reminded_at"; - private Integer lastRemindedAt; + public static final String JSON_PROPERTY_LAST_REMINDED_AT = "last_reminded_at"; + private Integer lastRemindedAt; - public static final String JSON_PROPERTY_HAS_PIN = "has_pin"; - private Boolean hasPin; + public static final String JSON_PROPERTY_HAS_PIN = "has_pin"; + private Boolean hasPin; - public static final String JSON_PROPERTY_HAS_SMS_AUTH = "has_sms_auth"; - private Boolean hasSmsAuth; + public static final String JSON_PROPERTY_HAS_SMS_AUTH = "has_sms_auth"; + private Boolean hasSmsAuth; - public static final String JSON_PROPERTY_HAS_SMS_DELIVERY = "has_sms_delivery"; - private Boolean hasSmsDelivery; + public static final String JSON_PROPERTY_HAS_SMS_DELIVERY = "has_sms_delivery"; + private Boolean hasSmsDelivery; - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - private String smsPhoneNumber; + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + private String smsPhoneNumber; - public static final String JSON_PROPERTY_REASSIGNED_BY = "reassigned_by"; - private String reassignedBy; + public static final String JSON_PROPERTY_REASSIGNED_BY = "reassigned_by"; + private String reassignedBy; - public static final String JSON_PROPERTY_REASSIGNMENT_REASON = "reassignment_reason"; - private String reassignmentReason; + public static final String JSON_PROPERTY_REASSIGNMENT_REASON = "reassignment_reason"; + private String reassignmentReason; - public static final String JSON_PROPERTY_REASSIGNED_FROM = "reassigned_from"; - private String reassignedFrom; + public static final String JSON_PROPERTY_REASSIGNED_FROM = "reassigned_from"; + private String reassignedFrom; - public static final String JSON_PROPERTY_ERROR = "error"; - private String error; + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; - public SignatureRequestResponseSignatures() { - } + public SignatureRequestResponseSignatures() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestResponseSignatures init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestResponseSignatures.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestResponseSignatures init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestResponseSignatures.class); + } - static public SignatureRequestResponseSignatures init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestResponseSignatures.class - ); - } + public static SignatureRequestResponseSignatures init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestResponseSignatures.class); + } - public SignatureRequestResponseSignatures signatureId(String signatureId) { - this.signatureId = signatureId; - return this; - } + public SignatureRequestResponseSignatures signatureId(String signatureId) { + this.signatureId = signatureId; + return this; + } - /** - * Signature identifier. - * @return signatureId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Signature identifier. + * + * @return signatureId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignatureId() { + return signatureId; + } - public String getSignatureId() { - return signatureId; - } + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureId(String signatureId) { + this.signatureId = signatureId; + } + public SignatureRequestResponseSignatures signerGroupGuid(String signerGroupGuid) { + this.signerGroupGuid = signerGroupGuid; + return this; + } - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureId(String signatureId) { - this.signatureId = signatureId; - } + /** + * Signer Group GUID + * + * @return signerGroupGuid + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignerGroupGuid() { + return signerGroupGuid; + } + @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerGroupGuid(String signerGroupGuid) { + this.signerGroupGuid = signerGroupGuid; + } - public SignatureRequestResponseSignatures signerGroupGuid(String signerGroupGuid) { - this.signerGroupGuid = signerGroupGuid; - return this; - } + public SignatureRequestResponseSignatures signerEmailAddress(String signerEmailAddress) { + this.signerEmailAddress = signerEmailAddress; + return this; + } - /** - * Signer Group GUID - * @return signerGroupGuid - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The email address of the signer. + * + * @return signerEmailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignerEmailAddress() { + return signerEmailAddress; + } - public String getSignerGroupGuid() { - return signerGroupGuid; - } + @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerEmailAddress(String signerEmailAddress) { + this.signerEmailAddress = signerEmailAddress; + } + public SignatureRequestResponseSignatures signerName(String signerName) { + this.signerName = signerName; + return this; + } - @JsonProperty(JSON_PROPERTY_SIGNER_GROUP_GUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerGroupGuid(String signerGroupGuid) { - this.signerGroupGuid = signerGroupGuid; - } + /** + * The name of the signer. + * + * @return signerName + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignerName() { + return signerName; + } + @JsonProperty(JSON_PROPERTY_SIGNER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerName(String signerName) { + this.signerName = signerName; + } - public SignatureRequestResponseSignatures signerEmailAddress(String signerEmailAddress) { - this.signerEmailAddress = signerEmailAddress; - return this; - } + public SignatureRequestResponseSignatures signerRole(String signerRole) { + this.signerRole = signerRole; + return this; + } - /** - * The email address of the signer. - * @return signerEmailAddress - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignerEmailAddress() { - return signerEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerEmailAddress(String signerEmailAddress) { - this.signerEmailAddress = signerEmailAddress; - } - - - public SignatureRequestResponseSignatures signerName(String signerName) { - this.signerName = signerName; - return this; - } - - /** - * The name of the signer. - * @return signerName - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignerName() { - return signerName; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerName(String signerName) { - this.signerName = signerName; - } - - - public SignatureRequestResponseSignatures signerRole(String signerRole) { - this.signerRole = signerRole; - return this; - } - - /** - * The role of the signer. - * @return signerRole - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignerRole() { - return signerRole; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRole(String signerRole) { - this.signerRole = signerRole; - } - - - public SignatureRequestResponseSignatures order(Integer order) { - this.order = order; - return this; - } - - /** - * If signer order is assigned this is the 0-based index for this signer. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOrder() { - return order; - } - - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } - - - public SignatureRequestResponseSignatures statusCode(String statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * The current status of the signature. eg: awaiting_signature, signed, declined. - * @return statusCode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getStatusCode() { - return statusCode; - } - - - @JsonProperty(JSON_PROPERTY_STATUS_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatusCode(String statusCode) { - this.statusCode = statusCode; - } - - - public SignatureRequestResponseSignatures declineReason(String declineReason) { - this.declineReason = declineReason; - return this; - } - - /** - * The reason provided by the signer for declining the request. - * @return declineReason - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DECLINE_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getDeclineReason() { - return declineReason; - } - - - @JsonProperty(JSON_PROPERTY_DECLINE_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclineReason(String declineReason) { - this.declineReason = declineReason; - } - - - public SignatureRequestResponseSignatures signedAt(Integer signedAt) { - this.signedAt = signedAt; - return this; - } - - /** - * Time that the document was signed or null. - * @return signedAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getSignedAt() { - return signedAt; - } - - - @JsonProperty(JSON_PROPERTY_SIGNED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignedAt(Integer signedAt) { - this.signedAt = signedAt; - } - - - public SignatureRequestResponseSignatures lastViewedAt(Integer lastViewedAt) { - this.lastViewedAt = lastViewedAt; - return this; - } - - /** - * The time that the document was last viewed by this signer or null. - * @return lastViewedAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getLastViewedAt() { - return lastViewedAt; - } - - - @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastViewedAt(Integer lastViewedAt) { - this.lastViewedAt = lastViewedAt; - } - - - public SignatureRequestResponseSignatures lastRemindedAt(Integer lastRemindedAt) { - this.lastRemindedAt = lastRemindedAt; - return this; - } - - /** - * The time the last reminder email was sent to the signer or null. - * @return lastRemindedAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getLastRemindedAt() { - return lastRemindedAt; - } - - - @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastRemindedAt(Integer lastRemindedAt) { - this.lastRemindedAt = lastRemindedAt; - } - - - public SignatureRequestResponseSignatures hasPin(Boolean hasPin) { - this.hasPin = hasPin; - return this; - } - - /** - * Boolean to indicate whether this signature requires a PIN to access. - * @return hasPin - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHasPin() { - return hasPin; - } - - - @JsonProperty(JSON_PROPERTY_HAS_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasPin(Boolean hasPin) { - this.hasPin = hasPin; - } - - - public SignatureRequestResponseSignatures hasSmsAuth(Boolean hasSmsAuth) { - this.hasSmsAuth = hasSmsAuth; - return this; - } - - /** - * Boolean to indicate whether this signature has SMS authentication enabled. - * @return hasSmsAuth - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHasSmsAuth() { - return hasSmsAuth; - } - - - @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasSmsAuth(Boolean hasSmsAuth) { - this.hasSmsAuth = hasSmsAuth; - } - - - public SignatureRequestResponseSignatures hasSmsDelivery(Boolean hasSmsDelivery) { - this.hasSmsDelivery = hasSmsDelivery; - return this; - } - - /** - * Boolean to indicate whether this signature has SMS delivery enabled. - * @return hasSmsDelivery - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHasSmsDelivery() { - return hasSmsDelivery; - } - - - @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasSmsDelivery(Boolean hasSmsDelivery) { - this.hasSmsDelivery = hasSmsDelivery; - } - - - public SignatureRequestResponseSignatures smsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - return this; - } - - /** - * The SMS phone number used for authentication or signature request delivery. - * @return smsPhoneNumber - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSmsPhoneNumber() { - return smsPhoneNumber; - } - - - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - } - - - public SignatureRequestResponseSignatures reassignedBy(String reassignedBy) { - this.reassignedBy = reassignedBy; - return this; - } - - /** - * Email address of original signer who reassigned to this signer. - * @return reassignedBy - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getReassignedBy() { - return reassignedBy; - } - - - @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignedBy(String reassignedBy) { - this.reassignedBy = reassignedBy; - } - - - public SignatureRequestResponseSignatures reassignmentReason(String reassignmentReason) { - this.reassignmentReason = reassignmentReason; - return this; - } - - /** - * Reason provided by original signer who reassigned to this signer. - * @return reassignmentReason - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getReassignmentReason() { - return reassignmentReason; - } - - - @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignmentReason(String reassignmentReason) { - this.reassignmentReason = reassignmentReason; - } - - - public SignatureRequestResponseSignatures reassignedFrom(String reassignedFrom) { - this.reassignedFrom = reassignedFrom; - return this; - } - - /** - * Previous signature identifier. - * @return reassignedFrom - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getReassignedFrom() { - return reassignedFrom; - } - - - @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReassignedFrom(String reassignedFrom) { - this.reassignedFrom = reassignedFrom; - } - - - public SignatureRequestResponseSignatures error(String error) { - this.error = error; - return this; - } - - /** - * Error message pertaining to this signer, or null. - * @return error - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getError() { - return error; - } - - - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setError(String error) { - this.error = error; - } - - - /** - * Return true if this SignatureRequestResponseSignatures object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestResponseSignatures signatureRequestResponseSignatures = (SignatureRequestResponseSignatures) o; - return Objects.equals(this.signatureId, signatureRequestResponseSignatures.signatureId) && - Objects.equals(this.signerGroupGuid, signatureRequestResponseSignatures.signerGroupGuid) && - Objects.equals(this.signerEmailAddress, signatureRequestResponseSignatures.signerEmailAddress) && - Objects.equals(this.signerName, signatureRequestResponseSignatures.signerName) && - Objects.equals(this.signerRole, signatureRequestResponseSignatures.signerRole) && - Objects.equals(this.order, signatureRequestResponseSignatures.order) && - Objects.equals(this.statusCode, signatureRequestResponseSignatures.statusCode) && - Objects.equals(this.declineReason, signatureRequestResponseSignatures.declineReason) && - Objects.equals(this.signedAt, signatureRequestResponseSignatures.signedAt) && - Objects.equals(this.lastViewedAt, signatureRequestResponseSignatures.lastViewedAt) && - Objects.equals(this.lastRemindedAt, signatureRequestResponseSignatures.lastRemindedAt) && - Objects.equals(this.hasPin, signatureRequestResponseSignatures.hasPin) && - Objects.equals(this.hasSmsAuth, signatureRequestResponseSignatures.hasSmsAuth) && - Objects.equals(this.hasSmsDelivery, signatureRequestResponseSignatures.hasSmsDelivery) && - Objects.equals(this.smsPhoneNumber, signatureRequestResponseSignatures.smsPhoneNumber) && - Objects.equals(this.reassignedBy, signatureRequestResponseSignatures.reassignedBy) && - Objects.equals(this.reassignmentReason, signatureRequestResponseSignatures.reassignmentReason) && - Objects.equals(this.reassignedFrom, signatureRequestResponseSignatures.reassignedFrom) && - Objects.equals(this.error, signatureRequestResponseSignatures.error); - } - - @Override - public int hashCode() { - return Objects.hash(signatureId, signerGroupGuid, signerEmailAddress, signerName, signerRole, order, statusCode, declineReason, signedAt, lastViewedAt, lastRemindedAt, hasPin, hasSmsAuth, hasSmsDelivery, smsPhoneNumber, reassignedBy, reassignmentReason, reassignedFrom, error); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestResponseSignatures {\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" signerGroupGuid: ").append(toIndentedString(signerGroupGuid)).append("\n"); - sb.append(" signerEmailAddress: ").append(toIndentedString(signerEmailAddress)).append("\n"); - sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); - sb.append(" signerRole: ").append(toIndentedString(signerRole)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); - sb.append(" declineReason: ").append(toIndentedString(declineReason)).append("\n"); - sb.append(" signedAt: ").append(toIndentedString(signedAt)).append("\n"); - sb.append(" lastViewedAt: ").append(toIndentedString(lastViewedAt)).append("\n"); - sb.append(" lastRemindedAt: ").append(toIndentedString(lastRemindedAt)).append("\n"); - sb.append(" hasPin: ").append(toIndentedString(hasPin)).append("\n"); - sb.append(" hasSmsAuth: ").append(toIndentedString(hasSmsAuth)).append("\n"); - sb.append(" hasSmsDelivery: ").append(toIndentedString(hasSmsDelivery)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" reassignedBy: ").append(toIndentedString(reassignedBy)).append("\n"); - sb.append(" reassignmentReason: ").append(toIndentedString(reassignmentReason)).append("\n"); - sb.append(" reassignedFrom: ").append(toIndentedString(reassignedFrom)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } + /** + * The role of the signer. + * + * @return signerRole + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignerRole() { + return signerRole; + } - if (signatureId.getClass().equals(java.io.File.class) || - signatureId.getClass().equals(Integer.class) || - signatureId.getClass().equals(String.class) || - signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for(int i = 0; i< getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } - else { - map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } + @JsonProperty(JSON_PROPERTY_SIGNER_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRole(String signerRole) { + this.signerRole = signerRole; } - if (signerGroupGuid != null) { - if (isFileTypeOrListOfFiles(signerGroupGuid)) { - fileTypeFound = true; - } - if (signerGroupGuid.getClass().equals(java.io.File.class) || - signerGroupGuid.getClass().equals(Integer.class) || - signerGroupGuid.getClass().equals(String.class) || - signerGroupGuid.getClass().isEnum()) { - map.put("signer_group_guid", signerGroupGuid); - } else if (isListOfFile(signerGroupGuid)) { - for(int i = 0; i< getListSize(signerGroupGuid); i++) { - map.put("signer_group_guid[" + i + "]", getFromList(signerGroupGuid, i)); - } - } - else { - map.put("signer_group_guid", JSON.getDefault().getMapper().writeValueAsString(signerGroupGuid)); - } + public SignatureRequestResponseSignatures order(Integer order) { + this.order = order; + return this; } - if (signerEmailAddress != null) { - if (isFileTypeOrListOfFiles(signerEmailAddress)) { - fileTypeFound = true; - } - if (signerEmailAddress.getClass().equals(java.io.File.class) || - signerEmailAddress.getClass().equals(Integer.class) || - signerEmailAddress.getClass().equals(String.class) || - signerEmailAddress.getClass().isEnum()) { - map.put("signer_email_address", signerEmailAddress); - } else if (isListOfFile(signerEmailAddress)) { - for(int i = 0; i< getListSize(signerEmailAddress); i++) { - map.put("signer_email_address[" + i + "]", getFromList(signerEmailAddress, i)); - } - } - else { - map.put("signer_email_address", JSON.getDefault().getMapper().writeValueAsString(signerEmailAddress)); - } + /** + * If signer order is assigned this is the 0-based index for this signer. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; } - if (signerName != null) { - if (isFileTypeOrListOfFiles(signerName)) { - fileTypeFound = true; - } - if (signerName.getClass().equals(java.io.File.class) || - signerName.getClass().equals(Integer.class) || - signerName.getClass().equals(String.class) || - signerName.getClass().isEnum()) { - map.put("signer_name", signerName); - } else if (isListOfFile(signerName)) { - for(int i = 0; i< getListSize(signerName); i++) { - map.put("signer_name[" + i + "]", getFromList(signerName, i)); - } - } - else { - map.put("signer_name", JSON.getDefault().getMapper().writeValueAsString(signerName)); - } + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; } - if (signerRole != null) { - if (isFileTypeOrListOfFiles(signerRole)) { - fileTypeFound = true; - } - if (signerRole.getClass().equals(java.io.File.class) || - signerRole.getClass().equals(Integer.class) || - signerRole.getClass().equals(String.class) || - signerRole.getClass().isEnum()) { - map.put("signer_role", signerRole); - } else if (isListOfFile(signerRole)) { - for(int i = 0; i< getListSize(signerRole); i++) { - map.put("signer_role[" + i + "]", getFromList(signerRole, i)); - } - } - else { - map.put("signer_role", JSON.getDefault().getMapper().writeValueAsString(signerRole)); - } + public SignatureRequestResponseSignatures statusCode(String statusCode) { + this.statusCode = statusCode; + return this; } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } + /** + * The current status of the signature. eg: awaiting_signature, signed, declined. + * + * @return statusCode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusCode() { + return statusCode; } - if (statusCode != null) { - if (isFileTypeOrListOfFiles(statusCode)) { - fileTypeFound = true; - } - if (statusCode.getClass().equals(java.io.File.class) || - statusCode.getClass().equals(Integer.class) || - statusCode.getClass().equals(String.class) || - statusCode.getClass().isEnum()) { - map.put("status_code", statusCode); - } else if (isListOfFile(statusCode)) { - for(int i = 0; i< getListSize(statusCode); i++) { - map.put("status_code[" + i + "]", getFromList(statusCode, i)); - } - } - else { - map.put("status_code", JSON.getDefault().getMapper().writeValueAsString(statusCode)); - } + @JsonProperty(JSON_PROPERTY_STATUS_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; } - if (declineReason != null) { - if (isFileTypeOrListOfFiles(declineReason)) { - fileTypeFound = true; - } - if (declineReason.getClass().equals(java.io.File.class) || - declineReason.getClass().equals(Integer.class) || - declineReason.getClass().equals(String.class) || - declineReason.getClass().isEnum()) { - map.put("decline_reason", declineReason); - } else if (isListOfFile(declineReason)) { - for(int i = 0; i< getListSize(declineReason); i++) { - map.put("decline_reason[" + i + "]", getFromList(declineReason, i)); - } - } - else { - map.put("decline_reason", JSON.getDefault().getMapper().writeValueAsString(declineReason)); - } + public SignatureRequestResponseSignatures declineReason(String declineReason) { + this.declineReason = declineReason; + return this; } - if (signedAt != null) { - if (isFileTypeOrListOfFiles(signedAt)) { - fileTypeFound = true; - } - if (signedAt.getClass().equals(java.io.File.class) || - signedAt.getClass().equals(Integer.class) || - signedAt.getClass().equals(String.class) || - signedAt.getClass().isEnum()) { - map.put("signed_at", signedAt); - } else if (isListOfFile(signedAt)) { - for(int i = 0; i< getListSize(signedAt); i++) { - map.put("signed_at[" + i + "]", getFromList(signedAt, i)); - } - } - else { - map.put("signed_at", JSON.getDefault().getMapper().writeValueAsString(signedAt)); - } + /** + * The reason provided by the signer for declining the request. + * + * @return declineReason + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DECLINE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeclineReason() { + return declineReason; } - if (lastViewedAt != null) { - if (isFileTypeOrListOfFiles(lastViewedAt)) { - fileTypeFound = true; - } - if (lastViewedAt.getClass().equals(java.io.File.class) || - lastViewedAt.getClass().equals(Integer.class) || - lastViewedAt.getClass().equals(String.class) || - lastViewedAt.getClass().isEnum()) { - map.put("last_viewed_at", lastViewedAt); - } else if (isListOfFile(lastViewedAt)) { - for(int i = 0; i< getListSize(lastViewedAt); i++) { - map.put("last_viewed_at[" + i + "]", getFromList(lastViewedAt, i)); - } - } - else { - map.put("last_viewed_at", JSON.getDefault().getMapper().writeValueAsString(lastViewedAt)); - } + @JsonProperty(JSON_PROPERTY_DECLINE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclineReason(String declineReason) { + this.declineReason = declineReason; } - if (lastRemindedAt != null) { - if (isFileTypeOrListOfFiles(lastRemindedAt)) { - fileTypeFound = true; - } - if (lastRemindedAt.getClass().equals(java.io.File.class) || - lastRemindedAt.getClass().equals(Integer.class) || - lastRemindedAt.getClass().equals(String.class) || - lastRemindedAt.getClass().isEnum()) { - map.put("last_reminded_at", lastRemindedAt); - } else if (isListOfFile(lastRemindedAt)) { - for(int i = 0; i< getListSize(lastRemindedAt); i++) { - map.put("last_reminded_at[" + i + "]", getFromList(lastRemindedAt, i)); - } - } - else { - map.put("last_reminded_at", JSON.getDefault().getMapper().writeValueAsString(lastRemindedAt)); - } + public SignatureRequestResponseSignatures signedAt(Integer signedAt) { + this.signedAt = signedAt; + return this; } - if (hasPin != null) { - if (isFileTypeOrListOfFiles(hasPin)) { - fileTypeFound = true; - } - if (hasPin.getClass().equals(java.io.File.class) || - hasPin.getClass().equals(Integer.class) || - hasPin.getClass().equals(String.class) || - hasPin.getClass().isEnum()) { - map.put("has_pin", hasPin); - } else if (isListOfFile(hasPin)) { - for(int i = 0; i< getListSize(hasPin); i++) { - map.put("has_pin[" + i + "]", getFromList(hasPin, i)); - } - } - else { - map.put("has_pin", JSON.getDefault().getMapper().writeValueAsString(hasPin)); - } + /** + * Time that the document was signed or null. + * + * @return signedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSignedAt() { + return signedAt; } - if (hasSmsAuth != null) { - if (isFileTypeOrListOfFiles(hasSmsAuth)) { - fileTypeFound = true; - } - if (hasSmsAuth.getClass().equals(java.io.File.class) || - hasSmsAuth.getClass().equals(Integer.class) || - hasSmsAuth.getClass().equals(String.class) || - hasSmsAuth.getClass().isEnum()) { - map.put("has_sms_auth", hasSmsAuth); - } else if (isListOfFile(hasSmsAuth)) { - for(int i = 0; i< getListSize(hasSmsAuth); i++) { - map.put("has_sms_auth[" + i + "]", getFromList(hasSmsAuth, i)); - } - } - else { - map.put("has_sms_auth", JSON.getDefault().getMapper().writeValueAsString(hasSmsAuth)); - } + @JsonProperty(JSON_PROPERTY_SIGNED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignedAt(Integer signedAt) { + this.signedAt = signedAt; } - if (hasSmsDelivery != null) { - if (isFileTypeOrListOfFiles(hasSmsDelivery)) { - fileTypeFound = true; - } - if (hasSmsDelivery.getClass().equals(java.io.File.class) || - hasSmsDelivery.getClass().equals(Integer.class) || - hasSmsDelivery.getClass().equals(String.class) || - hasSmsDelivery.getClass().isEnum()) { - map.put("has_sms_delivery", hasSmsDelivery); - } else if (isListOfFile(hasSmsDelivery)) { - for(int i = 0; i< getListSize(hasSmsDelivery); i++) { - map.put("has_sms_delivery[" + i + "]", getFromList(hasSmsDelivery, i)); - } - } - else { - map.put("has_sms_delivery", JSON.getDefault().getMapper().writeValueAsString(hasSmsDelivery)); - } + public SignatureRequestResponseSignatures lastViewedAt(Integer lastViewedAt) { + this.lastViewedAt = lastViewedAt; + return this; } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - if (smsPhoneNumber.getClass().equals(java.io.File.class) || - smsPhoneNumber.getClass().equals(Integer.class) || - smsPhoneNumber.getClass().equals(String.class) || - smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for(int i = 0; i< getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } - else { - map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } + /** + * The time that the document was last viewed by this signer or null. + * + * @return lastViewedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLastViewedAt() { + return lastViewedAt; } - if (reassignedBy != null) { - if (isFileTypeOrListOfFiles(reassignedBy)) { - fileTypeFound = true; - } - if (reassignedBy.getClass().equals(java.io.File.class) || - reassignedBy.getClass().equals(Integer.class) || - reassignedBy.getClass().equals(String.class) || - reassignedBy.getClass().isEnum()) { - map.put("reassigned_by", reassignedBy); - } else if (isListOfFile(reassignedBy)) { - for(int i = 0; i< getListSize(reassignedBy); i++) { - map.put("reassigned_by[" + i + "]", getFromList(reassignedBy, i)); - } - } - else { - map.put("reassigned_by", JSON.getDefault().getMapper().writeValueAsString(reassignedBy)); - } + @JsonProperty(JSON_PROPERTY_LAST_VIEWED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastViewedAt(Integer lastViewedAt) { + this.lastViewedAt = lastViewedAt; } - if (reassignmentReason != null) { - if (isFileTypeOrListOfFiles(reassignmentReason)) { - fileTypeFound = true; - } - if (reassignmentReason.getClass().equals(java.io.File.class) || - reassignmentReason.getClass().equals(Integer.class) || - reassignmentReason.getClass().equals(String.class) || - reassignmentReason.getClass().isEnum()) { - map.put("reassignment_reason", reassignmentReason); - } else if (isListOfFile(reassignmentReason)) { - for(int i = 0; i< getListSize(reassignmentReason); i++) { - map.put("reassignment_reason[" + i + "]", getFromList(reassignmentReason, i)); - } - } - else { - map.put("reassignment_reason", JSON.getDefault().getMapper().writeValueAsString(reassignmentReason)); - } + public SignatureRequestResponseSignatures lastRemindedAt(Integer lastRemindedAt) { + this.lastRemindedAt = lastRemindedAt; + return this; } - if (reassignedFrom != null) { - if (isFileTypeOrListOfFiles(reassignedFrom)) { - fileTypeFound = true; - } - if (reassignedFrom.getClass().equals(java.io.File.class) || - reassignedFrom.getClass().equals(Integer.class) || - reassignedFrom.getClass().equals(String.class) || - reassignedFrom.getClass().isEnum()) { - map.put("reassigned_from", reassignedFrom); - } else if (isListOfFile(reassignedFrom)) { - for(int i = 0; i< getListSize(reassignedFrom); i++) { - map.put("reassigned_from[" + i + "]", getFromList(reassignedFrom, i)); - } - } - else { - map.put("reassigned_from", JSON.getDefault().getMapper().writeValueAsString(reassignedFrom)); - } + /** + * The time the last reminder email was sent to the signer or null. + * + * @return lastRemindedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getLastRemindedAt() { + return lastRemindedAt; } - if (error != null) { - if (isFileTypeOrListOfFiles(error)) { - fileTypeFound = true; - } - if (error.getClass().equals(java.io.File.class) || - error.getClass().equals(Integer.class) || - error.getClass().equals(String.class) || - error.getClass().isEnum()) { - map.put("error", error); - } else if (isListOfFile(error)) { - for(int i = 0; i< getListSize(error); i++) { - map.put("error[" + i + "]", getFromList(error, i)); - } + @JsonProperty(JSON_PROPERTY_LAST_REMINDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastRemindedAt(Integer lastRemindedAt) { + this.lastRemindedAt = lastRemindedAt; + } + + public SignatureRequestResponseSignatures hasPin(Boolean hasPin) { + this.hasPin = hasPin; + return this; + } + + /** + * Boolean to indicate whether this signature requires a PIN to access. + * + * @return hasPin + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasPin() { + return hasPin; + } + + @JsonProperty(JSON_PROPERTY_HAS_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPin(Boolean hasPin) { + this.hasPin = hasPin; + } + + public SignatureRequestResponseSignatures hasSmsAuth(Boolean hasSmsAuth) { + this.hasSmsAuth = hasSmsAuth; + return this; + } + + /** + * Boolean to indicate whether this signature has SMS authentication enabled. + * + * @return hasSmsAuth + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasSmsAuth() { + return hasSmsAuth; + } + + @JsonProperty(JSON_PROPERTY_HAS_SMS_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSmsAuth(Boolean hasSmsAuth) { + this.hasSmsAuth = hasSmsAuth; + } + + public SignatureRequestResponseSignatures hasSmsDelivery(Boolean hasSmsDelivery) { + this.hasSmsDelivery = hasSmsDelivery; + return this; + } + + /** + * Boolean to indicate whether this signature has SMS delivery enabled. + * + * @return hasSmsDelivery + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasSmsDelivery() { + return hasSmsDelivery; + } + + @JsonProperty(JSON_PROPERTY_HAS_SMS_DELIVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasSmsDelivery(Boolean hasSmsDelivery) { + this.hasSmsDelivery = hasSmsDelivery; + } + + public SignatureRequestResponseSignatures smsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + return this; + } + + /** + * The SMS phone number used for authentication or signature request delivery. + * + * @return smsPhoneNumber + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + public SignatureRequestResponseSignatures reassignedBy(String reassignedBy) { + this.reassignedBy = reassignedBy; + return this; + } + + /** + * Email address of original signer who reassigned to this signer. + * + * @return reassignedBy + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReassignedBy() { + return reassignedBy; + } + + @JsonProperty(JSON_PROPERTY_REASSIGNED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignedBy(String reassignedBy) { + this.reassignedBy = reassignedBy; + } + + public SignatureRequestResponseSignatures reassignmentReason(String reassignmentReason) { + this.reassignmentReason = reassignmentReason; + return this; + } + + /** + * Reason provided by original signer who reassigned to this signer. + * + * @return reassignmentReason + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReassignmentReason() { + return reassignmentReason; + } + + @JsonProperty(JSON_PROPERTY_REASSIGNMENT_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignmentReason(String reassignmentReason) { + this.reassignmentReason = reassignmentReason; + } + + public SignatureRequestResponseSignatures reassignedFrom(String reassignedFrom) { + this.reassignedFrom = reassignedFrom; + return this; + } + + /** + * Previous signature identifier. + * + * @return reassignedFrom + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReassignedFrom() { + return reassignedFrom; + } + + @JsonProperty(JSON_PROPERTY_REASSIGNED_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReassignedFrom(String reassignedFrom) { + this.reassignedFrom = reassignedFrom; + } + + public SignatureRequestResponseSignatures error(String error) { + this.error = error; + return this; + } + + /** + * Error message pertaining to this signer, or null. + * + * @return error + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getError() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(String error) { + this.error = error; + } + + /** Return true if this SignatureRequestResponseSignatures object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestResponseSignatures signatureRequestResponseSignatures = + (SignatureRequestResponseSignatures) o; + return Objects.equals(this.signatureId, signatureRequestResponseSignatures.signatureId) + && Objects.equals( + this.signerGroupGuid, signatureRequestResponseSignatures.signerGroupGuid) + && Objects.equals( + this.signerEmailAddress, + signatureRequestResponseSignatures.signerEmailAddress) + && Objects.equals(this.signerName, signatureRequestResponseSignatures.signerName) + && Objects.equals(this.signerRole, signatureRequestResponseSignatures.signerRole) + && Objects.equals(this.order, signatureRequestResponseSignatures.order) + && Objects.equals(this.statusCode, signatureRequestResponseSignatures.statusCode) + && Objects.equals( + this.declineReason, signatureRequestResponseSignatures.declineReason) + && Objects.equals(this.signedAt, signatureRequestResponseSignatures.signedAt) + && Objects.equals( + this.lastViewedAt, signatureRequestResponseSignatures.lastViewedAt) + && Objects.equals( + this.lastRemindedAt, signatureRequestResponseSignatures.lastRemindedAt) + && Objects.equals(this.hasPin, signatureRequestResponseSignatures.hasPin) + && Objects.equals(this.hasSmsAuth, signatureRequestResponseSignatures.hasSmsAuth) + && Objects.equals( + this.hasSmsDelivery, signatureRequestResponseSignatures.hasSmsDelivery) + && Objects.equals( + this.smsPhoneNumber, signatureRequestResponseSignatures.smsPhoneNumber) + && Objects.equals( + this.reassignedBy, signatureRequestResponseSignatures.reassignedBy) + && Objects.equals( + this.reassignmentReason, + signatureRequestResponseSignatures.reassignmentReason) + && Objects.equals( + this.reassignedFrom, signatureRequestResponseSignatures.reassignedFrom) + && Objects.equals(this.error, signatureRequestResponseSignatures.error); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + signatureId, + signerGroupGuid, + signerEmailAddress, + signerName, + signerRole, + order, + statusCode, + declineReason, + signedAt, + lastViewedAt, + lastRemindedAt, + hasPin, + hasSmsAuth, + hasSmsDelivery, + smsPhoneNumber, + reassignedBy, + reassignmentReason, + reassignedFrom, + error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestResponseSignatures {\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" signerGroupGuid: ").append(toIndentedString(signerGroupGuid)).append("\n"); + sb.append(" signerEmailAddress: ") + .append(toIndentedString(signerEmailAddress)) + .append("\n"); + sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); + sb.append(" signerRole: ").append(toIndentedString(signerRole)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" declineReason: ").append(toIndentedString(declineReason)).append("\n"); + sb.append(" signedAt: ").append(toIndentedString(signedAt)).append("\n"); + sb.append(" lastViewedAt: ").append(toIndentedString(lastViewedAt)).append("\n"); + sb.append(" lastRemindedAt: ").append(toIndentedString(lastRemindedAt)).append("\n"); + sb.append(" hasPin: ").append(toIndentedString(hasPin)).append("\n"); + sb.append(" hasSmsAuth: ").append(toIndentedString(hasSmsAuth)).append("\n"); + sb.append(" hasSmsDelivery: ").append(toIndentedString(hasSmsDelivery)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" reassignedBy: ").append(toIndentedString(reassignedBy)).append("\n"); + sb.append(" reassignmentReason: ") + .append(toIndentedString(reassignmentReason)) + .append("\n"); + sb.append(" reassignedFrom: ").append(toIndentedString(reassignedFrom)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } + + if (signatureId.getClass().equals(java.io.File.class) + || signatureId.getClass().equals(Integer.class) + || signatureId.getClass().equals(String.class) + || signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for (int i = 0; i < getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } + } else { + map.put( + "signature_id", + JSON.getDefault().getMapper().writeValueAsString(signatureId)); + } + } + if (signerGroupGuid != null) { + if (isFileTypeOrListOfFiles(signerGroupGuid)) { + fileTypeFound = true; + } + + if (signerGroupGuid.getClass().equals(java.io.File.class) + || signerGroupGuid.getClass().equals(Integer.class) + || signerGroupGuid.getClass().equals(String.class) + || signerGroupGuid.getClass().isEnum()) { + map.put("signer_group_guid", signerGroupGuid); + } else if (isListOfFile(signerGroupGuid)) { + for (int i = 0; i < getListSize(signerGroupGuid); i++) { + map.put("signer_group_guid[" + i + "]", getFromList(signerGroupGuid, i)); + } + } else { + map.put( + "signer_group_guid", + JSON.getDefault().getMapper().writeValueAsString(signerGroupGuid)); + } + } + if (signerEmailAddress != null) { + if (isFileTypeOrListOfFiles(signerEmailAddress)) { + fileTypeFound = true; + } + + if (signerEmailAddress.getClass().equals(java.io.File.class) + || signerEmailAddress.getClass().equals(Integer.class) + || signerEmailAddress.getClass().equals(String.class) + || signerEmailAddress.getClass().isEnum()) { + map.put("signer_email_address", signerEmailAddress); + } else if (isListOfFile(signerEmailAddress)) { + for (int i = 0; i < getListSize(signerEmailAddress); i++) { + map.put( + "signer_email_address[" + i + "]", + getFromList(signerEmailAddress, i)); + } + } else { + map.put( + "signer_email_address", + JSON.getDefault().getMapper().writeValueAsString(signerEmailAddress)); + } + } + if (signerName != null) { + if (isFileTypeOrListOfFiles(signerName)) { + fileTypeFound = true; + } + + if (signerName.getClass().equals(java.io.File.class) + || signerName.getClass().equals(Integer.class) + || signerName.getClass().equals(String.class) + || signerName.getClass().isEnum()) { + map.put("signer_name", signerName); + } else if (isListOfFile(signerName)) { + for (int i = 0; i < getListSize(signerName); i++) { + map.put("signer_name[" + i + "]", getFromList(signerName, i)); + } + } else { + map.put( + "signer_name", + JSON.getDefault().getMapper().writeValueAsString(signerName)); + } + } + if (signerRole != null) { + if (isFileTypeOrListOfFiles(signerRole)) { + fileTypeFound = true; + } + + if (signerRole.getClass().equals(java.io.File.class) + || signerRole.getClass().equals(Integer.class) + || signerRole.getClass().equals(String.class) + || signerRole.getClass().isEnum()) { + map.put("signer_role", signerRole); + } else if (isListOfFile(signerRole)) { + for (int i = 0; i < getListSize(signerRole); i++) { + map.put("signer_role[" + i + "]", getFromList(signerRole, i)); + } + } else { + map.put( + "signer_role", + JSON.getDefault().getMapper().writeValueAsString(signerRole)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + if (statusCode != null) { + if (isFileTypeOrListOfFiles(statusCode)) { + fileTypeFound = true; + } + + if (statusCode.getClass().equals(java.io.File.class) + || statusCode.getClass().equals(Integer.class) + || statusCode.getClass().equals(String.class) + || statusCode.getClass().isEnum()) { + map.put("status_code", statusCode); + } else if (isListOfFile(statusCode)) { + for (int i = 0; i < getListSize(statusCode); i++) { + map.put("status_code[" + i + "]", getFromList(statusCode, i)); + } + } else { + map.put( + "status_code", + JSON.getDefault().getMapper().writeValueAsString(statusCode)); + } + } + if (declineReason != null) { + if (isFileTypeOrListOfFiles(declineReason)) { + fileTypeFound = true; + } + + if (declineReason.getClass().equals(java.io.File.class) + || declineReason.getClass().equals(Integer.class) + || declineReason.getClass().equals(String.class) + || declineReason.getClass().isEnum()) { + map.put("decline_reason", declineReason); + } else if (isListOfFile(declineReason)) { + for (int i = 0; i < getListSize(declineReason); i++) { + map.put("decline_reason[" + i + "]", getFromList(declineReason, i)); + } + } else { + map.put( + "decline_reason", + JSON.getDefault().getMapper().writeValueAsString(declineReason)); + } + } + if (signedAt != null) { + if (isFileTypeOrListOfFiles(signedAt)) { + fileTypeFound = true; + } + + if (signedAt.getClass().equals(java.io.File.class) + || signedAt.getClass().equals(Integer.class) + || signedAt.getClass().equals(String.class) + || signedAt.getClass().isEnum()) { + map.put("signed_at", signedAt); + } else if (isListOfFile(signedAt)) { + for (int i = 0; i < getListSize(signedAt); i++) { + map.put("signed_at[" + i + "]", getFromList(signedAt, i)); + } + } else { + map.put( + "signed_at", + JSON.getDefault().getMapper().writeValueAsString(signedAt)); + } + } + if (lastViewedAt != null) { + if (isFileTypeOrListOfFiles(lastViewedAt)) { + fileTypeFound = true; + } + + if (lastViewedAt.getClass().equals(java.io.File.class) + || lastViewedAt.getClass().equals(Integer.class) + || lastViewedAt.getClass().equals(String.class) + || lastViewedAt.getClass().isEnum()) { + map.put("last_viewed_at", lastViewedAt); + } else if (isListOfFile(lastViewedAt)) { + for (int i = 0; i < getListSize(lastViewedAt); i++) { + map.put("last_viewed_at[" + i + "]", getFromList(lastViewedAt, i)); + } + } else { + map.put( + "last_viewed_at", + JSON.getDefault().getMapper().writeValueAsString(lastViewedAt)); + } + } + if (lastRemindedAt != null) { + if (isFileTypeOrListOfFiles(lastRemindedAt)) { + fileTypeFound = true; + } + + if (lastRemindedAt.getClass().equals(java.io.File.class) + || lastRemindedAt.getClass().equals(Integer.class) + || lastRemindedAt.getClass().equals(String.class) + || lastRemindedAt.getClass().isEnum()) { + map.put("last_reminded_at", lastRemindedAt); + } else if (isListOfFile(lastRemindedAt)) { + for (int i = 0; i < getListSize(lastRemindedAt); i++) { + map.put("last_reminded_at[" + i + "]", getFromList(lastRemindedAt, i)); + } + } else { + map.put( + "last_reminded_at", + JSON.getDefault().getMapper().writeValueAsString(lastRemindedAt)); + } + } + if (hasPin != null) { + if (isFileTypeOrListOfFiles(hasPin)) { + fileTypeFound = true; + } + + if (hasPin.getClass().equals(java.io.File.class) + || hasPin.getClass().equals(Integer.class) + || hasPin.getClass().equals(String.class) + || hasPin.getClass().isEnum()) { + map.put("has_pin", hasPin); + } else if (isListOfFile(hasPin)) { + for (int i = 0; i < getListSize(hasPin); i++) { + map.put("has_pin[" + i + "]", getFromList(hasPin, i)); + } + } else { + map.put("has_pin", JSON.getDefault().getMapper().writeValueAsString(hasPin)); + } + } + if (hasSmsAuth != null) { + if (isFileTypeOrListOfFiles(hasSmsAuth)) { + fileTypeFound = true; + } + + if (hasSmsAuth.getClass().equals(java.io.File.class) + || hasSmsAuth.getClass().equals(Integer.class) + || hasSmsAuth.getClass().equals(String.class) + || hasSmsAuth.getClass().isEnum()) { + map.put("has_sms_auth", hasSmsAuth); + } else if (isListOfFile(hasSmsAuth)) { + for (int i = 0; i < getListSize(hasSmsAuth); i++) { + map.put("has_sms_auth[" + i + "]", getFromList(hasSmsAuth, i)); + } + } else { + map.put( + "has_sms_auth", + JSON.getDefault().getMapper().writeValueAsString(hasSmsAuth)); + } + } + if (hasSmsDelivery != null) { + if (isFileTypeOrListOfFiles(hasSmsDelivery)) { + fileTypeFound = true; + } + + if (hasSmsDelivery.getClass().equals(java.io.File.class) + || hasSmsDelivery.getClass().equals(Integer.class) + || hasSmsDelivery.getClass().equals(String.class) + || hasSmsDelivery.getClass().isEnum()) { + map.put("has_sms_delivery", hasSmsDelivery); + } else if (isListOfFile(hasSmsDelivery)) { + for (int i = 0; i < getListSize(hasSmsDelivery); i++) { + map.put("has_sms_delivery[" + i + "]", getFromList(hasSmsDelivery, i)); + } + } else { + map.put( + "has_sms_delivery", + JSON.getDefault().getMapper().writeValueAsString(hasSmsDelivery)); + } + } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } + + if (smsPhoneNumber.getClass().equals(java.io.File.class) + || smsPhoneNumber.getClass().equals(Integer.class) + || smsPhoneNumber.getClass().equals(String.class) + || smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for (int i = 0; i < getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } + } else { + map.put( + "sms_phone_number", + JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); + } + } + if (reassignedBy != null) { + if (isFileTypeOrListOfFiles(reassignedBy)) { + fileTypeFound = true; + } + + if (reassignedBy.getClass().equals(java.io.File.class) + || reassignedBy.getClass().equals(Integer.class) + || reassignedBy.getClass().equals(String.class) + || reassignedBy.getClass().isEnum()) { + map.put("reassigned_by", reassignedBy); + } else if (isListOfFile(reassignedBy)) { + for (int i = 0; i < getListSize(reassignedBy); i++) { + map.put("reassigned_by[" + i + "]", getFromList(reassignedBy, i)); + } + } else { + map.put( + "reassigned_by", + JSON.getDefault().getMapper().writeValueAsString(reassignedBy)); + } + } + if (reassignmentReason != null) { + if (isFileTypeOrListOfFiles(reassignmentReason)) { + fileTypeFound = true; + } + + if (reassignmentReason.getClass().equals(java.io.File.class) + || reassignmentReason.getClass().equals(Integer.class) + || reassignmentReason.getClass().equals(String.class) + || reassignmentReason.getClass().isEnum()) { + map.put("reassignment_reason", reassignmentReason); + } else if (isListOfFile(reassignmentReason)) { + for (int i = 0; i < getListSize(reassignmentReason); i++) { + map.put( + "reassignment_reason[" + i + "]", + getFromList(reassignmentReason, i)); + } + } else { + map.put( + "reassignment_reason", + JSON.getDefault().getMapper().writeValueAsString(reassignmentReason)); + } + } + if (reassignedFrom != null) { + if (isFileTypeOrListOfFiles(reassignedFrom)) { + fileTypeFound = true; + } + + if (reassignedFrom.getClass().equals(java.io.File.class) + || reassignedFrom.getClass().equals(Integer.class) + || reassignedFrom.getClass().equals(String.class) + || reassignedFrom.getClass().isEnum()) { + map.put("reassigned_from", reassignedFrom); + } else if (isListOfFile(reassignedFrom)) { + for (int i = 0; i < getListSize(reassignedFrom); i++) { + map.put("reassigned_from[" + i + "]", getFromList(reassignedFrom, i)); + } + } else { + map.put( + "reassigned_from", + JSON.getDefault().getMapper().writeValueAsString(reassignedFrom)); + } + } + if (error != null) { + if (isFileTypeOrListOfFiles(error)) { + fileTypeFound = true; + } + + if (error.getClass().equals(java.io.File.class) + || error.getClass().equals(Integer.class) + || error.getClass().equals(String.class) + || error.getClass().isEnum()) { + map.put("error", error); + } else if (isListOfFile(error)) { + for (int i = 0; i < getListSize(error); i++) { + map.put("error[" + i + "]", getFromList(error, i)); + } + } else { + map.put("error", JSON.getDefault().getMapper().writeValueAsString(error)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java index db6fcd4..06f7431 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestSendRequest.java @@ -10,1526 +10,1550 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubSignatureRequestGroupedSigners; -import com.dropbox.sign.model.SubSignatureRequestSigner; -import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SignatureRequestSendRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestSendRequest { - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = null; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; - public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; - private List groupedSigners = null; + public static final String JSON_PROPERTY_GROUPED_SIGNERS = "grouped_signers"; + private List groupedSigners = null; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + 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 = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + 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 = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + 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 = null; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + 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_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_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - private Boolean isEid = false; + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - private Boolean useTextTags = false; + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; - public SignatureRequestSendRequest() { - } + public SignatureRequestSendRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestSendRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestSendRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestSendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestSendRequest.class); + } - static public SignatureRequestSendRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestSendRequest.class - ); - } + public static SignatureRequestSendRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestSendRequest.class); + } - public SignatureRequestSendRequest files(List files) { - this.files = files; - return this; - } + public SignatureRequestSendRequest files(List files) { + this.files = files; + return this; + } - public SignatureRequestSendRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public SignatureRequestSendRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * 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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - public List getFiles() { - return files; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + public SignatureRequestSendRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } + public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } - public SignatureRequestSendRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - public SignatureRequestSendRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + public SignatureRequestSendRequest signers(List signers) { + this.signers = signers; + return this; } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } + public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public SignatureRequestSendRequest signers(List signers) { - this.signers = signers; - return this; - } - - public SignatureRequestSendRequest addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. - * @return signers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public SignatureRequestSendRequest groupedSigners(List groupedSigners) { - this.groupedSigners = groupedSigners; - return this; - } - - public SignatureRequestSendRequest addGroupedSignersItem(SubSignatureRequestGroupedSigners groupedSignersItem) { - if (this.groupedSigners == null) { - this.groupedSigners = new ArrayList<>(); - } - this.groupedSigners.add(groupedSignersItem); - 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 - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getGroupedSigners() { - return groupedSigners; - } + /** + * Add Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } - @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupedSigners(List groupedSigners) { - this.groupedSigners = groupedSigners; - } - - - public SignatureRequestSendRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public SignatureRequestSendRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public SignatureRequestSendRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } + public SignatureRequestSendRequest groupedSigners( + List groupedSigners) { + this.groupedSigners = groupedSigners; + return this; + } - public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public SignatureRequestSendRequest ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + public SignatureRequestSendRequest addGroupedSignersItem( + SubSignatureRequestGroupedSigners groupedSignersItem) { + if (this.groupedSigners == null) { + this.groupedSigners = new ArrayList<>(); + } + this.groupedSigners.add(groupedSignersItem); + return this; } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * @return ccEmailAddresses - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - - public SignatureRequestSendRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public SignatureRequestSendRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } + /** + * Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or + * **grouped_signers**, but not both. + * + * @return groupedSigners + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getGroupedSigners() { + return groupedSigners; + } - public SignatureRequestSendRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public SignatureRequestSendRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } + @JsonProperty(JSON_PROPERTY_GROUPED_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupedSigners(List groupedSigners) { + this.groupedSigners = groupedSigners; + } - public SignatureRequestSendRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public SignatureRequestSendRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); - } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - - public SignatureRequestSendRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public SignatureRequestSendRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - 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.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - - public SignatureRequestSendRequest hideTextTags(Boolean hideTextTags) { - this.hideTextTags = 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 - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHideTextTags() { - return hideTextTags; - } - - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(Boolean hideTextTags) { - this.hideTextTags = 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 - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsQualifiedSignature() { - return isQualifiedSignature; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsQualifiedSignature(Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - } - - - public SignatureRequestSendRequest isEid(Boolean isEid) { - this.isEid = 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 - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsEid() { - return isEid; - } - - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(Boolean isEid) { - this.isEid = isEid; - } - - - public SignatureRequestSendRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestSendRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestSendRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public SignatureRequestSendRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public SignatureRequestSendRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } + public SignatureRequestSendRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public SignatureRequestSendRequest subject(String subject) { - this.subject = subject; - return this; - } + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestSendRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestSendRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public SignatureRequestSendRequest useTextTags(Boolean useTextTags) { - this.useTextTags = 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 - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUseTextTags() { - return useTextTags; - } - - - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(Boolean useTextTags) { - this.useTextTags = useTextTags; - } - - - public SignatureRequestSendRequest expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this SignatureRequestSendRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestSendRequest signatureRequestSendRequest = (SignatureRequestSendRequest) o; - return Objects.equals(this.files, signatureRequestSendRequest.files) && - Objects.equals(this.fileUrls, signatureRequestSendRequest.fileUrls) && - Objects.equals(this.signers, signatureRequestSendRequest.signers) && - Objects.equals(this.groupedSigners, signatureRequestSendRequest.groupedSigners) && - Objects.equals(this.allowDecline, signatureRequestSendRequest.allowDecline) && - Objects.equals(this.allowReassign, signatureRequestSendRequest.allowReassign) && - Objects.equals(this.attachments, signatureRequestSendRequest.attachments) && - Objects.equals(this.ccEmailAddresses, signatureRequestSendRequest.ccEmailAddresses) && - Objects.equals(this.clientId, signatureRequestSendRequest.clientId) && - Objects.equals(this.customFields, signatureRequestSendRequest.customFields) && - Objects.equals(this.fieldOptions, signatureRequestSendRequest.fieldOptions) && - Objects.equals(this.formFieldGroups, signatureRequestSendRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, signatureRequestSendRequest.formFieldRules) && - Objects.equals(this.formFieldsPerDocument, signatureRequestSendRequest.formFieldsPerDocument) && - Objects.equals(this.hideTextTags, signatureRequestSendRequest.hideTextTags) && - Objects.equals(this.isQualifiedSignature, signatureRequestSendRequest.isQualifiedSignature) && - Objects.equals(this.isEid, signatureRequestSendRequest.isEid) && - Objects.equals(this.message, signatureRequestSendRequest.message) && - Objects.equals(this.metadata, signatureRequestSendRequest.metadata) && - Objects.equals(this.signingOptions, signatureRequestSendRequest.signingOptions) && - Objects.equals(this.signingRedirectUrl, signatureRequestSendRequest.signingRedirectUrl) && - Objects.equals(this.subject, signatureRequestSendRequest.subject) && - Objects.equals(this.testMode, signatureRequestSendRequest.testMode) && - Objects.equals(this.title, signatureRequestSendRequest.title) && - Objects.equals(this.useTextTags, signatureRequestSendRequest.useTextTags) && - Objects.equals(this.expiresAt, signatureRequestSendRequest.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(files, fileUrls, signers, groupedSigners, allowDecline, allowReassign, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title, useTextTags, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestSendRequest {\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" isQualifiedSignature: ").append(toIndentedString(isQualifiedSignature)).append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + public SignatureRequestSendRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; } - if (groupedSigners != null) { - if (isFileTypeOrListOfFiles(groupedSigners)) { - fileTypeFound = true; - } - if (groupedSigners.getClass().equals(java.io.File.class) || - groupedSigners.getClass().equals(Integer.class) || - groupedSigners.getClass().equals(String.class) || - groupedSigners.getClass().isEnum()) { - map.put("grouped_signers", groupedSigners); - } else if (isListOfFile(groupedSigners)) { - for(int i = 0; i< getListSize(groupedSigners); i++) { - map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); - } - } - else { - map.put("grouped_signers", JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); - } + public SignatureRequestSendRequest attachments(List attachments) { + this.attachments = attachments; + return this; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + public SignatureRequestSendRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } + this.attachments.add(attachmentsItem); + return this; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } + public SignatureRequestSendRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); + public SignatureRequestSendRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + public SignatureRequestSendRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - if (hideTextTags.getClass().equals(java.io.File.class) || - hideTextTags.getClass().equals(Integer.class) || - hideTextTags.getClass().equals(String.class) || - hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for(int i = 0; i< getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } - else { - map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } + public SignatureRequestSendRequest customFields(List customFields) { + this.customFields = customFields; + return this; } - if (isQualifiedSignature != null) { - if (isFileTypeOrListOfFiles(isQualifiedSignature)) { - fileTypeFound = true; - } - if (isQualifiedSignature.getClass().equals(java.io.File.class) || - isQualifiedSignature.getClass().equals(Integer.class) || - isQualifiedSignature.getClass().equals(String.class) || - isQualifiedSignature.getClass().isEnum()) { - map.put("is_qualified_signature", isQualifiedSignature); - } else if (isListOfFile(isQualifiedSignature)) { - for(int i = 0; i< getListSize(isQualifiedSignature); i++) { - map.put("is_qualified_signature[" + i + "]", getFromList(isQualifiedSignature, i)); - } - } - else { - map.put("is_qualified_signature", JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); + public SignatureRequestSendRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - if (isEid.getClass().equals(java.io.File.class) || - isEid.getClass().equals(Integer.class) || - isEid.getClass().equals(String.class) || - isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for(int i = 0; i< getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } - else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + public SignatureRequestSendRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + public SignatureRequestSendRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + public SignatureRequestSendRequest addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - if (useTextTags.getClass().equals(java.io.File.class) || - useTextTags.getClass().equals(Integer.class) || - useTextTags.getClass().equals(String.class) || - useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for(int i = 0; i< getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } - else { - map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + public SignatureRequestSendRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; + + public SignatureRequestSendRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; + } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + public SignatureRequestSendRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } + + public SignatureRequestSendRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + public SignatureRequestSendRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = 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 @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; + } + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = 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 @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsQualifiedSignature() { + return isQualifiedSignature; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsQualifiedSignature(Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + } + + public SignatureRequestSendRequest isEid(Boolean isEid) { + this.isEid = 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 @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEid() { + return isEid; + } + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + public SignatureRequestSendRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestSendRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestSendRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public SignatureRequestSendRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public SignatureRequestSendRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; } - return o.toString().replace("\n", "\n "); - } -} + public SignatureRequestSendRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestSendRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestSendRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public SignatureRequestSendRequest useTextTags(Boolean useTextTags) { + this.useTextTags = 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 @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + public SignatureRequestSendRequest expiresAt(Integer expiresAt) { + this.expiresAt = 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this SignatureRequestSendRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignatureRequestSendRequest signatureRequestSendRequest = (SignatureRequestSendRequest) o; + return Objects.equals(this.files, signatureRequestSendRequest.files) + && Objects.equals(this.fileUrls, signatureRequestSendRequest.fileUrls) + && Objects.equals(this.signers, signatureRequestSendRequest.signers) + && Objects.equals(this.groupedSigners, signatureRequestSendRequest.groupedSigners) + && Objects.equals(this.allowDecline, signatureRequestSendRequest.allowDecline) + && Objects.equals(this.allowReassign, signatureRequestSendRequest.allowReassign) + && Objects.equals(this.attachments, signatureRequestSendRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, signatureRequestSendRequest.ccEmailAddresses) + && Objects.equals(this.clientId, signatureRequestSendRequest.clientId) + && Objects.equals(this.customFields, signatureRequestSendRequest.customFields) + && Objects.equals(this.fieldOptions, signatureRequestSendRequest.fieldOptions) + && Objects.equals(this.formFieldGroups, signatureRequestSendRequest.formFieldGroups) + && Objects.equals(this.formFieldRules, signatureRequestSendRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + signatureRequestSendRequest.formFieldsPerDocument) + && Objects.equals(this.hideTextTags, signatureRequestSendRequest.hideTextTags) + && Objects.equals( + this.isQualifiedSignature, signatureRequestSendRequest.isQualifiedSignature) + && Objects.equals(this.isEid, signatureRequestSendRequest.isEid) + && Objects.equals(this.message, signatureRequestSendRequest.message) + && Objects.equals(this.metadata, signatureRequestSendRequest.metadata) + && Objects.equals(this.signingOptions, signatureRequestSendRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, signatureRequestSendRequest.signingRedirectUrl) + && Objects.equals(this.subject, signatureRequestSendRequest.subject) + && Objects.equals(this.testMode, signatureRequestSendRequest.testMode) + && Objects.equals(this.title, signatureRequestSendRequest.title) + && Objects.equals(this.useTextTags, signatureRequestSendRequest.useTextTags) + && Objects.equals(this.expiresAt, signatureRequestSendRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + files, + fileUrls, + signers, + groupedSigners, + allowDecline, + allowReassign, + attachments, + ccEmailAddresses, + clientId, + customFields, + fieldOptions, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + isQualifiedSignature, + isEid, + message, + metadata, + signingOptions, + signingRedirectUrl, + subject, + testMode, + title, + useTextTags, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestSendRequest {\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" groupedSigners: ").append(toIndentedString(groupedSigners)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" isQualifiedSignature: ") + .append(toIndentedString(isQualifiedSignature)) + .append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (groupedSigners != null) { + if (isFileTypeOrListOfFiles(groupedSigners)) { + fileTypeFound = true; + } + + if (groupedSigners.getClass().equals(java.io.File.class) + || groupedSigners.getClass().equals(Integer.class) + || groupedSigners.getClass().equals(String.class) + || groupedSigners.getClass().isEnum()) { + map.put("grouped_signers", groupedSigners); + } else if (isListOfFile(groupedSigners)) { + for (int i = 0; i < getListSize(groupedSigners); i++) { + map.put("grouped_signers[" + i + "]", getFromList(groupedSigners, i)); + } + } else { + map.put( + "grouped_signers", + JSON.getDefault().getMapper().writeValueAsString(groupedSigners)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (isQualifiedSignature != null) { + if (isFileTypeOrListOfFiles(isQualifiedSignature)) { + fileTypeFound = true; + } + + if (isQualifiedSignature.getClass().equals(java.io.File.class) + || isQualifiedSignature.getClass().equals(Integer.class) + || isQualifiedSignature.getClass().equals(String.class) + || isQualifiedSignature.getClass().isEnum()) { + map.put("is_qualified_signature", isQualifiedSignature); + } else if (isListOfFile(isQualifiedSignature)) { + for (int i = 0; i < getListSize(isQualifiedSignature); i++) { + map.put( + "is_qualified_signature[" + i + "]", + getFromList(isQualifiedSignature, i)); + } + } else { + map.put( + "is_qualified_signature", + JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) + || isEid.getClass().equals(Integer.class) + || isEid.getClass().equals(String.class) + || isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for (int i = 0; i < getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java index a95c44e..f8ae12a 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestSendWithTemplateRequest.java @@ -10,1039 +10,1038 @@ * 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.SubCC; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; -import com.dropbox.sign.model.SubSigningOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * - */ +/** */ @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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestSendWithTemplateRequest { - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = new ArrayList<>(); + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + 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 = null; + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + 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 = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + 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_QUALIFIED_SIGNATURE = "is_qualified_signature"; + @Deprecated private Boolean isQualifiedSignature = false; - public static final String JSON_PROPERTY_IS_EID = "is_eid"; - private Boolean isEid = false; + public static final String JSON_PROPERTY_IS_EID = "is_eid"; + private Boolean isEid = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public SignatureRequestSendWithTemplateRequest() { - } + public SignatureRequestSendWithTemplateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestSendWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestSendWithTemplateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestSendWithTemplateRequest init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, SignatureRequestSendWithTemplateRequest.class); + } - static public SignatureRequestSendWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestSendWithTemplateRequest.class - ); - } + public static SignatureRequestSendWithTemplateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestSendWithTemplateRequest.class); + } - public SignatureRequestSendWithTemplateRequest templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } + public SignatureRequestSendWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } - public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { - if (this.templateIds == null) { - this.templateIds = new ArrayList<>(); + public SignatureRequestSendWithTemplateRequest addTemplateIdsItem(String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; } - 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 - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } - public List getTemplateIds() { - return templateIds; - } + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } + public SignatureRequestSendWithTemplateRequest signers( + List signers) { + this.signers = signers; + return this; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } + public SignatureRequestSendWithTemplateRequest addSignersItem( + SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); + } + this.signers.add(signersItem); + return this; + } + /** + * Add Signers to your Templated-based Signature Request. + * + * @return signers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSigners() { + return signers; + } - public SignatureRequestSendWithTemplateRequest signers(List signers) { - this.signers = signers; - return this; - } + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } - public SignatureRequestSendWithTemplateRequest addSignersItem(SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + public SignatureRequestSendWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Templated-based Signature Request. - * @return signers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public SignatureRequestSendWithTemplateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public SignatureRequestSendWithTemplateRequest ccs(List ccs) { - this.ccs = ccs; - return this; - } - - public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); - } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * @return ccs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcs() { - return ccs; - } - - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(List ccs) { - this.ccs = ccs; - } + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } - public SignatureRequestSendWithTemplateRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public SignatureRequestSendWithTemplateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } + public SignatureRequestSendWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } - public SignatureRequestSendWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public SignatureRequestSendWithTemplateRequest files(List files) { - this.files = files; - return this; - } - - public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public SignatureRequestSendWithTemplateRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - @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 - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsQualifiedSignature() { - return isQualifiedSignature; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsQualifiedSignature(Boolean isQualifiedSignature) { - this.isQualifiedSignature = isQualifiedSignature; - } - - - public SignatureRequestSendWithTemplateRequest isEid(Boolean isEid) { - this.isEid = 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 - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsEid() { - return isEid; - } - - - @JsonProperty(JSON_PROPERTY_IS_EID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEid(Boolean isEid) { - this.isEid = isEid; - } - - - public SignatureRequestSendWithTemplateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public SignatureRequestSendWithTemplateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public SignatureRequestSendWithTemplateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public SignatureRequestSendWithTemplateRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public SignatureRequestSendWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public SignatureRequestSendWithTemplateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public SignatureRequestSendWithTemplateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public SignatureRequestSendWithTemplateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - /** - * Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest = (SignatureRequestSendWithTemplateRequest) o; - return Objects.equals(this.templateIds, signatureRequestSendWithTemplateRequest.templateIds) && - Objects.equals(this.signers, signatureRequestSendWithTemplateRequest.signers) && - Objects.equals(this.allowDecline, signatureRequestSendWithTemplateRequest.allowDecline) && - Objects.equals(this.ccs, signatureRequestSendWithTemplateRequest.ccs) && - Objects.equals(this.clientId, signatureRequestSendWithTemplateRequest.clientId) && - Objects.equals(this.customFields, signatureRequestSendWithTemplateRequest.customFields) && - Objects.equals(this.files, signatureRequestSendWithTemplateRequest.files) && - Objects.equals(this.fileUrls, signatureRequestSendWithTemplateRequest.fileUrls) && - Objects.equals(this.isQualifiedSignature, signatureRequestSendWithTemplateRequest.isQualifiedSignature) && - Objects.equals(this.isEid, signatureRequestSendWithTemplateRequest.isEid) && - Objects.equals(this.message, signatureRequestSendWithTemplateRequest.message) && - Objects.equals(this.metadata, signatureRequestSendWithTemplateRequest.metadata) && - Objects.equals(this.signingOptions, signatureRequestSendWithTemplateRequest.signingOptions) && - Objects.equals(this.signingRedirectUrl, signatureRequestSendWithTemplateRequest.signingRedirectUrl) && - Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) && - Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) && - Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); - } - - @Override - public int hashCode() { - return Objects.hash(templateIds, signers, allowDecline, ccs, clientId, customFields, files, fileUrls, isQualifiedSignature, isEid, message, metadata, signingOptions, signingRedirectUrl, subject, testMode, title); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestSendWithTemplateRequest {\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" isQualifiedSignature: ").append(toIndentedString(isQualifiedSignature)).append("\n"); - sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; + public SignatureRequestSendWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); } + this.ccs.add(ccsItem); + return this; + } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + public SignatureRequestSendWithTemplateRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - if (ccs.getClass().equals(java.io.File.class) || - ccs.getClass().equals(Integer.class) || - ccs.getClass().equals(String.class) || - ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for(int i = 0; i< getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } - else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + public SignatureRequestSendWithTemplateRequest customFields(List customFields) { + this.customFields = customFields; + return this; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + public SignatureRequestSendWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + /** + * An array defining values and options for custom fields. Required when a custom field exists + * in the Template. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (isQualifiedSignature != null) { - if (isFileTypeOrListOfFiles(isQualifiedSignature)) { - fileTypeFound = true; - } - if (isQualifiedSignature.getClass().equals(java.io.File.class) || - isQualifiedSignature.getClass().equals(Integer.class) || - isQualifiedSignature.getClass().equals(String.class) || - isQualifiedSignature.getClass().isEnum()) { - map.put("is_qualified_signature", isQualifiedSignature); - } else if (isListOfFile(isQualifiedSignature)) { - for(int i = 0; i< getListSize(isQualifiedSignature); i++) { - map.put("is_qualified_signature[" + i + "]", getFromList(isQualifiedSignature, i)); - } - } - else { - map.put("is_qualified_signature", JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (isEid != null) { - if (isFileTypeOrListOfFiles(isEid)) { - fileTypeFound = true; - } - if (isEid.getClass().equals(java.io.File.class) || - isEid.getClass().equals(Integer.class) || - isEid.getClass().equals(String.class) || - isEid.getClass().isEnum()) { - map.put("is_eid", isEid); - } else if (isListOfFile(isEid)) { - for(int i = 0; i< getListSize(isEid); i++) { - map.put("is_eid[" + i + "]", getFromList(isEid, i)); - } - } - else { - map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); - } + public SignatureRequestSendWithTemplateRequest files(List files) { + this.files = files; + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + public SignatureRequestSendWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } + this.files.add(filesItem); + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + public SignatureRequestSendWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + public SignatureRequestSendWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } + this.fileUrls.add(fileUrlsItem); + return this; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + @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 @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsQualifiedSignature() { + return isQualifiedSignature; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_IS_QUALIFIED_SIGNATURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsQualifiedSignature(Boolean isQualifiedSignature) { + this.isQualifiedSignature = isQualifiedSignature; + } + + public SignatureRequestSendWithTemplateRequest isEid(Boolean isEid) { + this.isEid = isEid; + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; + + /** + * 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 @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEid() { + return isEid; + } + + @JsonProperty(JSON_PROPERTY_IS_EID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEid(Boolean isEid) { + this.isEid = isEid; + } + + public SignatureRequestSendWithTemplateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public SignatureRequestSendWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public SignatureRequestSendWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public SignatureRequestSendWithTemplateRequest signingOptions( + SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } + + public SignatureRequestSendWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public SignatureRequestSendWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public SignatureRequestSendWithTemplateRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public SignatureRequestSendWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + /** Return true if this SignatureRequestSendWithTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest = + (SignatureRequestSendWithTemplateRequest) o; + return Objects.equals(this.templateIds, signatureRequestSendWithTemplateRequest.templateIds) + && Objects.equals(this.signers, signatureRequestSendWithTemplateRequest.signers) + && Objects.equals( + this.allowDecline, signatureRequestSendWithTemplateRequest.allowDecline) + && Objects.equals(this.ccs, signatureRequestSendWithTemplateRequest.ccs) + && Objects.equals(this.clientId, signatureRequestSendWithTemplateRequest.clientId) + && Objects.equals( + this.customFields, signatureRequestSendWithTemplateRequest.customFields) + && Objects.equals(this.files, signatureRequestSendWithTemplateRequest.files) + && Objects.equals(this.fileUrls, signatureRequestSendWithTemplateRequest.fileUrls) + && Objects.equals( + this.isQualifiedSignature, + signatureRequestSendWithTemplateRequest.isQualifiedSignature) + && Objects.equals(this.isEid, signatureRequestSendWithTemplateRequest.isEid) + && Objects.equals(this.message, signatureRequestSendWithTemplateRequest.message) + && Objects.equals(this.metadata, signatureRequestSendWithTemplateRequest.metadata) + && Objects.equals( + this.signingOptions, signatureRequestSendWithTemplateRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, + signatureRequestSendWithTemplateRequest.signingRedirectUrl) + && Objects.equals(this.subject, signatureRequestSendWithTemplateRequest.subject) + && Objects.equals(this.testMode, signatureRequestSendWithTemplateRequest.testMode) + && Objects.equals(this.title, signatureRequestSendWithTemplateRequest.title); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + templateIds, + signers, + allowDecline, + ccs, + clientId, + customFields, + files, + fileUrls, + isQualifiedSignature, + isEid, + message, + metadata, + signingOptions, + signingRedirectUrl, + subject, + testMode, + title); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestSendWithTemplateRequest {\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" isQualifiedSignature: ") + .append(toIndentedString(isQualifiedSignature)) + .append("\n"); + sb.append(" isEid: ").append(toIndentedString(isEid)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (isQualifiedSignature != null) { + if (isFileTypeOrListOfFiles(isQualifiedSignature)) { + fileTypeFound = true; + } + + if (isQualifiedSignature.getClass().equals(java.io.File.class) + || isQualifiedSignature.getClass().equals(Integer.class) + || isQualifiedSignature.getClass().equals(String.class) + || isQualifiedSignature.getClass().isEnum()) { + map.put("is_qualified_signature", isQualifiedSignature); + } else if (isListOfFile(isQualifiedSignature)) { + for (int i = 0; i < getListSize(isQualifiedSignature); i++) { + map.put( + "is_qualified_signature[" + i + "]", + getFromList(isQualifiedSignature, i)); + } + } else { + map.put( + "is_qualified_signature", + JSON.getDefault().getMapper().writeValueAsString(isQualifiedSignature)); + } + } + if (isEid != null) { + if (isFileTypeOrListOfFiles(isEid)) { + fileTypeFound = true; + } + + if (isEid.getClass().equals(java.io.File.class) + || isEid.getClass().equals(Integer.class) + || isEid.getClass().equals(String.class) + || isEid.getClass().isEnum()) { + map.put("is_eid", isEid); + } else if (isListOfFile(isEid)) { + for (int i = 0; i < getListSize(isEid); i++) { + map.put("is_eid[" + i + "]", getFromList(isEid, i)); + } + } else { + map.put("is_eid", JSON.getDefault().getMapper().writeValueAsString(isEid)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java b/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java index 00e0068..348174d 100644 --- a/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/SignatureRequestUpdateRequest.java @@ -10,319 +10,309 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SignatureRequestUpdateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SignatureRequestUpdateRequest { - public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; - private String signatureId; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public SignatureRequestUpdateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SignatureRequestUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SignatureRequestUpdateRequest.class); - } - - static public SignatureRequestUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SignatureRequestUpdateRequest.class - ); - } - - public SignatureRequestUpdateRequest signatureId(String signatureId) { - this.signatureId = signatureId; - return this; - } - - /** - * The signature ID for the recipient. - * @return signatureId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getSignatureId() { - return signatureId; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignatureId(String signatureId) { - this.signatureId = signatureId; - } - - - public SignatureRequestUpdateRequest emailAddress(String emailAddress) { - this.emailAddress = 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 - @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; - } - - - public SignatureRequestUpdateRequest name(String name) { - this.name = name; - return this; - } - - /** - * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public SignatureRequestUpdateRequest expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this SignatureRequestUpdateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_SIGNATURE_ID = "signature_id"; + private String signatureId; + + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public SignatureRequestUpdateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SignatureRequestUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SignatureRequestUpdateRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SignatureRequestUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SignatureRequestUpdateRequest.class); } - SignatureRequestUpdateRequest signatureRequestUpdateRequest = (SignatureRequestUpdateRequest) o; - return Objects.equals(this.signatureId, signatureRequestUpdateRequest.signatureId) && - Objects.equals(this.emailAddress, signatureRequestUpdateRequest.emailAddress) && - Objects.equals(this.name, signatureRequestUpdateRequest.name) && - Objects.equals(this.expiresAt, signatureRequestUpdateRequest.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(signatureId, emailAddress, name, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SignatureRequestUpdateRequest {\n"); - sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureId != null) { - if (isFileTypeOrListOfFiles(signatureId)) { - fileTypeFound = true; - } - if (signatureId.getClass().equals(java.io.File.class) || - signatureId.getClass().equals(Integer.class) || - signatureId.getClass().equals(String.class) || - signatureId.getClass().isEnum()) { - map.put("signature_id", signatureId); - } else if (isListOfFile(signatureId)) { - for(int i = 0; i< getListSize(signatureId); i++) { - map.put("signature_id[" + i + "]", getFromList(signatureId, i)); - } - } - else { - map.put("signature_id", JSON.getDefault().getMapper().writeValueAsString(signatureId)); - } + public SignatureRequestUpdateRequest signatureId(String signatureId) { + this.signatureId = signatureId; + return this; } - 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)); - } + /** + * The signature ID for the recipient. + * + * @return signatureId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSignatureId() { + return signatureId; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + @JsonProperty(JSON_PROPERTY_SIGNATURE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignatureId(String signatureId) { + this.signatureId = signatureId; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + public SignatureRequestUpdateRequest emailAddress(String emailAddress) { + this.emailAddress = 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 @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; + } + + public SignatureRequestUpdateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The new name for the recipient. **NOTE:** Optional if `email_address` is provided. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public SignatureRequestUpdateRequest expiresAt(Integer expiresAt) { + this.expiresAt = 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this SignatureRequestUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + SignatureRequestUpdateRequest signatureRequestUpdateRequest = + (SignatureRequestUpdateRequest) o; + return Objects.equals(this.signatureId, signatureRequestUpdateRequest.signatureId) + && Objects.equals(this.emailAddress, signatureRequestUpdateRequest.emailAddress) + && Objects.equals(this.name, signatureRequestUpdateRequest.name) + && Objects.equals(this.expiresAt, signatureRequestUpdateRequest.expiresAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(signatureId, emailAddress, name, expiresAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignatureRequestUpdateRequest {\n"); + sb.append(" signatureId: ").append(toIndentedString(signatureId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureId != null) { + if (isFileTypeOrListOfFiles(signatureId)) { + fileTypeFound = true; + } + + if (signatureId.getClass().equals(java.io.File.class) + || signatureId.getClass().equals(Integer.class) + || signatureId.getClass().equals(String.class) + || signatureId.getClass().isEnum()) { + map.put("signature_id", signatureId); + } else if (isListOfFile(signatureId)) { + for (int i = 0; i < getListSize(signatureId); i++) { + map.put("signature_id[" + i + "]", getFromList(signatureId, i)); + } + } else { + map.put( + "signature_id", + JSON.getDefault().getMapper().writeValueAsString(signatureId)); + } + } + 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)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubAttachment.java b/src/main/java/com/dropbox/sign/model/SubAttachment.java index f8ed3c5..80a59c9 100644 --- a/src/main/java/com/dropbox/sign/model/SubAttachment.java +++ b/src/main/java/com/dropbox/sign/model/SubAttachment.java @@ -10,319 +10,303 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubAttachment - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubAttachment { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_SIGNER_INDEX = "signer_index"; - private Integer signerIndex; - - public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; - private String instructions; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required = false; - - public SubAttachment() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubAttachment init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubAttachment.class); - } - - static public SubAttachment init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubAttachment.class - ); - } - - public SubAttachment name(String name) { - this.name = name; - return this; - } - - /** - * The name of attachment. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubAttachment signerIndex(Integer signerIndex) { - this.signerIndex = 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 - @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getSignerIndex() { - return signerIndex; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignerIndex(Integer signerIndex) { - this.signerIndex = signerIndex; - } - - - public SubAttachment instructions(String instructions) { - this.instructions = instructions; - return this; - } - - /** - * The instructions for uploading the attachment. - * @return instructions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getInstructions() { - return instructions; - } - - - @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInstructions(String instructions) { - this.instructions = instructions; - } - - - public SubAttachment required(Boolean required) { - this.required = required; - return this; - } - - /** - * Determines if the attachment must be uploaded. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - /** - * Return true if this SubAttachment object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SIGNER_INDEX = "signer_index"; + private Integer signerIndex; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + private String instructions; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required = false; + + public SubAttachment() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubAttachment init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubAttachment.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SubAttachment init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubAttachment.class); } - SubAttachment subAttachment = (SubAttachment) o; - return Objects.equals(this.name, subAttachment.name) && - Objects.equals(this.signerIndex, subAttachment.signerIndex) && - Objects.equals(this.instructions, subAttachment.instructions) && - Objects.equals(this.required, subAttachment.required); - } - - @Override - public int hashCode() { - return Objects.hash(name, signerIndex, instructions, required); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubAttachment {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signerIndex: ").append(toIndentedString(signerIndex)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public SubAttachment name(String name) { + this.name = name; + return this; } - if (signerIndex != null) { - if (isFileTypeOrListOfFiles(signerIndex)) { - fileTypeFound = true; - } - if (signerIndex.getClass().equals(java.io.File.class) || - signerIndex.getClass().equals(Integer.class) || - signerIndex.getClass().equals(String.class) || - signerIndex.getClass().isEnum()) { - map.put("signer_index", signerIndex); - } else if (isListOfFile(signerIndex)) { - for(int i = 0; i< getListSize(signerIndex); i++) { - map.put("signer_index[" + i + "]", getFromList(signerIndex, i)); - } - } - else { - map.put("signer_index", JSON.getDefault().getMapper().writeValueAsString(signerIndex)); - } + /** + * The name of attachment. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - if (instructions != null) { - if (isFileTypeOrListOfFiles(instructions)) { - fileTypeFound = true; - } - if (instructions.getClass().equals(java.io.File.class) || - instructions.getClass().equals(Integer.class) || - instructions.getClass().equals(String.class) || - instructions.getClass().isEnum()) { - map.put("instructions", instructions); - } else if (isListOfFile(instructions)) { - for(int i = 0; i< getListSize(instructions); i++) { - map.put("instructions[" + i + "]", getFromList(instructions, i)); - } - } - else { - map.put("instructions", JSON.getDefault().getMapper().writeValueAsString(instructions)); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } + public SubAttachment signerIndex(Integer signerIndex) { + this.signerIndex = 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 + @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getSignerIndex() { + return signerIndex; + } + + @JsonProperty(JSON_PROPERTY_SIGNER_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignerIndex(Integer signerIndex) { + this.signerIndex = signerIndex; + } + + public SubAttachment instructions(String instructions) { + this.instructions = instructions; + return this; + } + + /** + * The instructions for uploading the attachment. + * + * @return instructions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstructions() { + return instructions; + } + + @JsonProperty(JSON_PROPERTY_INSTRUCTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(String instructions) { + this.instructions = instructions; + } + + public SubAttachment required(Boolean required) { + this.required = required; + return this; + } + + /** + * Determines if the attachment must be uploaded. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + /** Return true if this SubAttachment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubAttachment subAttachment = (SubAttachment) o; + return Objects.equals(this.name, subAttachment.name) + && Objects.equals(this.signerIndex, subAttachment.signerIndex) + && Objects.equals(this.instructions, subAttachment.instructions) + && Objects.equals(this.required, subAttachment.required); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, signerIndex, instructions, required); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubAttachment {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signerIndex: ").append(toIndentedString(signerIndex)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (signerIndex != null) { + if (isFileTypeOrListOfFiles(signerIndex)) { + fileTypeFound = true; + } + + if (signerIndex.getClass().equals(java.io.File.class) + || signerIndex.getClass().equals(Integer.class) + || signerIndex.getClass().equals(String.class) + || signerIndex.getClass().isEnum()) { + map.put("signer_index", signerIndex); + } else if (isListOfFile(signerIndex)) { + for (int i = 0; i < getListSize(signerIndex); i++) { + map.put("signer_index[" + i + "]", getFromList(signerIndex, i)); + } + } else { + map.put( + "signer_index", + JSON.getDefault().getMapper().writeValueAsString(signerIndex)); + } + } + if (instructions != null) { + if (isFileTypeOrListOfFiles(instructions)) { + fileTypeFound = true; + } + + if (instructions.getClass().equals(java.io.File.class) + || instructions.getClass().equals(Integer.class) + || instructions.getClass().equals(String.class) + || instructions.getClass().isEnum()) { + map.put("instructions", instructions); + } else if (isListOfFile(instructions)) { + for (int i = 0; i < getListSize(instructions); i++) { + map.put("instructions[" + i + "]", getFromList(instructions, i)); + } + } else { + map.put( + "instructions", + JSON.getDefault().getMapper().writeValueAsString(instructions)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java b/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java index a5eefba..e857c2e 100644 --- a/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java +++ b/src/main/java/com/dropbox/sign/model/SubBulkSignerList.java @@ -10,239 +10,226 @@ * 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.SubBulkSignerListCustomField; -import com.dropbox.sign.model.SubSignatureRequestTemplateSigner; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubBulkSignerList - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubBulkSignerList { - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = null; - - public SubBulkSignerList() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubBulkSignerList init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubBulkSignerList.class); - } - - static public SubBulkSignerList init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubBulkSignerList.class - ); - } - - public SubBulkSignerList customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array of custom field values. - * @return customFields - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public SubBulkSignerList signers(List signers) { - this.signers = signers; - return this; - } - - public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - 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 - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - - /** - * Return true if this SubBulkSignerList object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubBulkSignerList subBulkSignerList = (SubBulkSignerList) o; - return Objects.equals(this.customFields, subBulkSignerList.customFields) && - Objects.equals(this.signers, subBulkSignerList.signers); - } - - @Override - public int hashCode() { - return Objects.hash(customFields, signers); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubBulkSignerList {\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; + + public SubBulkSignerList() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubBulkSignerList init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubBulkSignerList.class); + } + + public static SubBulkSignerList init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubBulkSignerList.class); + } + + public SubBulkSignerList customFields(List customFields) { + this.customFields = customFields; + return this; + } + + public SubBulkSignerList addCustomFieldsItem(SubBulkSignerListCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of custom field values. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + public SubBulkSignerList signers(List signers) { + this.signers = signers; + return this; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; + + public SubBulkSignerList addSignersItem(SubSignatureRequestTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; + } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + /** Return true if this SubBulkSignerList object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubBulkSignerList subBulkSignerList = (SubBulkSignerList) o; + return Objects.equals(this.customFields, subBulkSignerList.customFields) + && Objects.equals(this.signers, subBulkSignerList.signers); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(customFields, signers); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubBulkSignerList {\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java b/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java index 1ec2093..eb2ca9c 100644 --- a/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java +++ b/src/main/java/com/dropbox/sign/model/SubBulkSignerListCustomField.java @@ -10,219 +10,209 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubBulkSignerListCustomField - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubBulkSignerListCustomField { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SubBulkSignerListCustomField() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubBulkSignerListCustomField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubBulkSignerListCustomField.class); - } - - static public SubBulkSignerListCustomField init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubBulkSignerListCustomField.class - ); - } - - public SubBulkSignerListCustomField name(String name) { - this.name = name; - return this; - } - - /** - * The name of the custom field. Must be the field's `name` or `api_id`. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubBulkSignerListCustomField value(String value) { - this.value = value; - return this; - } - - /** - * The value of the custom field. - * @return value - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SubBulkSignerListCustomField object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubBulkSignerListCustomField subBulkSignerListCustomField = (SubBulkSignerListCustomField) o; - return Objects.equals(this.name, subBulkSignerListCustomField.name) && - Objects.equals(this.value, subBulkSignerListCustomField.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubBulkSignerListCustomField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SubBulkSignerListCustomField() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubBulkSignerListCustomField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubBulkSignerListCustomField.class); } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public static SubBulkSignerListCustomField init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubBulkSignerListCustomField.class); + } + + public SubBulkSignerListCustomField name(String name) { + this.name = name; + return this; + } + + /** + * The name of the custom field. Must be the field's `name` or `api_id`. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public SubBulkSignerListCustomField value(String value) { + this.value = value; + return this; + } + + /** + * The value of the custom field. + * + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SubBulkSignerListCustomField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubBulkSignerListCustomField subBulkSignerListCustomField = + (SubBulkSignerListCustomField) o; + return Objects.equals(this.name, subBulkSignerListCustomField.name) + && Objects.equals(this.value, subBulkSignerListCustomField.value); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, value); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubBulkSignerListCustomField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubCC.java b/src/main/java/com/dropbox/sign/model/SubCC.java index a78f7c2..e848082 100644 --- a/src/main/java/com/dropbox/sign/model/SubCC.java +++ b/src/main/java/com/dropbox/sign/model/SubCC.java @@ -10,219 +10,206 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubCC - */ -@JsonPropertyOrder({ - 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) +/** SubCC */ +@JsonPropertyOrder({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) public class SubCC { - public static final String JSON_PROPERTY_ROLE = "role"; - private String role; - - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public SubCC() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubCC init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubCC.class); - } - - static public SubCC init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubCC.class - ); - } - - public SubCC role(String role) { - this.role = 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 - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getRole() { - return role; - } - - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(String role) { - this.role = role; - } - - - public SubCC emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the CC recipient. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - /** - * Return true if this SubCC object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubCC subCC = (SubCC) o; - return Objects.equals(this.role, subCC.role) && - Objects.equals(this.emailAddress, subCC.emailAddress); - } - - @Override - public int hashCode() { - return Objects.hash(role, emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubCC {\n"); - sb.append(" role: ").append(toIndentedString(role)).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 (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public SubCC() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubCC init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubCC.class); } - 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)); - } + public static SubCC init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubCC.class); + } + + public SubCC role(String role) { + this.role = 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 + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRole() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(String role) { + this.role = role; + } + + public SubCC emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * The email address of the CC recipient. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; + } + + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + /** Return true if this SubCC object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubCC subCC = (SubCC) o; + return Objects.equals(this.role, subCC.role) + && Objects.equals(this.emailAddress, subCC.emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(role, emailAddress); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubCC {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubCustomField.java b/src/main/java/com/dropbox/sign/model/SubCustomField.java index 322ceda..a9a7d92 100644 --- a/src/main/java/com/dropbox/sign/model/SubCustomField.java +++ b/src/main/java/com/dropbox/sign/model/SubCustomField.java @@ -10,319 +10,316 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubCustomField { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_EDITOR = "editor"; - private String editor; - - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required = false; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public SubCustomField() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubCustomField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubCustomField.class); - } - - static public SubCustomField init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubCustomField.class - ); - } - - public SubCustomField name(String name) { - this.name = 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 - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubCustomField editor(String editor) { - this.editor = 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 - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEditor() { - return editor; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditor(String editor) { - this.editor = editor; - } - - - public SubCustomField required(Boolean required) { - this.required = 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 - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public SubCustomField value(String value) { - this.value = 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 - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - /** - * Return true if this SubCustomField object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_EDITOR = "editor"; + private String editor; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public SubCustomField() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubCustomField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubCustomField.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SubCustomField init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubCustomField.class); } - SubCustomField subCustomField = (SubCustomField) o; - return Objects.equals(this.name, subCustomField.name) && - Objects.equals(this.editor, subCustomField.editor) && - Objects.equals(this.required, subCustomField.required) && - Objects.equals(this.value, subCustomField.value); - } - - @Override - public int hashCode() { - return Objects.hash(name, editor, required, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubCustomField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public SubCustomField name(String name) { + this.name = name; + return this; } - if (editor != null) { - if (isFileTypeOrListOfFiles(editor)) { - fileTypeFound = true; - } - if (editor.getClass().equals(java.io.File.class) || - editor.getClass().equals(Integer.class) || - editor.getClass().equals(String.class) || - editor.getClass().isEnum()) { - map.put("editor", editor); - } else if (isListOfFile(editor)) { - for(int i = 0; i< getListSize(editor); i++) { - map.put("editor[" + i + "]", getFromList(editor, i)); - } - } - else { - map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } + public SubCustomField editor(String editor) { + this.editor = 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 @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEditor() { + return editor; + } + + @JsonProperty(JSON_PROPERTY_EDITOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditor(String editor) { + this.editor = editor; + } + + public SubCustomField required(Boolean required) { + this.required = 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 @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public SubCustomField value(String value) { + this.value = 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 @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + /** Return true if this SubCustomField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubCustomField subCustomField = (SubCustomField) o; + return Objects.equals(this.name, subCustomField.name) + && Objects.equals(this.editor, subCustomField.editor) + && Objects.equals(this.required, subCustomField.required) + && Objects.equals(this.value, subCustomField.value); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, editor, required, value); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubCustomField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" editor: ").append(toIndentedString(editor)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (editor != null) { + if (isFileTypeOrListOfFiles(editor)) { + fileTypeFound = true; + } + + if (editor.getClass().equals(java.io.File.class) + || editor.getClass().equals(Integer.class) + || editor.getClass().equals(String.class) + || editor.getClass().isEnum()) { + map.put("editor", editor); + } else if (isListOfFile(editor)) { + for (int i = 0; i < getListSize(editor); i++) { + map.put("editor[" + i + "]", getFromList(editor, i)); + } + } else { + map.put("editor", JSON.getDefault().getMapper().writeValueAsString(editor)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubEditorOptions.java b/src/main/java/com/dropbox/sign/model/SubEditorOptions.java index f310890..6005ad4 100644 --- a/src/main/java/com/dropbox/sign/model/SubEditorOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubEditorOptions.java @@ -10,219 +10,212 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This allows the requester to specify editor options when a preparing a document - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubEditorOptions { - public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; - private Boolean allowEditSigners = false; - - public static final String JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS = "allow_edit_documents"; - private Boolean allowEditDocuments = false; - - public SubEditorOptions() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubEditorOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubEditorOptions.class); - } - - static public SubEditorOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubEditorOptions.class - ); - } - - public SubEditorOptions allowEditSigners(Boolean allowEditSigners) { - this.allowEditSigners = allowEditSigners; - return this; - } - - /** - * Allows requesters to edit the list of signers - * @return allowEditSigners - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowEditSigners() { - return allowEditSigners; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditSigners(Boolean allowEditSigners) { - this.allowEditSigners = allowEditSigners; - } - - - public SubEditorOptions allowEditDocuments(Boolean allowEditDocuments) { - this.allowEditDocuments = allowEditDocuments; - return this; - } - - /** - * Allows requesters to edit documents, including delete and add - * @return allowEditDocuments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowEditDocuments() { - return allowEditDocuments; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowEditDocuments(Boolean allowEditDocuments) { - this.allowEditDocuments = allowEditDocuments; - } - - - /** - * Return true if this SubEditorOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubEditorOptions subEditorOptions = (SubEditorOptions) o; - return Objects.equals(this.allowEditSigners, subEditorOptions.allowEditSigners) && - Objects.equals(this.allowEditDocuments, subEditorOptions.allowEditDocuments); - } - - @Override - public int hashCode() { - return Objects.hash(allowEditSigners, allowEditDocuments); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubEditorOptions {\n"); - sb.append(" allowEditSigners: ").append(toIndentedString(allowEditSigners)).append("\n"); - sb.append(" allowEditDocuments: ").append(toIndentedString(allowEditDocuments)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (allowEditSigners != null) { - if (isFileTypeOrListOfFiles(allowEditSigners)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ALLOW_EDIT_SIGNERS = "allow_edit_signers"; + private Boolean allowEditSigners = false; - if (allowEditSigners.getClass().equals(java.io.File.class) || - allowEditSigners.getClass().equals(Integer.class) || - allowEditSigners.getClass().equals(String.class) || - allowEditSigners.getClass().isEnum()) { - map.put("allow_edit_signers", allowEditSigners); - } else if (isListOfFile(allowEditSigners)) { - for(int i = 0; i< getListSize(allowEditSigners); i++) { - map.put("allow_edit_signers[" + i + "]", getFromList(allowEditSigners, i)); - } - } - else { - map.put("allow_edit_signers", JSON.getDefault().getMapper().writeValueAsString(allowEditSigners)); - } + public static final String JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS = "allow_edit_documents"; + private Boolean allowEditDocuments = false; + + public SubEditorOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubEditorOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubEditorOptions.class); } - if (allowEditDocuments != null) { - if (isFileTypeOrListOfFiles(allowEditDocuments)) { - fileTypeFound = true; - } - if (allowEditDocuments.getClass().equals(java.io.File.class) || - allowEditDocuments.getClass().equals(Integer.class) || - allowEditDocuments.getClass().equals(String.class) || - allowEditDocuments.getClass().isEnum()) { - map.put("allow_edit_documents", allowEditDocuments); - } else if (isListOfFile(allowEditDocuments)) { - for(int i = 0; i< getListSize(allowEditDocuments); i++) { - map.put("allow_edit_documents[" + i + "]", getFromList(allowEditDocuments, i)); - } + public static SubEditorOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubEditorOptions.class); + } + + public SubEditorOptions allowEditSigners(Boolean allowEditSigners) { + this.allowEditSigners = allowEditSigners; + return this; + } + + /** + * Allows requesters to edit the list of signers + * + * @return allowEditSigners + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowEditSigners() { + return allowEditSigners; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditSigners(Boolean allowEditSigners) { + this.allowEditSigners = allowEditSigners; + } + + public SubEditorOptions allowEditDocuments(Boolean allowEditDocuments) { + this.allowEditDocuments = allowEditDocuments; + return this; + } + + /** + * Allows requesters to edit documents, including delete and add + * + * @return allowEditDocuments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowEditDocuments() { + return allowEditDocuments; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_EDIT_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowEditDocuments(Boolean allowEditDocuments) { + this.allowEditDocuments = allowEditDocuments; + } + + /** Return true if this SubEditorOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("allow_edit_documents", JSON.getDefault().getMapper().writeValueAsString(allowEditDocuments)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubEditorOptions subEditorOptions = (SubEditorOptions) o; + return Objects.equals(this.allowEditSigners, subEditorOptions.allowEditSigners) + && Objects.equals(this.allowEditDocuments, subEditorOptions.allowEditDocuments); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(allowEditSigners, allowEditDocuments); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubEditorOptions {\n"); + sb.append(" allowEditSigners: ").append(toIndentedString(allowEditSigners)).append("\n"); + sb.append(" allowEditDocuments: ") + .append(toIndentedString(allowEditDocuments)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (allowEditSigners != null) { + if (isFileTypeOrListOfFiles(allowEditSigners)) { + fileTypeFound = true; + } + + if (allowEditSigners.getClass().equals(java.io.File.class) + || allowEditSigners.getClass().equals(Integer.class) + || allowEditSigners.getClass().equals(String.class) + || allowEditSigners.getClass().isEnum()) { + map.put("allow_edit_signers", allowEditSigners); + } else if (isListOfFile(allowEditSigners)) { + for (int i = 0; i < getListSize(allowEditSigners); i++) { + map.put("allow_edit_signers[" + i + "]", getFromList(allowEditSigners, i)); + } + } else { + map.put( + "allow_edit_signers", + JSON.getDefault().getMapper().writeValueAsString(allowEditSigners)); + } + } + if (allowEditDocuments != null) { + if (isFileTypeOrListOfFiles(allowEditDocuments)) { + fileTypeFound = true; + } + + if (allowEditDocuments.getClass().equals(java.io.File.class) + || allowEditDocuments.getClass().equals(Integer.class) + || allowEditDocuments.getClass().equals(String.class) + || allowEditDocuments.getClass().isEnum()) { + map.put("allow_edit_documents", allowEditDocuments); + } else if (isListOfFile(allowEditDocuments)) { + for (int i = 0; i < getListSize(allowEditDocuments); i++) { + map.put( + "allow_edit_documents[" + i + "]", + getFromList(allowEditDocuments, i)); + } + } else { + map.put( + "allow_edit_documents", + JSON.getDefault().getMapper().writeValueAsString(allowEditDocuments)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFieldOptions.java b/src/main/java/com/dropbox/sign/model/SubFieldOptions.java index 0d41133..80dabcc 100644 --- a/src/main/java/com/dropbox/sign/model/SubFieldOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubFieldOptions.java @@ -10,212 +10,208 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This allows the requester to specify field options for a signature request. - */ -@JsonPropertyOrder({ - SubFieldOptions.JSON_PROPERTY_DATE_FORMAT -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** This allows the requester to specify field options for a signature request. */ +@JsonPropertyOrder({SubFieldOptions.JSON_PROPERTY_DATE_FORMAT}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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. - */ - public enum DateFormatEnum { - 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"); + /** + * Allows requester to specify the date format (see list of allowed + * [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and + * higher. + */ + public enum DateFormatEnum { + MMDDYYYY("MM / DD / YYYY"), - private String value; + MM_DD_YYYY("MM - DD - YYYY"), - DateFormatEnum(String value) { - this.value = value; - } + DDMMYYYY("DD / MM / YYYY"), - @JsonValue - public String getValue() { - return value; - } + DD_MM_YYYY("DD - MM - YYYY"), - @Override - public String toString() { - return String.valueOf(value); - } + YYYYMMDD("YYYY / MM / DD"), - @JsonCreator - public static DateFormatEnum fromValue(String value) { - for (DateFormatEnum b : DateFormatEnum.values()) { - if (b.value.equals(value)) { - return b; + YYYY_MM_DD("YYYY - MM - DD"); + + private String value; + + DateFormatEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_DATE_FORMAT = "date_format"; - private DateFormatEnum dateFormat; - - public SubFieldOptions() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFieldOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFieldOptions.class); - } - - static public SubFieldOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFieldOptions.class - ); - } - - public SubFieldOptions dateFormat(DateFormatEnum dateFormat) { - this.dateFormat = 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 - @JsonProperty(JSON_PROPERTY_DATE_FORMAT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public DateFormatEnum getDateFormat() { - return dateFormat; - } - - - @JsonProperty(JSON_PROPERTY_DATE_FORMAT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDateFormat(DateFormatEnum dateFormat) { - this.dateFormat = dateFormat; - } - - - /** - * Return true if this SubFieldOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFieldOptions subFieldOptions = (SubFieldOptions) o; - return Objects.equals(this.dateFormat, subFieldOptions.dateFormat); - } - - @Override - public int hashCode() { - return Objects.hash(dateFormat); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFieldOptions {\n"); - sb.append(" dateFormat: ").append(toIndentedString(dateFormat)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (dateFormat != null) { - if (isFileTypeOrListOfFiles(dateFormat)) { - fileTypeFound = true; + + @JsonValue + public String getValue() { + return value; } - if (dateFormat.getClass().equals(java.io.File.class) || - dateFormat.getClass().equals(Integer.class) || - dateFormat.getClass().equals(String.class) || - dateFormat.getClass().isEnum()) { - map.put("date_format", dateFormat); - } else if (isListOfFile(dateFormat)) { - for(int i = 0; i< getListSize(dateFormat); i++) { - map.put("date_format[" + i + "]", getFromList(dateFormat, i)); + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DateFormatEnum fromValue(String value) { + for (DateFormatEnum b : DateFormatEnum.values()) { + if (b.value.equals(value)) { + return b; + } } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - else { - map.put("date_format", JSON.getDefault().getMapper().writeValueAsString(dateFormat)); + } + + public static final String JSON_PROPERTY_DATE_FORMAT = "date_format"; + private DateFormatEnum dateFormat; + + public SubFieldOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFieldOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFieldOptions.class); + } + + public static SubFieldOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubFieldOptions.class); + } + + public SubFieldOptions dateFormat(DateFormatEnum dateFormat) { + this.dateFormat = 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 + @JsonProperty(JSON_PROPERTY_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DateFormatEnum getDateFormat() { + return dateFormat; + } + + @JsonProperty(JSON_PROPERTY_DATE_FORMAT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDateFormat(DateFormatEnum dateFormat) { + this.dateFormat = dateFormat; + } + + /** Return true if this SubFieldOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + SubFieldOptions subFieldOptions = (SubFieldOptions) o; + return Objects.equals(this.dateFormat, subFieldOptions.dateFormat); + } + + @Override + public int hashCode() { + return Objects.hash(dateFormat); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFieldOptions {\n"); + sb.append(" dateFormat: ").append(toIndentedString(dateFormat)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (dateFormat != null) { + if (isFileTypeOrListOfFiles(dateFormat)) { + fileTypeFound = true; + } + + if (dateFormat.getClass().equals(java.io.File.class) + || dateFormat.getClass().equals(Integer.class) + || dateFormat.getClass().equals(String.class) + || dateFormat.getClass().isEnum()) { + map.put("date_format", dateFormat); + } else if (isListOfFile(dateFormat)) { + for (int i = 0; i < getListSize(dateFormat); i++) { + map.put("date_format[" + i + "]", getFromList(dateFormat, i)); + } + } else { + map.put( + "date_format", + JSON.getDefault().getMapper().writeValueAsString(dateFormat)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java b/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java index a061d9c..c4772c3 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldGroup.java @@ -10,269 +10,263 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubFormFieldGroup - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubFormFieldGroup { - public static final String JSON_PROPERTY_GROUP_ID = "group_id"; - private String groupId; - - public static final String JSON_PROPERTY_GROUP_LABEL = "group_label"; - private String groupLabel; + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + private String groupId; - public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; - private String requirement; + public static final String JSON_PROPERTY_GROUP_LABEL = "group_label"; + private String groupLabel; - public SubFormFieldGroup() { - } + public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; + private String requirement; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldGroup init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldGroup.class); - } + public SubFormFieldGroup() {} - static public SubFormFieldGroup init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldGroup.class - ); - } - - public SubFormFieldGroup groupId(String groupId) { - this.groupId = 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 - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGroupId() { - return groupId; - } - - - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - - public SubFormFieldGroup groupLabel(String groupLabel) { - this.groupLabel = groupLabel; - return this; - } - - /** - * Name of the group - * @return groupLabel - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGroupLabel() { - return groupLabel; - } - - - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroupLabel(String groupLabel) { - this.groupLabel = groupLabel; - } - - - public SubFormFieldGroup requirement(String requirement) { - this.requirement = 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 - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldGroup init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldGroup.class); + } - public String getRequirement() { - return requirement; - } + public static SubFormFieldGroup init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubFormFieldGroup.class); + } + public SubFormFieldGroup groupId(String groupId) { + this.groupId = groupId; + return this; + } - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequirement(String requirement) { - this.requirement = requirement; - } + /** + * ID of group. Use this to reference a specific group from the `group` value in + * `form_fields_per_document`. + * + * @return groupId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroupId() { + return groupId; + } + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroupId(String groupId) { + this.groupId = groupId; + } - /** - * Return true if this SubFormFieldGroup object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public SubFormFieldGroup groupLabel(String groupLabel) { + this.groupLabel = groupLabel; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Name of the group + * + * @return groupLabel + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroupLabel() { + return groupLabel; } - SubFormFieldGroup subFormFieldGroup = (SubFormFieldGroup) o; - return Objects.equals(this.groupId, subFormFieldGroup.groupId) && - Objects.equals(this.groupLabel, subFormFieldGroup.groupLabel) && - Objects.equals(this.requirement, subFormFieldGroup.requirement); - } - @Override - public int hashCode() { - return Objects.hash(groupId, groupLabel, requirement); - } + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroupLabel(String groupLabel) { + this.groupLabel = groupLabel; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldGroup {\n"); - sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); - sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); - sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public SubFormFieldGroup requirement(String requirement) { + this.requirement = requirement; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (groupId != null) { - if (isFileTypeOrListOfFiles(groupId)) { - fileTypeFound = true; - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRequirement() { + return requirement; + } - if (groupId.getClass().equals(java.io.File.class) || - groupId.getClass().equals(Integer.class) || - groupId.getClass().equals(String.class) || - groupId.getClass().isEnum()) { - map.put("group_id", groupId); - } else if (isListOfFile(groupId)) { - for(int i = 0; i< getListSize(groupId); i++) { - map.put("group_id[" + i + "]", getFromList(groupId, i)); - } - } - else { - map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); - } + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequirement(String requirement) { + this.requirement = requirement; } - if (groupLabel != null) { - if (isFileTypeOrListOfFiles(groupLabel)) { - fileTypeFound = true; - } - if (groupLabel.getClass().equals(java.io.File.class) || - groupLabel.getClass().equals(Integer.class) || - groupLabel.getClass().equals(String.class) || - groupLabel.getClass().isEnum()) { - map.put("group_label", groupLabel); - } else if (isListOfFile(groupLabel)) { - for(int i = 0; i< getListSize(groupLabel); i++) { - map.put("group_label[" + i + "]", getFromList(groupLabel, i)); - } + /** Return true if this SubFormFieldGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("group_label", JSON.getDefault().getMapper().writeValueAsString(groupLabel)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldGroup subFormFieldGroup = (SubFormFieldGroup) o; + return Objects.equals(this.groupId, subFormFieldGroup.groupId) + && Objects.equals(this.groupLabel, subFormFieldGroup.groupLabel) + && Objects.equals(this.requirement, subFormFieldGroup.requirement); } - if (requirement != null) { - if (isFileTypeOrListOfFiles(requirement)) { - fileTypeFound = true; - } - if (requirement.getClass().equals(java.io.File.class) || - requirement.getClass().equals(Integer.class) || - requirement.getClass().equals(String.class) || - requirement.getClass().isEnum()) { - map.put("requirement", requirement); - } else if (isListOfFile(requirement)) { - for(int i = 0; i< getListSize(requirement); i++) { - map.put("requirement[" + i + "]", getFromList(requirement, i)); - } - } - else { - map.put("requirement", JSON.getDefault().getMapper().writeValueAsString(requirement)); - } + @Override + public int hashCode() { + return Objects.hash(groupId, groupLabel, requirement); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldGroup {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); + sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (groupId != null) { + if (isFileTypeOrListOfFiles(groupId)) { + fileTypeFound = true; + } + + if (groupId.getClass().equals(java.io.File.class) + || groupId.getClass().equals(Integer.class) + || groupId.getClass().equals(String.class) + || groupId.getClass().isEnum()) { + map.put("group_id", groupId); + } else if (isListOfFile(groupId)) { + for (int i = 0; i < getListSize(groupId); i++) { + map.put("group_id[" + i + "]", getFromList(groupId, i)); + } + } else { + map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); + } + } + if (groupLabel != null) { + if (isFileTypeOrListOfFiles(groupLabel)) { + fileTypeFound = true; + } + + if (groupLabel.getClass().equals(java.io.File.class) + || groupLabel.getClass().equals(Integer.class) + || groupLabel.getClass().equals(String.class) + || groupLabel.getClass().isEnum()) { + map.put("group_label", groupLabel); + } else if (isListOfFile(groupLabel)) { + for (int i = 0; i < getListSize(groupLabel); i++) { + map.put("group_label[" + i + "]", getFromList(groupLabel, i)); + } + } else { + map.put( + "group_label", + JSON.getDefault().getMapper().writeValueAsString(groupLabel)); + } + } + if (requirement != null) { + if (isFileTypeOrListOfFiles(requirement)) { + fileTypeFound = true; + } + + if (requirement.getClass().equals(java.io.File.class) + || requirement.getClass().equals(Integer.class) + || requirement.getClass().equals(String.class) + || requirement.getClass().isEnum()) { + map.put("requirement", requirement); + } else if (isListOfFile(requirement)) { + for (int i = 0; i < getListSize(requirement); i++) { + map.put("requirement[" + i + "]", getFromList(requirement, i)); + } + } else { + map.put( + "requirement", + JSON.getDefault().getMapper().writeValueAsString(requirement)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java index 5b3be6a..95a8165 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRule.java @@ -10,339 +10,322 @@ * 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.SubFormFieldRuleAction; -import com.dropbox.sign.model.SubFormFieldRuleTrigger; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubFormFieldRule - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubFormFieldRule { - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_TRIGGER_OPERATOR = "trigger_operator"; - private String triggerOperator = "AND"; - - public static final String JSON_PROPERTY_TRIGGERS = "triggers"; - private List triggers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ACTIONS = "actions"; - private List actions = new ArrayList<>(); - - public SubFormFieldRule() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldRule init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRule.class); - } - - static public SubFormFieldRule init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldRule.class - ); - } - - public SubFormFieldRule id(String id) { - this.id = id; - return this; - } - - /** - * Must be unique across all defined rules. - * @return id - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(String id) { - this.id = id; - } - - - public SubFormFieldRule triggerOperator(String triggerOperator) { - this.triggerOperator = triggerOperator; - return this; - } - - /** - * Currently only `AND` is supported. Support for `OR` is being worked on. - * @return triggerOperator - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTriggerOperator() { - return triggerOperator; - } - - - @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriggerOperator(String triggerOperator) { - this.triggerOperator = triggerOperator; - } - - - public SubFormFieldRule triggers(List triggers) { - this.triggers = triggers; - return this; - } - - public SubFormFieldRule addTriggersItem(SubFormFieldRuleTrigger triggersItem) { - if (this.triggers == null) { - this.triggers = new ArrayList<>(); + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TRIGGER_OPERATOR = "trigger_operator"; + private String triggerOperator = "AND"; + + public static final String JSON_PROPERTY_TRIGGERS = "triggers"; + private List triggers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ACTIONS = "actions"; + private List actions = new ArrayList<>(); + + public SubFormFieldRule() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldRule init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRule.class); } - 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 - @JsonProperty(JSON_PROPERTY_TRIGGERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getTriggers() { - return triggers; - } - - - @JsonProperty(JSON_PROPERTY_TRIGGERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriggers(List triggers) { - this.triggers = triggers; - } - - - public SubFormFieldRule actions(List actions) { - this.actions = actions; - return this; - } - - public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { - if (this.actions == null) { - this.actions = new ArrayList<>(); + + public static SubFormFieldRule init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubFormFieldRule.class); } - 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 - @JsonProperty(JSON_PROPERTY_ACTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getActions() { - return actions; - } - - - @JsonProperty(JSON_PROPERTY_ACTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setActions(List actions) { - this.actions = actions; - } - - - /** - * Return true if this SubFormFieldRule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public SubFormFieldRule id(String id) { + this.id = id; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Must be unique across all defined rules. + * + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; } - SubFormFieldRule subFormFieldRule = (SubFormFieldRule) o; - return Objects.equals(this.id, subFormFieldRule.id) && - Objects.equals(this.triggerOperator, subFormFieldRule.triggerOperator) && - Objects.equals(this.triggers, subFormFieldRule.triggers) && - Objects.equals(this.actions, subFormFieldRule.actions); - } - - @Override - public int hashCode() { - return Objects.hash(id, triggerOperator, triggers, actions); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRule {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" triggerOperator: ").append(toIndentedString(triggerOperator)).append("\n"); - sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); - sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } - if (id.getClass().equals(java.io.File.class) || - id.getClass().equals(Integer.class) || - id.getClass().equals(String.class) || - id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for(int i = 0; i< getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } - else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; } - if (triggerOperator != null) { - if (isFileTypeOrListOfFiles(triggerOperator)) { - fileTypeFound = true; - } - if (triggerOperator.getClass().equals(java.io.File.class) || - triggerOperator.getClass().equals(Integer.class) || - triggerOperator.getClass().equals(String.class) || - triggerOperator.getClass().isEnum()) { - map.put("trigger_operator", triggerOperator); - } else if (isListOfFile(triggerOperator)) { - for(int i = 0; i< getListSize(triggerOperator); i++) { - map.put("trigger_operator[" + i + "]", getFromList(triggerOperator, i)); - } - } - else { - map.put("trigger_operator", JSON.getDefault().getMapper().writeValueAsString(triggerOperator)); - } + public SubFormFieldRule triggerOperator(String triggerOperator) { + this.triggerOperator = triggerOperator; + return this; } - if (triggers != null) { - if (isFileTypeOrListOfFiles(triggers)) { - fileTypeFound = true; - } - if (triggers.getClass().equals(java.io.File.class) || - triggers.getClass().equals(Integer.class) || - triggers.getClass().equals(String.class) || - triggers.getClass().isEnum()) { - map.put("triggers", triggers); - } else if (isListOfFile(triggers)) { - for(int i = 0; i< getListSize(triggers); i++) { - map.put("triggers[" + i + "]", getFromList(triggers, i)); - } - } - else { - map.put("triggers", JSON.getDefault().getMapper().writeValueAsString(triggers)); + /** + * Currently only `AND` is supported. Support for `OR` is being worked on. + * + * @return triggerOperator + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriggerOperator() { + return triggerOperator; + } + + @JsonProperty(JSON_PROPERTY_TRIGGER_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriggerOperator(String triggerOperator) { + this.triggerOperator = triggerOperator; + } + + public SubFormFieldRule triggers(List triggers) { + this.triggers = triggers; + return this; + } + + 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 + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTriggers() { + return triggers; } - if (actions != null) { - if (isFileTypeOrListOfFiles(actions)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriggers(List triggers) { + this.triggers = triggers; + } + + public SubFormFieldRule actions(List actions) { + this.actions = actions; + return this; + } + + public SubFormFieldRule addActionsItem(SubFormFieldRuleAction actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); } + this.actions.add(actionsItem); + return this; + } - if (actions.getClass().equals(java.io.File.class) || - actions.getClass().equals(Integer.class) || - actions.getClass().equals(String.class) || - actions.getClass().isEnum()) { - map.put("actions", actions); - } else if (isListOfFile(actions)) { - for(int i = 0; i< getListSize(actions); i++) { - map.put("actions[" + i + "]", getFromList(actions, i)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getActions() { + return actions; + } + + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setActions(List actions) { + this.actions = actions; + } + + /** Return true if this SubFormFieldRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("actions", JSON.getDefault().getMapper().writeValueAsString(actions)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldRule subFormFieldRule = (SubFormFieldRule) o; + return Objects.equals(this.id, subFormFieldRule.id) + && Objects.equals(this.triggerOperator, subFormFieldRule.triggerOperator) + && Objects.equals(this.triggers, subFormFieldRule.triggers) + && Objects.equals(this.actions, subFormFieldRule.actions); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(id, triggerOperator, triggers, actions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" triggerOperator: ").append(toIndentedString(triggerOperator)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; + } + + if (id.getClass().equals(java.io.File.class) + || id.getClass().equals(Integer.class) + || id.getClass().equals(String.class) + || id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for (int i = 0; i < getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); + } + } + if (triggerOperator != null) { + if (isFileTypeOrListOfFiles(triggerOperator)) { + fileTypeFound = true; + } + + if (triggerOperator.getClass().equals(java.io.File.class) + || triggerOperator.getClass().equals(Integer.class) + || triggerOperator.getClass().equals(String.class) + || triggerOperator.getClass().isEnum()) { + map.put("trigger_operator", triggerOperator); + } else if (isListOfFile(triggerOperator)) { + for (int i = 0; i < getListSize(triggerOperator); i++) { + map.put("trigger_operator[" + i + "]", getFromList(triggerOperator, i)); + } + } else { + map.put( + "trigger_operator", + JSON.getDefault().getMapper().writeValueAsString(triggerOperator)); + } + } + if (triggers != null) { + if (isFileTypeOrListOfFiles(triggers)) { + fileTypeFound = true; + } + + if (triggers.getClass().equals(java.io.File.class) + || triggers.getClass().equals(Integer.class) + || triggers.getClass().equals(String.class) + || triggers.getClass().isEnum()) { + map.put("triggers", triggers); + } else if (isListOfFile(triggers)) { + for (int i = 0; i < getListSize(triggers); i++) { + map.put("triggers[" + i + "]", getFromList(triggers, i)); + } + } else { + map.put("triggers", JSON.getDefault().getMapper().writeValueAsString(triggers)); + } + } + if (actions != null) { + if (isFileTypeOrListOfFiles(actions)) { + fileTypeFound = true; + } + + if (actions.getClass().equals(java.io.File.class) + || actions.getClass().equals(Integer.class) + || actions.getClass().equals(String.class) + || actions.getClass().isEnum()) { + map.put("actions", actions); + } else if (isListOfFile(actions)) { + for (int i = 0; i < getListSize(actions); i++) { + map.put("actions[" + i + "]", getFromList(actions, i)); + } + } else { + map.put("actions", JSON.getDefault().getMapper().writeValueAsString(actions)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java index 23ba071..2481678 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleAction.java @@ -10,354 +10,339 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubFormFieldRuleAction - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubFormFieldRuleAction { - public static final String JSON_PROPERTY_HIDDEN = "hidden"; - private Boolean hidden; + public static final String JSON_PROPERTY_HIDDEN = "hidden"; + private Boolean hidden; + + /** Gets or Sets type */ + public enum TypeEnum { + FIELD_VISIBILITY("change-field-visibility"), + + GROUP_VISIBILITY("change-group-visibility"); - /** - * Gets or Sets type - */ - public enum TypeEnum { - FIELD_VISIBILITY("change-field-visibility"), - - GROUP_VISIBILITY("change-group-visibility"); + private String value; - private String value; + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - TypeEnum(String value) { - this.value = value; + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_FIELD_ID = "field_id"; + private String fieldId; + + public static final String JSON_PROPERTY_GROUP_ID = "group_id"; + private String groupId; + + public SubFormFieldRuleAction() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldRuleAction init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRuleAction.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubFormFieldRuleAction init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), SubFormFieldRuleAction.class); } - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubFormFieldRuleAction hidden(Boolean hidden) { + this.hidden = hidden; + return this; } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; - - public static final String JSON_PROPERTY_FIELD_ID = "field_id"; - private String fieldId; - - public static final String JSON_PROPERTY_GROUP_ID = "group_id"; - private String groupId; - - public SubFormFieldRuleAction() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldRuleAction init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRuleAction.class); - } - - static public SubFormFieldRuleAction init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldRuleAction.class - ); - } - - public SubFormFieldRuleAction hidden(Boolean hidden) { - this.hidden = hidden; - return this; - } - - /** - * `true` to hide the target field when rule is satisfied, otherwise `false`. - * @return hidden - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_HIDDEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getHidden() { - return hidden; - } - - - @JsonProperty(JSON_PROPERTY_HIDDEN) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - - public SubFormFieldRuleAction type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TypeEnum getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(TypeEnum type) { - this.type = type; - } - - - public SubFormFieldRuleAction fieldId(String fieldId) { - this.fieldId = 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 - @JsonProperty(JSON_PROPERTY_FIELD_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFieldId() { - return fieldId; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldId(String fieldId) { - this.fieldId = fieldId; - } - - - public SubFormFieldRuleAction groupId(String groupId) { - this.groupId = 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 - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroupId() { - return groupId; - } - - - @JsonProperty(JSON_PROPERTY_GROUP_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupId(String groupId) { - this.groupId = groupId; - } - - - /** - * Return true if this SubFormFieldRuleAction object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * `true` to hide the target field when rule is satisfied, otherwise + * `false`. + * + * @return hidden + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HIDDEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHidden() { + return hidden; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_HIDDEN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHidden(Boolean hidden) { + this.hidden = hidden; } - SubFormFieldRuleAction subFormFieldRuleAction = (SubFormFieldRuleAction) o; - return Objects.equals(this.hidden, subFormFieldRuleAction.hidden) && - Objects.equals(this.type, subFormFieldRuleAction.type) && - Objects.equals(this.fieldId, subFormFieldRuleAction.fieldId) && - Objects.equals(this.groupId, subFormFieldRuleAction.groupId); - } - - @Override - public int hashCode() { - return Objects.hash(hidden, type, fieldId, groupId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRuleAction {\n"); - sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); - sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (hidden != null) { - if (isFileTypeOrListOfFiles(hidden)) { - fileTypeFound = true; - } - if (hidden.getClass().equals(java.io.File.class) || - hidden.getClass().equals(Integer.class) || - hidden.getClass().equals(String.class) || - hidden.getClass().isEnum()) { - map.put("hidden", hidden); - } else if (isListOfFile(hidden)) { - for(int i = 0; i< getListSize(hidden); i++) { - map.put("hidden[" + i + "]", getFromList(hidden, i)); - } - } - else { - map.put("hidden", JSON.getDefault().getMapper().writeValueAsString(hidden)); - } + public SubFormFieldRuleAction type(TypeEnum type) { + this.type = type; + return this; } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TypeEnum getType() { + return type; } - if (fieldId != null) { - if (isFileTypeOrListOfFiles(fieldId)) { - fileTypeFound = true; - } - if (fieldId.getClass().equals(java.io.File.class) || - fieldId.getClass().equals(Integer.class) || - fieldId.getClass().equals(String.class) || - fieldId.getClass().isEnum()) { - map.put("field_id", fieldId); - } else if (isListOfFile(fieldId)) { - for(int i = 0; i< getListSize(fieldId); i++) { - map.put("field_id[" + i + "]", getFromList(fieldId, i)); - } - } - else { - map.put("field_id", JSON.getDefault().getMapper().writeValueAsString(fieldId)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; } - if (groupId != null) { - if (isFileTypeOrListOfFiles(groupId)) { - fileTypeFound = true; - } - if (groupId.getClass().equals(java.io.File.class) || - groupId.getClass().equals(Integer.class) || - groupId.getClass().equals(String.class) || - groupId.getClass().isEnum()) { - map.put("group_id", groupId); - } else if (isListOfFile(groupId)) { - for(int i = 0; i< getListSize(groupId); i++) { - map.put("group_id[" + i + "]", getFromList(groupId, i)); - } + public SubFormFieldRuleAction fieldId(String fieldId) { + this.fieldId = 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 @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFieldId() { + return fieldId; + } + + @JsonProperty(JSON_PROPERTY_FIELD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldId(String fieldId) { + this.fieldId = fieldId; + } + + public SubFormFieldRuleAction groupId(String groupId) { + this.groupId = 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 @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupId() { + return groupId; + } + + @JsonProperty(JSON_PROPERTY_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + /** Return true if this SubFormFieldRuleAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldRuleAction subFormFieldRuleAction = (SubFormFieldRuleAction) o; + return Objects.equals(this.hidden, subFormFieldRuleAction.hidden) + && Objects.equals(this.type, subFormFieldRuleAction.type) + && Objects.equals(this.fieldId, subFormFieldRuleAction.fieldId) + && Objects.equals(this.groupId, subFormFieldRuleAction.groupId); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(hidden, type, fieldId, groupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRuleAction {\n"); + sb.append(" hidden: ").append(toIndentedString(hidden)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (hidden != null) { + if (isFileTypeOrListOfFiles(hidden)) { + fileTypeFound = true; + } + + if (hidden.getClass().equals(java.io.File.class) + || hidden.getClass().equals(Integer.class) + || hidden.getClass().equals(String.class) + || hidden.getClass().isEnum()) { + map.put("hidden", hidden); + } else if (isListOfFile(hidden)) { + for (int i = 0; i < getListSize(hidden); i++) { + map.put("hidden[" + i + "]", getFromList(hidden, i)); + } + } else { + map.put("hidden", JSON.getDefault().getMapper().writeValueAsString(hidden)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (fieldId != null) { + if (isFileTypeOrListOfFiles(fieldId)) { + fileTypeFound = true; + } + + if (fieldId.getClass().equals(java.io.File.class) + || fieldId.getClass().equals(Integer.class) + || fieldId.getClass().equals(String.class) + || fieldId.getClass().isEnum()) { + map.put("field_id", fieldId); + } else if (isListOfFile(fieldId)) { + for (int i = 0; i < getListSize(fieldId); i++) { + map.put("field_id[" + i + "]", getFromList(fieldId, i)); + } + } else { + map.put("field_id", JSON.getDefault().getMapper().writeValueAsString(fieldId)); + } + } + if (groupId != null) { + if (isFileTypeOrListOfFiles(groupId)) { + fileTypeFound = true; + } + + if (groupId.getClass().equals(java.io.File.class) + || groupId.getClass().equals(Integer.class) + || groupId.getClass().equals(String.class) + || groupId.getClass().isEnum()) { + map.put("group_id", groupId); + } else if (isListOfFile(groupId)) { + for (int i = 0; i < getListSize(groupId); i++) { + map.put("group_id[" + i + "]", getFromList(groupId, i)); + } + } else { + map.put("group_id", JSON.getDefault().getMapper().writeValueAsString(groupId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java index 048ffe2..d56297a 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldRuleTrigger.java @@ -10,370 +10,373 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * SubFormFieldRuleTrigger - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubFormFieldRuleTrigger { - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - /** - * 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 - */ - public enum OperatorEnum { - ANY("any"), - - IS("is"), - - MATCH("match"), - - NONE("none"), - - NOT("not"); + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** + * 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 + */ + public enum OperatorEnum { + ANY("any"), + + IS("is"), + MATCH("match"), + + NONE("none"), + + NOT("not"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private OperatorEnum operator; + + public static final String JSON_PROPERTY_VALUE = "value"; private String value; - OperatorEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = null; + + public SubFormFieldRuleTrigger() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldRuleTrigger init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldRuleTrigger.class); } - @JsonValue - public String getValue() { - return value; + public static SubFormFieldRuleTrigger init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), SubFormFieldRuleTrigger.class); } - @Override - public String toString() { - return String.valueOf(value); + public SubFormFieldRuleTrigger id(String id) { + this.id = id; + return this; } - @JsonCreator - public static OperatorEnum fromValue(String value) { - for (OperatorEnum b : OperatorEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + 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. + * + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; } - } - - public static final String JSON_PROPERTY_OPERATOR = "operator"; - private OperatorEnum operator; - - public static final String JSON_PROPERTY_VALUE = "value"; - private String value; - - public static final String JSON_PROPERTY_VALUES = "values"; - private List values = null; - - public SubFormFieldRuleTrigger() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldRuleTrigger init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldRuleTrigger.class); - } - - static public SubFormFieldRuleTrigger init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldRuleTrigger.class - ); - } - - public SubFormFieldRuleTrigger id(String id) { - this.id = 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 - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setId(String id) { - this.id = id; - } - - - public SubFormFieldRuleTrigger operator(OperatorEnum operator) { - this.operator = 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 - @JsonProperty(JSON_PROPERTY_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public OperatorEnum getOperator() { - return operator; - } - - - @JsonProperty(JSON_PROPERTY_OPERATOR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOperator(OperatorEnum operator) { - this.operator = operator; - } - - - public SubFormFieldRuleTrigger value(String value) { - this.value = 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 - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValue(String value) { - this.value = value; - } - - - public SubFormFieldRuleTrigger values(List values) { - this.values = values; - return this; - } - - public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { - if (this.values == null) { - this.values = new ArrayList<>(); + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(String id) { + this.id = id; } - this.values.add(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 - @JsonProperty(JSON_PROPERTY_VALUES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getValues() { - return values; - } - - - @JsonProperty(JSON_PROPERTY_VALUES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValues(List values) { - this.values = values; - } - - - /** - * Return true if this SubFormFieldRuleTrigger object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public SubFormFieldRuleTrigger operator(OperatorEnum operator) { + this.operator = operator; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * 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 + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OperatorEnum getOperator() { + return operator; } - SubFormFieldRuleTrigger subFormFieldRuleTrigger = (SubFormFieldRuleTrigger) o; - return Objects.equals(this.id, subFormFieldRuleTrigger.id) && - Objects.equals(this.operator, subFormFieldRuleTrigger.operator) && - Objects.equals(this.value, subFormFieldRuleTrigger.value) && - Objects.equals(this.values, subFormFieldRuleTrigger.values); - } - - @Override - public int hashCode() { - return Objects.hash(id, operator, value, values); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldRuleTrigger {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" values: ").append(toIndentedString(values)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (id != null) { - if (isFileTypeOrListOfFiles(id)) { - fileTypeFound = true; - } - if (id.getClass().equals(java.io.File.class) || - id.getClass().equals(Integer.class) || - id.getClass().equals(String.class) || - id.getClass().isEnum()) { - map.put("id", id); - } else if (isListOfFile(id)) { - for(int i = 0; i< getListSize(id); i++) { - map.put("id[" + i + "]", getFromList(id, i)); - } - } - else { - map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); - } + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOperator(OperatorEnum operator) { + this.operator = operator; } - if (operator != null) { - if (isFileTypeOrListOfFiles(operator)) { - fileTypeFound = true; - } - if (operator.getClass().equals(java.io.File.class) || - operator.getClass().equals(Integer.class) || - operator.getClass().equals(String.class) || - operator.getClass().isEnum()) { - map.put("operator", operator); - } else if (isListOfFile(operator)) { - for(int i = 0; i< getListSize(operator); i++) { - map.put("operator[" + i + "]", getFromList(operator, i)); - } - } - else { - map.put("operator", JSON.getDefault().getMapper().writeValueAsString(operator)); - } + public SubFormFieldRuleTrigger value(String value) { + this.value = value; + return this; } - if (value != null) { - if (isFileTypeOrListOfFiles(value)) { - fileTypeFound = true; - } - if (value.getClass().equals(java.io.File.class) || - value.getClass().equals(Integer.class) || - value.getClass().equals(String.class) || - value.getClass().isEnum()) { - map.put("value", value); - } else if (isListOfFile(value)) { - for(int i = 0; i< getListSize(value); i++) { - map.put("value[" + i + "]", getFromList(value, i)); - } - } - else { - map.put("value", JSON.getDefault().getMapper().writeValueAsString(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` + * + * @return value + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + public SubFormFieldRuleTrigger values(List values) { + this.values = values; + return this; } - if (values != null) { - if (isFileTypeOrListOfFiles(values)) { - fileTypeFound = true; + + public SubFormFieldRuleTrigger addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); } + this.values.add(valuesItem); + return this; + } - if (values.getClass().equals(java.io.File.class) || - values.getClass().equals(Integer.class) || - values.getClass().equals(String.class) || - values.getClass().isEnum()) { - map.put("values", values); - } else if (isListOfFile(values)) { - for(int i = 0; i< getListSize(values); i++) { - map.put("values[" + i + "]", getFromList(values, i)); - } + /** + * **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 @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getValues() { + return values; + } + + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValues(List values) { + this.values = values; + } + + /** Return true if this SubFormFieldRuleTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("values", JSON.getDefault().getMapper().writeValueAsString(values)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldRuleTrigger subFormFieldRuleTrigger = (SubFormFieldRuleTrigger) o; + return Objects.equals(this.id, subFormFieldRuleTrigger.id) + && Objects.equals(this.operator, subFormFieldRuleTrigger.operator) + && Objects.equals(this.value, subFormFieldRuleTrigger.value) + && Objects.equals(this.values, subFormFieldRuleTrigger.values); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(id, operator, value, values); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldRuleTrigger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (id != null) { + if (isFileTypeOrListOfFiles(id)) { + fileTypeFound = true; + } + + if (id.getClass().equals(java.io.File.class) + || id.getClass().equals(Integer.class) + || id.getClass().equals(String.class) + || id.getClass().isEnum()) { + map.put("id", id); + } else if (isListOfFile(id)) { + for (int i = 0; i < getListSize(id); i++) { + map.put("id[" + i + "]", getFromList(id, i)); + } + } else { + map.put("id", JSON.getDefault().getMapper().writeValueAsString(id)); + } + } + if (operator != null) { + if (isFileTypeOrListOfFiles(operator)) { + fileTypeFound = true; + } + + if (operator.getClass().equals(java.io.File.class) + || operator.getClass().equals(Integer.class) + || operator.getClass().equals(String.class) + || operator.getClass().isEnum()) { + map.put("operator", operator); + } else if (isListOfFile(operator)) { + for (int i = 0; i < getListSize(operator); i++) { + map.put("operator[" + i + "]", getFromList(operator, i)); + } + } else { + map.put("operator", JSON.getDefault().getMapper().writeValueAsString(operator)); + } + } + if (value != null) { + if (isFileTypeOrListOfFiles(value)) { + fileTypeFound = true; + } + + if (value.getClass().equals(java.io.File.class) + || value.getClass().equals(Integer.class) + || value.getClass().equals(String.class) + || value.getClass().isEnum()) { + map.put("value", value); + } else if (isListOfFile(value)) { + for (int i = 0; i < getListSize(value); i++) { + map.put("value[" + i + "]", getFromList(value, i)); + } + } else { + map.put("value", JSON.getDefault().getMapper().writeValueAsString(value)); + } + } + if (values != null) { + if (isFileTypeOrListOfFiles(values)) { + fileTypeFound = true; + } + + if (values.getClass().equals(java.io.File.class) + || values.getClass().equals(Integer.class) + || values.getClass().equals(String.class) + || values.getClass().isEnum()) { + map.put("values", values); + } else if (isListOfFile(values)) { + for (int i = 0; i < getListSize(values); i++) { + map.put("values[" + i + "]", getFromList(values, i)); + } + } else { + map.put("values", JSON.getDefault().getMapper().writeValueAsString(values)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java index 052f989..7b985bc 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentBase.java @@ -10,713 +10,705 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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` + * 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @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 SubFormFieldsPerDocumentBase { - public static final String JSON_PROPERTY_DOCUMENT_INDEX = "document_index"; - private Integer documentIndex; + public static final String JSON_PROPERTY_DOCUMENT_INDEX = "document_index"; + private Integer documentIndex; - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; - public static final String JSON_PROPERTY_HEIGHT = "height"; - private Integer height; + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Integer height; - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - private String signer; + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_SIGNER = "signer"; + private String signer; - public static final String JSON_PROPERTY_WIDTH = "width"; - private Integer width; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_X = "x"; - private Integer x; - - public static final String JSON_PROPERTY_Y = "y"; - private Integer y; + public static final String JSON_PROPERTY_WIDTH = "width"; + private Integer width; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_X = "x"; + private Integer x; - public static final String JSON_PROPERTY_PAGE = "page"; - private Integer page; + public static final String JSON_PROPERTY_Y = "y"; + private Integer y; - public SubFormFieldsPerDocumentBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentBase.class); - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - static public SubFormFieldsPerDocumentBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentBase.class - ); - } + public static final String JSON_PROPERTY_PAGE = "page"; + private Integer page; - public SubFormFieldsPerDocumentBase documentIndex(Integer documentIndex) { - this.documentIndex = 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 - @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getDocumentIndex() { - return documentIndex; - } - - - @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDocumentIndex(Integer documentIndex) { - this.documentIndex = documentIndex; - } - - - public SubFormFieldsPerDocumentBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * An identifier for the field that is unique across all documents in the request. - * @return apiId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getApiId() { - return apiId; - } - - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - - - public SubFormFieldsPerDocumentBase height(Integer height) { - this.height = height; - return this; - } - - /** - * Size of the field in pixels. - * @return height - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getHeight() { - return height; - } - - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setHeight(Integer height) { - this.height = height; - } - - - public SubFormFieldsPerDocumentBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * Whether this field is required. - * @return required - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public SubFormFieldsPerDocumentBase signer(String signer) { - this.signer = signer; - return this; - } - public SubFormFieldsPerDocumentBase signer(Integer signer) { - this.signer = String.valueOf(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 - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getSigner() { - return signer; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigner(String signer) { - this.signer = signer; - } - - public void setSigner(Integer signer) { - this.signer = String.valueOf(signer); - } - - - public SubFormFieldsPerDocumentBase type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentBase width(Integer width) { - this.width = width; - return this; - } - - /** - * Size of the field in pixels. - * @return width - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getWidth() { - return width; - } - - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWidth(Integer width) { - this.width = width; - } - - - public SubFormFieldsPerDocumentBase x(Integer x) { - this.x = x; - return this; - } - - /** - * Location coordinates of the field in pixels. - * @return x - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getX() { - return x; - } - - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setX(Integer x) { - this.x = x; - } - - - public SubFormFieldsPerDocumentBase y(Integer y) { - this.y = y; - return this; - } - - /** - * Location coordinates of the field in pixels. - * @return y - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getY() { - return y; - } - - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setY(Integer y) { - this.y = y; - } - - - public SubFormFieldsPerDocumentBase name(String name) { - this.name = name; - return this; - } - - /** - * Display name for the field. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public SubFormFieldsPerDocumentBase page(Integer page) { - this.page = 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 - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPage() { - return page; - } - - - @JsonProperty(JSON_PROPERTY_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPage(Integer page) { - this.page = page; - } - - - /** - * Return true if this SubFormFieldsPerDocumentBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentBase subFormFieldsPerDocumentBase = (SubFormFieldsPerDocumentBase) o; - return Objects.equals(this.documentIndex, subFormFieldsPerDocumentBase.documentIndex) && - Objects.equals(this.apiId, subFormFieldsPerDocumentBase.apiId) && - Objects.equals(this.height, subFormFieldsPerDocumentBase.height) && - Objects.equals(this.required, subFormFieldsPerDocumentBase.required) && - Objects.equals(this.signer, subFormFieldsPerDocumentBase.signer) && - Objects.equals(this.type, subFormFieldsPerDocumentBase.type) && - Objects.equals(this.width, subFormFieldsPerDocumentBase.width) && - Objects.equals(this.x, subFormFieldsPerDocumentBase.x) && - Objects.equals(this.y, subFormFieldsPerDocumentBase.y) && - Objects.equals(this.name, subFormFieldsPerDocumentBase.name) && - Objects.equals(this.page, subFormFieldsPerDocumentBase.page); - } - - @Override - public int hashCode() { - return Objects.hash(documentIndex, apiId, height, required, signer, type, width, x, y, name, page); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentBase {\n"); - sb.append(" documentIndex: ").append(toIndentedString(documentIndex)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" page: ").append(toIndentedString(page)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (documentIndex != null) { - if (isFileTypeOrListOfFiles(documentIndex)) { - fileTypeFound = true; - } + public SubFormFieldsPerDocumentBase() {} - if (documentIndex.getClass().equals(java.io.File.class) || - documentIndex.getClass().equals(Integer.class) || - documentIndex.getClass().equals(String.class) || - documentIndex.getClass().isEnum()) { - map.put("document_index", documentIndex); - } else if (isListOfFile(documentIndex)) { - for(int i = 0; i< getListSize(documentIndex); i++) { - map.put("document_index[" + i + "]", getFromList(documentIndex, i)); - } - } - else { - map.put("document_index", JSON.getDefault().getMapper().writeValueAsString(documentIndex)); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentBase.class); } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + public static SubFormFieldsPerDocumentBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentBase.class); } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - if (height.getClass().equals(java.io.File.class) || - height.getClass().equals(Integer.class) || - height.getClass().equals(String.class) || - height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for(int i = 0; i< getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } - else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } + public SubFormFieldsPerDocumentBase documentIndex(Integer documentIndex) { + this.documentIndex = documentIndex; + return this; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } + /** + * Represents the integer index of the `file` or `file_url` document the + * field should be attached to. + * + * @return documentIndex + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getDocumentIndex() { + return documentIndex; } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - if (signer.getClass().equals(java.io.File.class) || - signer.getClass().equals(Integer.class) || - signer.getClass().equals(String.class) || - signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for(int i = 0; i< getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } - else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } + @JsonProperty(JSON_PROPERTY_DOCUMENT_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDocumentIndex(Integer documentIndex) { + this.documentIndex = documentIndex; } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentBase apiId(String apiId) { + this.apiId = apiId; + return this; } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - if (width.getClass().equals(java.io.File.class) || - width.getClass().equals(Integer.class) || - width.getClass().equals(String.class) || - width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for(int i = 0; i< getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } - else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } + /** + * An identifier for the field that is unique across all documents in the request. + * + * @return apiId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getApiId() { + return apiId; } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - if (x.getClass().equals(java.io.File.class) || - x.getClass().equals(Integer.class) || - x.getClass().equals(String.class) || - x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for(int i = 0; i< getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } - else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setApiId(String apiId) { + this.apiId = apiId; } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - if (y.getClass().equals(java.io.File.class) || - y.getClass().equals(Integer.class) || - y.getClass().equals(String.class) || - y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for(int i = 0; i< getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } - else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + public SubFormFieldsPerDocumentBase height(Integer height) { + this.height = height; + return this; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + /** + * Size of the field in pixels. + * + * @return height + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setHeight(Integer height) { + this.height = height; + } + + public SubFormFieldsPerDocumentBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * Whether this field is required. + * + * @return required + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRequired() { + return required; } - if (page != null) { - if (isFileTypeOrListOfFiles(page)) { - fileTypeFound = true; - } - if (page.getClass().equals(java.io.File.class) || - page.getClass().equals(Integer.class) || - page.getClass().equals(String.class) || - page.getClass().isEnum()) { - map.put("page", page); - } else if (isListOfFile(page)) { - for(int i = 0; i< getListSize(page); i++) { - map.put("page[" + i + "]", getFromList(page, i)); + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequired(Boolean required) { + this.required = required; + } + + public SubFormFieldsPerDocumentBase signer(String signer) { + this.signer = signer; + return this; + } + + public SubFormFieldsPerDocumentBase signer(Integer signer) { + this.signer = String.valueOf(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 + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSigner() { + return signer; + } + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigner(String signer) { + this.signer = signer; + } + + public void setSigner(Integer signer) { + this.signer = String.valueOf(signer); + } + + public SubFormFieldsPerDocumentBase type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public SubFormFieldsPerDocumentBase width(Integer width) { + this.width = width; + return this; + } + + /** + * Size of the field in pixels. + * + * @return width + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWidth(Integer width) { + this.width = width; + } + + public SubFormFieldsPerDocumentBase x(Integer x) { + this.x = x; + return this; + } + + /** + * Location coordinates of the field in pixels. + * + * @return x + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getX() { + return x; + } + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setX(Integer x) { + this.x = x; + } + + public SubFormFieldsPerDocumentBase y(Integer y) { + this.y = y; + return this; + } + + /** + * Location coordinates of the field in pixels. + * + * @return y + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getY() { + return y; + } + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setY(Integer y) { + this.y = y; + } + + public SubFormFieldsPerDocumentBase name(String name) { + this.name = name; + return this; + } + + /** + * Display name for the field. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public SubFormFieldsPerDocumentBase page(Integer page) { + this.page = 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 @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPage() { + return page; + } + + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPage(Integer page) { + this.page = page; + } + + /** Return true if this SubFormFieldsPerDocumentBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentBase subFormFieldsPerDocumentBase = + (SubFormFieldsPerDocumentBase) o; + return Objects.equals(this.documentIndex, subFormFieldsPerDocumentBase.documentIndex) + && Objects.equals(this.apiId, subFormFieldsPerDocumentBase.apiId) + && Objects.equals(this.height, subFormFieldsPerDocumentBase.height) + && Objects.equals(this.required, subFormFieldsPerDocumentBase.required) + && Objects.equals(this.signer, subFormFieldsPerDocumentBase.signer) + && Objects.equals(this.type, subFormFieldsPerDocumentBase.type) + && Objects.equals(this.width, subFormFieldsPerDocumentBase.width) + && Objects.equals(this.x, subFormFieldsPerDocumentBase.x) + && Objects.equals(this.y, subFormFieldsPerDocumentBase.y) + && Objects.equals(this.name, subFormFieldsPerDocumentBase.name) + && Objects.equals(this.page, subFormFieldsPerDocumentBase.page); + } + + @Override + public int hashCode() { + return Objects.hash( + documentIndex, apiId, height, required, signer, type, width, x, y, name, page); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentBase {\n"); + sb.append(" documentIndex: ").append(toIndentedString(documentIndex)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (documentIndex != null) { + if (isFileTypeOrListOfFiles(documentIndex)) { + fileTypeFound = true; + } + + if (documentIndex.getClass().equals(java.io.File.class) + || documentIndex.getClass().equals(Integer.class) + || documentIndex.getClass().equals(String.class) + || documentIndex.getClass().isEnum()) { + map.put("document_index", documentIndex); + } else if (isListOfFile(documentIndex)) { + for (int i = 0; i < getListSize(documentIndex); i++) { + map.put("document_index[" + i + "]", getFromList(documentIndex, i)); + } + } else { + map.put( + "document_index", + JSON.getDefault().getMapper().writeValueAsString(documentIndex)); + } + } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } + } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } + + if (height.getClass().equals(java.io.File.class) + || height.getClass().equals(Integer.class) + || height.getClass().equals(String.class) + || height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for (int i = 0; i < getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } + + if (signer.getClass().equals(java.io.File.class) + || signer.getClass().equals(Integer.class) + || signer.getClass().equals(String.class) + || signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for (int i = 0; i < getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } + + if (width.getClass().equals(java.io.File.class) + || width.getClass().equals(Integer.class) + || width.getClass().equals(String.class) + || width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for (int i = 0; i < getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } + } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } + + if (x.getClass().equals(java.io.File.class) + || x.getClass().equals(Integer.class) + || x.getClass().equals(String.class) + || x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for (int i = 0; i < getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } + } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } + + if (y.getClass().equals(java.io.File.class) + || y.getClass().equals(Integer.class) + || y.getClass().equals(String.class) + || y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for (int i = 0; i < getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } } + if (page != null) { + if (isFileTypeOrListOfFiles(page)) { + fileTypeFound = true; + } + + if (page.getClass().equals(java.io.File.class) + || page.getClass().equals(Integer.class) + || page.getClass().equals(String.class) + || page.getClass().isEnum()) { + map.put("page", page); + } else if (isListOfFile(page)) { + for (int i = 0; i < getListSize(page); i++) { + map.put("page[" + i + "]", getFromList(page, i)); + } + } else { + map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("page", JSON.getDefault().getMapper().writeValueAsString(page)); + + 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 "); } - } 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 "); - } - - 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); - } -} + 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java index 0a1ab01..d9e6724 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckbox.java @@ -10,287 +10,275 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; - private Boolean isChecked; - - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; - - public SubFormFieldsPerDocumentCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckbox.class); - } - - static public SubFormFieldsPerDocumentCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentCheckbox.class - ); - } - - public SubFormFieldsPerDocumentCheckbox type(String type) { - this.type = type; - return this; - } - - /** - * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentCheckbox isChecked(Boolean isChecked) { - this.isChecked = isChecked; - return this; - } - - /** - * `true` for checking the checkbox field by default, otherwise `false`. - * @return isChecked - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getIsChecked() { - return isChecked; - } - - - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIsChecked(Boolean isChecked) { - this.isChecked = isChecked; - } - - - public SubFormFieldsPerDocumentCheckbox group(String group) { - this.group = group; - return this; - } - - /** - * String referencing group defined in `form_field_groups` parameter. - * @return group - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(String group) { - this.group = group; - } - - - /** - * Return true if this SubFormFieldsPerDocumentCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; + private Boolean isChecked; + + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public SubFormFieldsPerDocumentCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentCheckbox init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckbox.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SubFormFieldsPerDocumentCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentCheckbox.class); } - SubFormFieldsPerDocumentCheckbox subFormFieldsPerDocumentCheckbox = (SubFormFieldsPerDocumentCheckbox) o; - return Objects.equals(this.type, subFormFieldsPerDocumentCheckbox.type) && - Objects.equals(this.isChecked, subFormFieldsPerDocumentCheckbox.isChecked) && - Objects.equals(this.group, subFormFieldsPerDocumentCheckbox.group) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, isChecked, group, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentCheckbox type(String type) { + this.type = type; + return this; } - if (isChecked != null) { - if (isFileTypeOrListOfFiles(isChecked)) { - fileTypeFound = true; - } - if (isChecked.getClass().equals(java.io.File.class) || - isChecked.getClass().equals(Integer.class) || - isChecked.getClass().equals(String.class) || - isChecked.getClass().isEnum()) { - map.put("is_checked", isChecked); - } else if (isListOfFile(isChecked)) { - for(int i = 0; i< getListSize(isChecked); i++) { - map.put("is_checked[" + i + "]", getFromList(isChecked, i)); - } + /** + * A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public SubFormFieldsPerDocumentCheckbox isChecked(Boolean isChecked) { + this.isChecked = isChecked; + return this; + } + + /** + * `true` for checking the checkbox field by default, otherwise `false`. + * + * @return isChecked + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsChecked() { + return isChecked; + } + + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsChecked(Boolean isChecked) { + this.isChecked = isChecked; + } + + public SubFormFieldsPerDocumentCheckbox group(String group) { + this.group = group; + return this; + } + + /** + * String referencing group defined in `form_field_groups` parameter. + * + * @return group + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroup() { + return group; + } + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(String group) { + this.group = group; + } + + /** Return true if this SubFormFieldsPerDocumentCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("is_checked", JSON.getDefault().getMapper().writeValueAsString(isChecked)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentCheckbox subFormFieldsPerDocumentCheckbox = + (SubFormFieldsPerDocumentCheckbox) o; + return Objects.equals(this.type, subFormFieldsPerDocumentCheckbox.type) + && Objects.equals(this.isChecked, subFormFieldsPerDocumentCheckbox.isChecked) + && Objects.equals(this.group, subFormFieldsPerDocumentCheckbox.group) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, isChecked, group, super.hashCode()); } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (isChecked != null) { + if (isFileTypeOrListOfFiles(isChecked)) { + fileTypeFound = true; + } + + if (isChecked.getClass().equals(java.io.File.class) + || isChecked.getClass().equals(Integer.class) + || isChecked.getClass().equals(String.class) + || isChecked.getClass().isEnum()) { + map.put("is_checked", isChecked); + } else if (isListOfFile(isChecked)) { + for (int i = 0; i < getListSize(isChecked); i++) { + map.put("is_checked[" + i + "]", getFromList(isChecked, i)); + } + } else { + map.put( + "is_checked", + JSON.getDefault().getMapper().writeValueAsString(isChecked)); + } + } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentCheckbox", SubFormFieldsPerDocumentCheckbox.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckbox.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java index 1c10aa6..0889539 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentCheckboxMerge.java @@ -10,187 +10,181 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ -@JsonPropertyOrder({ - SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `SubFormFieldsPerDocumentBase`. */ +@JsonPropertyOrder({SubFormFieldsPerDocumentCheckboxMerge.JSON_PROPERTY_TYPE}) +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox-merge"; - - public SubFormFieldsPerDocumentCheckboxMerge() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentCheckboxMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckboxMerge.class); - } - - static public SubFormFieldsPerDocumentCheckboxMerge init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentCheckboxMerge.class - ); - } - - public SubFormFieldsPerDocumentCheckboxMerge type(String type) { - this.type = type; - return this; - } - - /** - * A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this SubFormFieldsPerDocumentCheckboxMerge object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentCheckboxMerge subFormFieldsPerDocumentCheckboxMerge = (SubFormFieldsPerDocumentCheckboxMerge) o; - return Objects.equals(this.type, subFormFieldsPerDocumentCheckboxMerge.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentCheckboxMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox-merge"; + + public SubFormFieldsPerDocumentCheckboxMerge() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentCheckboxMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentCheckboxMerge.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static SubFormFieldsPerDocumentCheckboxMerge init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentCheckboxMerge.class); + } + + public SubFormFieldsPerDocumentCheckboxMerge type(String type) { + this.type = type; + return this; + } + + /** + * A checkbox field that has default value set using pre-filled data. Use the + * `SubFormFieldsPerDocumentCheckboxMerge` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this SubFormFieldsPerDocumentCheckboxMerge object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentCheckboxMerge subFormFieldsPerDocumentCheckboxMerge = + (SubFormFieldsPerDocumentCheckboxMerge) o; + return Objects.equals(this.type, subFormFieldsPerDocumentCheckboxMerge.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentCheckboxMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentCheckboxMerge", SubFormFieldsPerDocumentCheckboxMerge.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentCheckboxMerge.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java index f6b0fbb..83e5960 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDateSigned.java @@ -10,350 +10,342 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "date_signed"; - - /** - * Font family for the field. - */ - public enum FontFamilyEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "date_signed"; + + /** Font family for the field. */ + public enum FontFamilyEnum { + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentDateSigned() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentDateSigned init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDateSigned.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubFormFieldsPerDocumentDateSigned init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentDateSigned.class); } - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubFormFieldsPerDocumentDateSigned type(String type) { + this.type = type; + return this; } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - private Integer fontSize = 12; - - public SubFormFieldsPerDocumentDateSigned() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentDateSigned init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDateSigned.class); - } - - static public SubFormFieldsPerDocumentDateSigned init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentDateSigned.class - ); - } - - public SubFormFieldsPerDocumentDateSigned type(String type) { - this.type = type; - return this; - } - - /** - * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentDateSigned fontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - - public SubFormFieldsPerDocumentDateSigned fontSize(Integer fontSize) { - this.fontSize = 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 - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFontSize() { - return fontSize; - } - - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(Integer fontSize) { - this.fontSize = fontSize; - } - - - /** - * Return true if this SubFormFieldsPerDocumentDateSigned object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * A date. Use the `SubFormFieldsPerDocumentDateSigned` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - SubFormFieldsPerDocumentDateSigned subFormFieldsPerDocumentDateSigned = (SubFormFieldsPerDocumentDateSigned) o; - return Objects.equals(this.type, subFormFieldsPerDocumentDateSigned.type) && - Objects.equals(this.fontFamily, subFormFieldsPerDocumentDateSigned.fontFamily) && - Objects.equals(this.fontSize, subFormFieldsPerDocumentDateSigned.fontSize) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, fontFamily, fontSize, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentDateSigned fontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } + /** + * Font family for the field. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + public SubFormFieldsPerDocumentDateSigned fontSize(Integer fontSize) { + this.fontSize = 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 @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFontSize() { + return fontSize; + } + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(Integer fontSize) { + this.fontSize = fontSize; + } + + /** Return true if this SubFormFieldsPerDocumentDateSigned object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentDateSigned subFormFieldsPerDocumentDateSigned = + (SubFormFieldsPerDocumentDateSigned) o; + return Objects.equals(this.type, subFormFieldsPerDocumentDateSigned.type) + && Objects.equals(this.fontFamily, subFormFieldsPerDocumentDateSigned.fontFamily) + && Objects.equals(this.fontSize, subFormFieldsPerDocumentDateSigned.fontSize) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fontFamily, fontSize, super.hashCode()); } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - if (fontSize.getClass().equals(java.io.File.class) || - fontSize.getClass().equals(Integer.class) || - fontSize.getClass().equals(String.class) || - fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for(int i = 0; i< getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "font_family", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } + + if (fontSize.getClass().equals(java.io.File.class) + || fontSize.getClass().equals(Integer.class) + || fontSize.getClass().equals(String.class) + || fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for (int i = 0; i < getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); + } + } else { + map.put( + "font_size", + JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put( + "SubFormFieldsPerDocumentDateSigned", SubFormFieldsPerDocumentDateSigned.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDateSigned.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java index cd8dce0..5089a09 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentDropdown.java @@ -10,460 +10,444 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "dropdown"; - - public static final String JSON_PROPERTY_OPTIONS = "options"; - private List options = new ArrayList<>(); - - public static final String JSON_PROPERTY_CONTENT = "content"; - private String content; - - /** - * Font family for the field. - */ - public enum FontFamilyEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "dropdown"; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private List options = new ArrayList<>(); + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + /** Font family for the field. */ + public enum FontFamilyEnum { + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentDropdown() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentDropdown init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDropdown.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubFormFieldsPerDocumentDropdown init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentDropdown.class); } - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubFormFieldsPerDocumentDropdown type(String type) { + this.type = type; + return this; } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - private Integer fontSize = 12; - - public SubFormFieldsPerDocumentDropdown() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentDropdown init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentDropdown.class); - } - - static public SubFormFieldsPerDocumentDropdown init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentDropdown.class - ); - } - - public SubFormFieldsPerDocumentDropdown type(String type) { - this.type = type; - return this; - } - - /** - * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentDropdown options(List options) { - this.options = options; - return this; - } - - public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { - if (this.options == null) { - this.options = new ArrayList<>(); + + /** + * An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - this.options.add(optionsItem); - return this; - } - - /** - * Array of string values representing dropdown values. - * @return options - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getOptions() { - return options; - } - - - @JsonProperty(JSON_PROPERTY_OPTIONS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setOptions(List options) { - this.options = options; - } - - - public SubFormFieldsPerDocumentDropdown content(String content) { - this.content = content; - return this; - } - - /** - * Selected value in `options` array. Value must exist in array. - * @return content - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getContent() { - return content; - } - - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContent(String content) { - this.content = content; - } - - - public SubFormFieldsPerDocumentDropdown fontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - - public SubFormFieldsPerDocumentDropdown fontSize(Integer fontSize) { - this.fontSize = 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 - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFontSize() { - return fontSize; - } - - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(Integer fontSize) { - this.fontSize = fontSize; - } - - - /** - * Return true if this SubFormFieldsPerDocumentDropdown object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (o == null || getClass() != o.getClass()) { - return false; + + public SubFormFieldsPerDocumentDropdown options(List options) { + this.options = options; + return this; } - SubFormFieldsPerDocumentDropdown subFormFieldsPerDocumentDropdown = (SubFormFieldsPerDocumentDropdown) o; - return Objects.equals(this.type, subFormFieldsPerDocumentDropdown.type) && - Objects.equals(this.options, subFormFieldsPerDocumentDropdown.options) && - Objects.equals(this.content, subFormFieldsPerDocumentDropdown.content) && - Objects.equals(this.fontFamily, subFormFieldsPerDocumentDropdown.fontFamily) && - Objects.equals(this.fontSize, subFormFieldsPerDocumentDropdown.fontSize) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, options, content, fontFamily, fontSize, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" options: ").append(toIndentedString(options)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + public SubFormFieldsPerDocumentDropdown addOptionsItem(String optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); } + this.options.add(optionsItem); + return this; } - if (options != null) { - if (isFileTypeOrListOfFiles(options)) { - fileTypeFound = true; - } - if (options.getClass().equals(java.io.File.class) || - options.getClass().equals(Integer.class) || - options.getClass().equals(String.class) || - options.getClass().isEnum()) { - map.put("options", options); - } else if (isListOfFile(options)) { - for(int i = 0; i< getListSize(options); i++) { - map.put("options[" + i + "]", getFromList(options, i)); - } - } - else { - map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); - } + /** + * Array of string values representing dropdown values. + * + * @return options + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getOptions() { + return options; } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - if (content.getClass().equals(java.io.File.class) || - content.getClass().equals(Integer.class) || - content.getClass().equals(String.class) || - content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for(int i = 0; i< getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } - else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOptions(List options) { + this.options = options; } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } + public SubFormFieldsPerDocumentDropdown content(String content) { + this.content = content; + return this; + } + + /** + * Selected value in `options` array. Value must exist in array. + * + * @return content + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(String content) { + this.content = content; + } + + public SubFormFieldsPerDocumentDropdown fontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + public SubFormFieldsPerDocumentDropdown fontSize(Integer fontSize) { + this.fontSize = 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 @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFontSize() { + return fontSize; + } + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(Integer fontSize) { + this.fontSize = fontSize; + } + + /** Return true if this SubFormFieldsPerDocumentDropdown object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentDropdown subFormFieldsPerDocumentDropdown = + (SubFormFieldsPerDocumentDropdown) o; + return Objects.equals(this.type, subFormFieldsPerDocumentDropdown.type) + && Objects.equals(this.options, subFormFieldsPerDocumentDropdown.options) + && Objects.equals(this.content, subFormFieldsPerDocumentDropdown.content) + && Objects.equals(this.fontFamily, subFormFieldsPerDocumentDropdown.fontFamily) + && Objects.equals(this.fontSize, subFormFieldsPerDocumentDropdown.fontSize) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, options, content, fontFamily, fontSize, super.hashCode()); } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - if (fontSize.getClass().equals(java.io.File.class) || - fontSize.getClass().equals(Integer.class) || - fontSize.getClass().equals(String.class) || - fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for(int i = 0; i< getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (options != null) { + if (isFileTypeOrListOfFiles(options)) { + fileTypeFound = true; + } + + if (options.getClass().equals(java.io.File.class) + || options.getClass().equals(Integer.class) + || options.getClass().equals(String.class) + || options.getClass().isEnum()) { + map.put("options", options); + } else if (isListOfFile(options)) { + for (int i = 0; i < getListSize(options); i++) { + map.put("options[" + i + "]", getFromList(options, i)); + } + } else { + map.put("options", JSON.getDefault().getMapper().writeValueAsString(options)); + } + } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } + + if (content.getClass().equals(java.io.File.class) + || content.getClass().equals(Integer.class) + || content.getClass().equals(String.class) + || content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for (int i = 0; i < getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } + } else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "font_family", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } + + if (fontSize.getClass().equals(java.io.File.class) + || fontSize.getClass().equals(Integer.class) + || fontSize.getClass().equals(String.class) + || fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for (int i = 0; i < getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); + } + } else { + map.put( + "font_size", + JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentDropdown", SubFormFieldsPerDocumentDropdown.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentDropdown.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java index f557d5a..a4e55c3 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentFontEnum.java @@ -10,82 +10,68 @@ * 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 SubFormFieldsPerDocumentFontEnum - */ +/** Gets or Sets SubFormFieldsPerDocumentFontEnum */ public enum SubFormFieldsPerDocumentFontEnum { - - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - SubFormFieldsPerDocumentFontEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SubFormFieldsPerDocumentFontEnum fromValue(String value) { - for (SubFormFieldsPerDocumentFontEnum b : SubFormFieldsPerDocumentFontEnum.values()) { - if (b.value.equals(value)) { - return b; - } + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + SubFormFieldsPerDocumentFontEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubFormFieldsPerDocumentFontEnum fromValue(String value) { + for (SubFormFieldsPerDocumentFontEnum b : SubFormFieldsPerDocumentFontEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java index 1bbea87..c3b09b2 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentHyperlink.java @@ -10,450 +10,437 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "hyperlink"; - - public static final String JSON_PROPERTY_CONTENT = "content"; - private String content; - - public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; - private String contentUrl; - - /** - * Font family for the field. - */ - public enum FontFamilyEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "hyperlink"; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_CONTENT_URL = "content_url"; + private String contentUrl; + + /** Font family for the field. */ + public enum FontFamilyEnum { + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentHyperlink() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentHyperlink init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentHyperlink.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubFormFieldsPerDocumentHyperlink init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentHyperlink.class); } - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubFormFieldsPerDocumentHyperlink type(String type) { + this.type = type; + return this; } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - private Integer fontSize = 12; - - public SubFormFieldsPerDocumentHyperlink() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentHyperlink init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentHyperlink.class); - } - - static public SubFormFieldsPerDocumentHyperlink init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentHyperlink.class - ); - } - - public SubFormFieldsPerDocumentHyperlink type(String type) { - this.type = type; - return this; - } - - /** - * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentHyperlink content(String content) { - this.content = content; - return this; - } - - /** - * Link Text. - * @return content - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getContent() { - return content; - } - - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setContent(String content) { - this.content = content; - } - - - public SubFormFieldsPerDocumentHyperlink contentUrl(String contentUrl) { - this.contentUrl = contentUrl; - return this; - } - - /** - * Link URL. - * @return contentUrl - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CONTENT_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getContentUrl() { - return contentUrl; - } - - - @JsonProperty(JSON_PROPERTY_CONTENT_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setContentUrl(String contentUrl) { - this.contentUrl = contentUrl; - } - - - public SubFormFieldsPerDocumentHyperlink fontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - - public SubFormFieldsPerDocumentHyperlink fontSize(Integer fontSize) { - this.fontSize = 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 - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFontSize() { - return fontSize; - } - - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(Integer fontSize) { - this.fontSize = fontSize; - } - - - /** - * Return true if this SubFormFieldsPerDocumentHyperlink object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - SubFormFieldsPerDocumentHyperlink subFormFieldsPerDocumentHyperlink = (SubFormFieldsPerDocumentHyperlink) o; - return Objects.equals(this.type, subFormFieldsPerDocumentHyperlink.type) && - Objects.equals(this.content, subFormFieldsPerDocumentHyperlink.content) && - Objects.equals(this.contentUrl, subFormFieldsPerDocumentHyperlink.contentUrl) && - Objects.equals(this.fontFamily, subFormFieldsPerDocumentHyperlink.fontFamily) && - Objects.equals(this.fontSize, subFormFieldsPerDocumentHyperlink.fontSize) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, content, contentUrl, fontFamily, fontSize, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" contentUrl: ").append(toIndentedString(contentUrl)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentHyperlink content(String content) { + this.content = content; + return this; } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - if (content.getClass().equals(java.io.File.class) || - content.getClass().equals(Integer.class) || - content.getClass().equals(String.class) || - content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for(int i = 0; i< getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } - else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } + /** + * Link Text. + * + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContent() { + return content; } - if (contentUrl != null) { - if (isFileTypeOrListOfFiles(contentUrl)) { - fileTypeFound = true; - } - if (contentUrl.getClass().equals(java.io.File.class) || - contentUrl.getClass().equals(Integer.class) || - contentUrl.getClass().equals(String.class) || - contentUrl.getClass().isEnum()) { - map.put("content_url", contentUrl); - } else if (isListOfFile(contentUrl)) { - for(int i = 0; i< getListSize(contentUrl); i++) { - map.put("content_url[" + i + "]", getFromList(contentUrl, i)); - } - } - else { - map.put("content_url", JSON.getDefault().getMapper().writeValueAsString(contentUrl)); - } + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(String content) { + this.content = content; } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } + public SubFormFieldsPerDocumentHyperlink contentUrl(String contentUrl) { + this.contentUrl = contentUrl; + return this; + } + + /** + * Link URL. + * + * @return contentUrl + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContentUrl() { + return contentUrl; + } + + @JsonProperty(JSON_PROPERTY_CONTENT_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContentUrl(String contentUrl) { + this.contentUrl = contentUrl; + } + + public SubFormFieldsPerDocumentHyperlink fontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family for the field. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + public SubFormFieldsPerDocumentHyperlink fontSize(Integer fontSize) { + this.fontSize = 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 @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFontSize() { + return fontSize; + } + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(Integer fontSize) { + this.fontSize = fontSize; + } + + /** Return true if this SubFormFieldsPerDocumentHyperlink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentHyperlink subFormFieldsPerDocumentHyperlink = + (SubFormFieldsPerDocumentHyperlink) o; + return Objects.equals(this.type, subFormFieldsPerDocumentHyperlink.type) + && Objects.equals(this.content, subFormFieldsPerDocumentHyperlink.content) + && Objects.equals(this.contentUrl, subFormFieldsPerDocumentHyperlink.contentUrl) + && Objects.equals(this.fontFamily, subFormFieldsPerDocumentHyperlink.fontFamily) + && Objects.equals(this.fontSize, subFormFieldsPerDocumentHyperlink.fontSize) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, content, contentUrl, fontFamily, fontSize, super.hashCode()); } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - if (fontSize.getClass().equals(java.io.File.class) || - fontSize.getClass().equals(Integer.class) || - fontSize.getClass().equals(String.class) || - fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for(int i = 0; i< getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" contentUrl: ").append(toIndentedString(contentUrl)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } + + if (content.getClass().equals(java.io.File.class) + || content.getClass().equals(Integer.class) + || content.getClass().equals(String.class) + || content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for (int i = 0; i < getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } + } else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); + } + } + if (contentUrl != null) { + if (isFileTypeOrListOfFiles(contentUrl)) { + fileTypeFound = true; + } + + if (contentUrl.getClass().equals(java.io.File.class) + || contentUrl.getClass().equals(Integer.class) + || contentUrl.getClass().equals(String.class) + || contentUrl.getClass().isEnum()) { + map.put("content_url", contentUrl); + } else if (isListOfFile(contentUrl)) { + for (int i = 0; i < getListSize(contentUrl); i++) { + map.put("content_url[" + i + "]", getFromList(contentUrl, i)); + } + } else { + map.put( + "content_url", + JSON.getDefault().getMapper().writeValueAsString(contentUrl)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "font_family", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } + + if (fontSize.getClass().equals(java.io.File.class) + || fontSize.getClass().equals(Integer.class) + || fontSize.getClass().equals(String.class) + || fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for (int i = 0; i < getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); + } + } else { + map.put( + "font_size", + JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentHyperlink", SubFormFieldsPerDocumentHyperlink.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentHyperlink.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java index 7075f8b..4cb9a05 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentInitials.java @@ -10,187 +10,177 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ -@JsonPropertyOrder({ - SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `SubFormFieldsPerDocumentBase`. */ +@JsonPropertyOrder({SubFormFieldsPerDocumentInitials.JSON_PROPERTY_TYPE}) +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "initials"; - - public SubFormFieldsPerDocumentInitials() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentInitials init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentInitials.class); - } - - static public SubFormFieldsPerDocumentInitials init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentInitials.class - ); - } - - public SubFormFieldsPerDocumentInitials type(String type) { - this.type = type; - return this; - } - - /** - * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this SubFormFieldsPerDocumentInitials object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentInitials subFormFieldsPerDocumentInitials = (SubFormFieldsPerDocumentInitials) o; - return Objects.equals(this.type, subFormFieldsPerDocumentInitials.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "initials"; + + public SubFormFieldsPerDocumentInitials() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentInitials init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentInitials.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static SubFormFieldsPerDocumentInitials init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentInitials.class); + } + + public SubFormFieldsPerDocumentInitials type(String type) { + this.type = type; + return this; + } + + /** + * An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this SubFormFieldsPerDocumentInitials object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentInitials subFormFieldsPerDocumentInitials = + (SubFormFieldsPerDocumentInitials) o; + return Objects.equals(this.type, subFormFieldsPerDocumentInitials.type) && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentInitials", SubFormFieldsPerDocumentInitials.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentInitials.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java index 4991e52..f6837cf 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentRadio.java @@ -10,287 +10,277 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "radio"; - - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; - - public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; - private Boolean isChecked; - - public SubFormFieldsPerDocumentRadio() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentRadio.class); - } - - static public SubFormFieldsPerDocumentRadio init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentRadio.class - ); - } - - public SubFormFieldsPerDocumentRadio type(String type) { - this.type = type; - return this; - } - - /** - * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentRadio group(String group) { - this.group = group; - return this; - } - - /** - * String referencing group defined in `form_field_groups` parameter. - * @return group - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroup(String group) { - this.group = group; - } - - - public SubFormFieldsPerDocumentRadio isChecked(Boolean isChecked) { - this.isChecked = 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 - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getIsChecked() { - return isChecked; - } - - - @JsonProperty(JSON_PROPERTY_IS_CHECKED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIsChecked(Boolean isChecked) { - this.isChecked = isChecked; - } - - - /** - * Return true if this SubFormFieldsPerDocumentRadio object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "radio"; + + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public static final String JSON_PROPERTY_IS_CHECKED = "is_checked"; + private Boolean isChecked; + + public SubFormFieldsPerDocumentRadio() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentRadio.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SubFormFieldsPerDocumentRadio init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentRadio.class); } - SubFormFieldsPerDocumentRadio subFormFieldsPerDocumentRadio = (SubFormFieldsPerDocumentRadio) o; - return Objects.equals(this.type, subFormFieldsPerDocumentRadio.type) && - Objects.equals(this.group, subFormFieldsPerDocumentRadio.group) && - Objects.equals(this.isChecked, subFormFieldsPerDocumentRadio.isChecked) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, group, isChecked, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentRadio type(String type) { + this.type = type; + return this; } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } + /** + * An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public SubFormFieldsPerDocumentRadio group(String group) { + this.group = group; + return this; + } + + /** + * String referencing group defined in `form_field_groups` parameter. + * + * @return group + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroup() { + return group; + } + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroup(String group) { + this.group = group; + } + + public SubFormFieldsPerDocumentRadio isChecked(Boolean isChecked) { + this.isChecked = 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 + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsChecked() { + return isChecked; + } + + @JsonProperty(JSON_PROPERTY_IS_CHECKED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIsChecked(Boolean isChecked) { + this.isChecked = isChecked; + } + + /** Return true if this SubFormFieldsPerDocumentRadio object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentRadio subFormFieldsPerDocumentRadio = + (SubFormFieldsPerDocumentRadio) o; + return Objects.equals(this.type, subFormFieldsPerDocumentRadio.type) + && Objects.equals(this.group, subFormFieldsPerDocumentRadio.group) + && Objects.equals(this.isChecked, subFormFieldsPerDocumentRadio.isChecked) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, group, isChecked, super.hashCode()); } - if (isChecked != null) { - if (isFileTypeOrListOfFiles(isChecked)) { - fileTypeFound = true; - } - if (isChecked.getClass().equals(java.io.File.class) || - isChecked.getClass().equals(Integer.class) || - isChecked.getClass().equals(String.class) || - isChecked.getClass().isEnum()) { - map.put("is_checked", isChecked); - } else if (isListOfFile(isChecked)) { - for(int i = 0; i< getListSize(isChecked); i++) { - map.put("is_checked[" + i + "]", getFromList(isChecked, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" isChecked: ").append(toIndentedString(isChecked)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + if (isChecked != null) { + if (isFileTypeOrListOfFiles(isChecked)) { + fileTypeFound = true; + } + + if (isChecked.getClass().equals(java.io.File.class) + || isChecked.getClass().equals(Integer.class) + || isChecked.getClass().equals(String.class) + || isChecked.getClass().isEnum()) { + map.put("is_checked", isChecked); + } else if (isListOfFile(isChecked)) { + for (int i = 0; i < getListSize(isChecked); i++) { + map.put("is_checked[" + i + "]", getFromList(isChecked, i)); + } + } else { + map.put( + "is_checked", + JSON.getDefault().getMapper().writeValueAsString(isChecked)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("is_checked", JSON.getDefault().getMapper().writeValueAsString(isChecked)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentRadio", SubFormFieldsPerDocumentRadio.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentRadio.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java index c6867bd..4c3019c 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentSignature.java @@ -10,187 +10,177 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ -@JsonPropertyOrder({ - SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `SubFormFieldsPerDocumentBase`. */ +@JsonPropertyOrder({SubFormFieldsPerDocumentSignature.JSON_PROPERTY_TYPE}) +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "signature"; - - public SubFormFieldsPerDocumentSignature() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentSignature init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentSignature.class); - } - - static public SubFormFieldsPerDocumentSignature init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentSignature.class - ); - } - - public SubFormFieldsPerDocumentSignature type(String type) { - this.type = type; - return this; - } - - /** - * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this SubFormFieldsPerDocumentSignature object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentSignature subFormFieldsPerDocumentSignature = (SubFormFieldsPerDocumentSignature) o; - return Objects.equals(this.type, subFormFieldsPerDocumentSignature.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "signature"; + + public SubFormFieldsPerDocumentSignature() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentSignature init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentSignature.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static SubFormFieldsPerDocumentSignature init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentSignature.class); + } + + public SubFormFieldsPerDocumentSignature type(String type) { + this.type = type; + return this; + } + + /** + * A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this SubFormFieldsPerDocumentSignature object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentSignature subFormFieldsPerDocumentSignature = + (SubFormFieldsPerDocumentSignature) o; + return Objects.equals(this.type, subFormFieldsPerDocumentSignature.type) && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentSignature", SubFormFieldsPerDocumentSignature.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentSignature.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java index d2b5eed..31ab411 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentText.java @@ -10,801 +10,816 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public static final String JSON_PROPERTY_PLACEHOLDER = "placeholder"; - private String placeholder; - - public static final String JSON_PROPERTY_AUTO_FILL_TYPE = "auto_fill_type"; - private String autoFillType; - - public static final String JSON_PROPERTY_LINK_ID = "link_id"; - private String linkId; - - public static final String JSON_PROPERTY_MASKED = "masked"; - private Boolean masked; - - /** - * 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. - */ - public enum ValidationTypeEnum { - 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"); - - private String value; - - ValidationTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String JSON_PROPERTY_PLACEHOLDER = "placeholder"; + private String placeholder; - @JsonCreator - public static ValidationTypeEnum fromValue(String value) { - for (ValidationTypeEnum b : ValidationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; - private ValidationTypeEnum validationType; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; - private String validationCustomRegex; - - public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = "validation_custom_regex_format_label"; - private String validationCustomRegexFormatLabel; - - public static final String JSON_PROPERTY_CONTENT = "content"; - private String content; - - /** - * Font family for the field. - */ - public enum FontFamilyEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } + public static final String JSON_PROPERTY_AUTO_FILL_TYPE = "auto_fill_type"; + private String autoFillType; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String JSON_PROPERTY_LINK_ID = "link_id"; + private String linkId; - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - private Integer fontSize = 12; - - public SubFormFieldsPerDocumentText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentText.class); - } - - static public SubFormFieldsPerDocumentText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentText.class - ); - } - - public SubFormFieldsPerDocumentText type(String type) { - this.type = type; - return this; - } - - /** - * A text input field. Use the `SubFormFieldsPerDocumentText` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentText placeholder(String placeholder) { - this.placeholder = placeholder; - return this; - } - - /** - * Placeholder value for text field. - * @return placeholder - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PLACEHOLDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPlaceholder() { - return placeholder; - } - - - @JsonProperty(JSON_PROPERTY_PLACEHOLDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPlaceholder(String placeholder) { - this.placeholder = placeholder; - } - - - public SubFormFieldsPerDocumentText autoFillType(String autoFillType) { - this.autoFillType = 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 - @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getAutoFillType() { - return autoFillType; - } - - - @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAutoFillType(String autoFillType) { - this.autoFillType = autoFillType; - } - - - public SubFormFieldsPerDocumentText linkId(String linkId) { - this.linkId = 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 - @JsonProperty(JSON_PROPERTY_LINK_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLinkId() { - return linkId; - } - - - @JsonProperty(JSON_PROPERTY_LINK_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkId(String linkId) { - this.linkId = linkId; - } - - - public SubFormFieldsPerDocumentText masked(Boolean masked) { - this.masked = 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 - @JsonProperty(JSON_PROPERTY_MASKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getMasked() { - return masked; - } - - - @JsonProperty(JSON_PROPERTY_MASKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMasked(Boolean masked) { - this.masked = masked; - } - - - public SubFormFieldsPerDocumentText validationType(ValidationTypeEnum validationType) { - this.validationType = validationType; - 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 - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ValidationTypeEnum getValidationType() { - return validationType; - } - - - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationType(ValidationTypeEnum validationType) { - this.validationType = validationType; - } - - - public SubFormFieldsPerDocumentText validationCustomRegex(String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - return this; - } - - /** - * Get validationCustomRegex - * @return validationCustomRegex - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValidationCustomRegex() { - return validationCustomRegex; - } - - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegex(String validationCustomRegex) { - this.validationCustomRegex = validationCustomRegex; - } - - - public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel(String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; - return this; - } - - /** - * Get validationCustomRegexFormatLabel - * @return validationCustomRegexFormatLabel - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getValidationCustomRegexFormatLabel() { - return validationCustomRegexFormatLabel; - } - - - @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationCustomRegexFormatLabel(String validationCustomRegexFormatLabel) { - this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; - } - - - public SubFormFieldsPerDocumentText content(String content) { - this.content = content; - return this; - } - - /** - * Content of a `me_now` text field - * @return content - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getContent() { - return content; - } - - - @JsonProperty(JSON_PROPERTY_CONTENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setContent(String content) { - this.content = content; - } - - - public SubFormFieldsPerDocumentText fontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - - public SubFormFieldsPerDocumentText fontSize(Integer fontSize) { - this.fontSize = 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 - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFontSize() { - return fontSize; - } - - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(Integer fontSize) { - this.fontSize = fontSize; - } - - - /** - * Return true if this SubFormFieldsPerDocumentText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubFormFieldsPerDocumentText subFormFieldsPerDocumentText = (SubFormFieldsPerDocumentText) o; - return Objects.equals(this.type, subFormFieldsPerDocumentText.type) && - Objects.equals(this.placeholder, subFormFieldsPerDocumentText.placeholder) && - Objects.equals(this.autoFillType, subFormFieldsPerDocumentText.autoFillType) && - Objects.equals(this.linkId, subFormFieldsPerDocumentText.linkId) && - Objects.equals(this.masked, subFormFieldsPerDocumentText.masked) && - Objects.equals(this.validationType, subFormFieldsPerDocumentText.validationType) && - Objects.equals(this.validationCustomRegex, subFormFieldsPerDocumentText.validationCustomRegex) && - Objects.equals(this.validationCustomRegexFormatLabel, subFormFieldsPerDocumentText.validationCustomRegexFormatLabel) && - Objects.equals(this.content, subFormFieldsPerDocumentText.content) && - Objects.equals(this.fontFamily, subFormFieldsPerDocumentText.fontFamily) && - Objects.equals(this.fontSize, subFormFieldsPerDocumentText.fontSize) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, placeholder, autoFillType, linkId, masked, validationType, validationCustomRegex, validationCustomRegexFormatLabel, content, fontFamily, fontSize, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); - sb.append(" autoFillType: ").append(toIndentedString(autoFillType)).append("\n"); - sb.append(" linkId: ").append(toIndentedString(linkId)).append("\n"); - sb.append(" masked: ").append(toIndentedString(masked)).append("\n"); - sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); - sb.append(" validationCustomRegex: ").append(toIndentedString(validationCustomRegex)).append("\n"); - sb.append(" validationCustomRegexFormatLabel: ").append(toIndentedString(validationCustomRegexFormatLabel)).append("\n"); - sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_MASKED = "masked"; + private Boolean masked; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + /** + * 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. + */ + public enum ValidationTypeEnum { + 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"); + + private String value; + + ValidationTypeEnum(String value) { + this.value = value; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + + @JsonValue + public String getValue() { + return value; } - } - if (placeholder != null) { - if (isFileTypeOrListOfFiles(placeholder)) { - fileTypeFound = true; + + @Override + public String toString() { + return String.valueOf(value); } - if (placeholder.getClass().equals(java.io.File.class) || - placeholder.getClass().equals(Integer.class) || - placeholder.getClass().equals(String.class) || - placeholder.getClass().isEnum()) { - map.put("placeholder", placeholder); - } else if (isListOfFile(placeholder)) { - for(int i = 0; i< getListSize(placeholder); i++) { - map.put("placeholder[" + i + "]", getFromList(placeholder, i)); + @JsonCreator + public static ValidationTypeEnum fromValue(String value) { + for (ValidationTypeEnum b : ValidationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } - } - else { - map.put("placeholder", JSON.getDefault().getMapper().writeValueAsString(placeholder)); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - if (autoFillType != null) { - if (isFileTypeOrListOfFiles(autoFillType)) { - fileTypeFound = true; - } - if (autoFillType.getClass().equals(java.io.File.class) || - autoFillType.getClass().equals(Integer.class) || - autoFillType.getClass().equals(String.class) || - autoFillType.getClass().isEnum()) { - map.put("auto_fill_type", autoFillType); - } else if (isListOfFile(autoFillType)) { - for(int i = 0; i< getListSize(autoFillType); i++) { - map.put("auto_fill_type[" + i + "]", getFromList(autoFillType, i)); - } + public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; + private ValidationTypeEnum validationType; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; + private String validationCustomRegex; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = + "validation_custom_regex_format_label"; + private String validationCustomRegexFormatLabel; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + /** Font family for the field. */ + public enum FontFamilyEnum { + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; } - else { - map.put("auto_fill_type", JSON.getDefault().getMapper().writeValueAsString(autoFillType)); + + @JsonValue + public String getValue() { + return value; } - } - if (linkId != null) { - if (isFileTypeOrListOfFiles(linkId)) { - fileTypeFound = true; + + @Override + public String toString() { + return String.valueOf(value); } - if (linkId.getClass().equals(java.io.File.class) || - linkId.getClass().equals(Integer.class) || - linkId.getClass().equals(String.class) || - linkId.getClass().isEnum()) { - map.put("link_id", linkId); - } else if (isListOfFile(linkId)) { - for(int i = 0; i< getListSize(linkId); i++) { - map.put("link_id[" + i + "]", getFromList(linkId, i)); + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } } - } - else { - map.put("link_id", JSON.getDefault().getMapper().writeValueAsString(linkId)); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - if (masked != null) { - if (isFileTypeOrListOfFiles(masked)) { - fileTypeFound = true; - } - if (masked.getClass().equals(java.io.File.class) || - masked.getClass().equals(Integer.class) || - masked.getClass().equals(String.class) || - masked.getClass().isEnum()) { - map.put("masked", masked); - } else if (isListOfFile(masked)) { - for(int i = 0; i< getListSize(masked); i++) { - map.put("masked[" + i + "]", getFromList(masked, i)); - } - } - else { - map.put("masked", JSON.getDefault().getMapper().writeValueAsString(masked)); - } + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentText.class); } - if (validationType != null) { - if (isFileTypeOrListOfFiles(validationType)) { - fileTypeFound = true; - } - if (validationType.getClass().equals(java.io.File.class) || - validationType.getClass().equals(Integer.class) || - validationType.getClass().equals(String.class) || - validationType.getClass().isEnum()) { - map.put("validation_type", validationType); - } else if (isListOfFile(validationType)) { - for(int i = 0; i< getListSize(validationType); i++) { - map.put("validation_type[" + i + "]", getFromList(validationType, i)); - } - } - else { - map.put("validation_type", JSON.getDefault().getMapper().writeValueAsString(validationType)); - } + public static SubFormFieldsPerDocumentText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentText.class); } - if (validationCustomRegex != null) { - if (isFileTypeOrListOfFiles(validationCustomRegex)) { - fileTypeFound = true; - } - if (validationCustomRegex.getClass().equals(java.io.File.class) || - validationCustomRegex.getClass().equals(Integer.class) || - validationCustomRegex.getClass().equals(String.class) || - validationCustomRegex.getClass().isEnum()) { - map.put("validation_custom_regex", validationCustomRegex); - } else if (isListOfFile(validationCustomRegex)) { - for(int i = 0; i< getListSize(validationCustomRegex); i++) { - map.put("validation_custom_regex[" + i + "]", getFromList(validationCustomRegex, i)); - } - } - else { - map.put("validation_custom_regex", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegex)); - } + public SubFormFieldsPerDocumentText type(String type) { + this.type = type; + return this; } - if (validationCustomRegexFormatLabel != null) { - if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { - fileTypeFound = true; - } - if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) || - validationCustomRegexFormatLabel.getClass().equals(Integer.class) || - validationCustomRegexFormatLabel.getClass().equals(String.class) || - validationCustomRegexFormatLabel.getClass().isEnum()) { - map.put("validation_custom_regex_format_label", validationCustomRegexFormatLabel); - } else if (isListOfFile(validationCustomRegexFormatLabel)) { - for(int i = 0; i< getListSize(validationCustomRegexFormatLabel); i++) { - map.put("validation_custom_regex_format_label[" + i + "]", getFromList(validationCustomRegexFormatLabel, i)); - } - } - else { - map.put("validation_custom_regex_format_label", JSON.getDefault().getMapper().writeValueAsString(validationCustomRegexFormatLabel)); - } + /** + * A text input field. Use the `SubFormFieldsPerDocumentText` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (content != null) { - if (isFileTypeOrListOfFiles(content)) { - fileTypeFound = true; - } - if (content.getClass().equals(java.io.File.class) || - content.getClass().equals(Integer.class) || - content.getClass().equals(String.class) || - content.getClass().isEnum()) { - map.put("content", content); - } else if (isListOfFile(content)) { - for(int i = 0; i< getListSize(content); i++) { - map.put("content[" + i + "]", getFromList(content, i)); - } - } - else { - map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } - } - else { - map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } + public SubFormFieldsPerDocumentText placeholder(String placeholder) { + this.placeholder = placeholder; + return this; } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - if (fontSize.getClass().equals(java.io.File.class) || - fontSize.getClass().equals(Integer.class) || - fontSize.getClass().equals(String.class) || - fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for(int i = 0; i< getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); - } - } - else { - map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } + /** + * Placeholder value for text field. + * + * @return placeholder + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PLACEHOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlaceholder() { + return placeholder; + } + + @JsonProperty(JSON_PROPERTY_PLACEHOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPlaceholder(String placeholder) { + this.placeholder = placeholder; + } + + public SubFormFieldsPerDocumentText autoFillType(String autoFillType) { + this.autoFillType = autoFillType; + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * 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 @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAutoFillType() { + return autoFillType; + } + + @JsonProperty(JSON_PROPERTY_AUTO_FILL_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutoFillType(String autoFillType) { + this.autoFillType = autoFillType; } - return fileTypeFound ? map : new HashMap<>(); - } + public SubFormFieldsPerDocumentText linkId(String linkId) { + this.linkId = 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 @JsonProperty(JSON_PROPERTY_LINK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLinkId() { + return linkId; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + @JsonProperty(JSON_PROPERTY_LINK_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkId(String linkId) { + this.linkId = linkId; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + public SubFormFieldsPerDocumentText masked(Boolean masked) { + this.masked = masked; + return this; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_MASKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMasked() { + return masked; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + @JsonProperty(JSON_PROPERTY_MASKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMasked(Boolean masked) { + this.masked = masked; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + public SubFormFieldsPerDocumentText validationType(ValidationTypeEnum validationType) { + this.validationType = validationType; + return this; + } - /** - * 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"; + /** + * 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 @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ValidationTypeEnum getValidationType() { + return validationType; } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("SubFormFieldsPerDocumentText", SubFormFieldsPerDocumentText.class); - JSON.registerDiscriminator(SubFormFieldsPerDocumentText.class, "type", mappings); - } -} + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationType(ValidationTypeEnum validationType) { + this.validationType = validationType; + } + + public SubFormFieldsPerDocumentText validationCustomRegex(String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + return this; + } + + /** + * Get validationCustomRegex + * + * @return validationCustomRegex + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValidationCustomRegex() { + return validationCustomRegex; + } + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegex(String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + } + + public SubFormFieldsPerDocumentText validationCustomRegexFormatLabel( + String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + return this; + } + + /** + * Get validationCustomRegexFormatLabel + * + * @return validationCustomRegexFormatLabel + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValidationCustomRegexFormatLabel() { + return validationCustomRegexFormatLabel; + } + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegexFormatLabel(String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + } + + public SubFormFieldsPerDocumentText content(String content) { + this.content = content; + return this; + } + + /** + * Content of a `me_now` text field + * + * @return content + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(String content) { + this.content = content; + } + + public SubFormFieldsPerDocumentText fontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; + } + /** + * Font family for the field. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + public SubFormFieldsPerDocumentText fontSize(Integer fontSize) { + this.fontSize = 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 @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFontSize() { + return fontSize; + } + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(Integer fontSize) { + this.fontSize = fontSize; + } + + /** Return true if this SubFormFieldsPerDocumentText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubFormFieldsPerDocumentText subFormFieldsPerDocumentText = + (SubFormFieldsPerDocumentText) o; + return Objects.equals(this.type, subFormFieldsPerDocumentText.type) + && Objects.equals(this.placeholder, subFormFieldsPerDocumentText.placeholder) + && Objects.equals(this.autoFillType, subFormFieldsPerDocumentText.autoFillType) + && Objects.equals(this.linkId, subFormFieldsPerDocumentText.linkId) + && Objects.equals(this.masked, subFormFieldsPerDocumentText.masked) + && Objects.equals(this.validationType, subFormFieldsPerDocumentText.validationType) + && Objects.equals( + this.validationCustomRegex, + subFormFieldsPerDocumentText.validationCustomRegex) + && Objects.equals( + this.validationCustomRegexFormatLabel, + subFormFieldsPerDocumentText.validationCustomRegexFormatLabel) + && Objects.equals(this.content, subFormFieldsPerDocumentText.content) + && Objects.equals(this.fontFamily, subFormFieldsPerDocumentText.fontFamily) + && Objects.equals(this.fontSize, subFormFieldsPerDocumentText.fontSize) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + placeholder, + autoFillType, + linkId, + masked, + validationType, + validationCustomRegex, + validationCustomRegexFormatLabel, + content, + fontFamily, + fontSize, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" placeholder: ").append(toIndentedString(placeholder)).append("\n"); + sb.append(" autoFillType: ").append(toIndentedString(autoFillType)).append("\n"); + sb.append(" linkId: ").append(toIndentedString(linkId)).append("\n"); + sb.append(" masked: ").append(toIndentedString(masked)).append("\n"); + sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); + sb.append(" validationCustomRegex: ") + .append(toIndentedString(validationCustomRegex)) + .append("\n"); + sb.append(" validationCustomRegexFormatLabel: ") + .append(toIndentedString(validationCustomRegexFormatLabel)) + .append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (placeholder != null) { + if (isFileTypeOrListOfFiles(placeholder)) { + fileTypeFound = true; + } + + if (placeholder.getClass().equals(java.io.File.class) + || placeholder.getClass().equals(Integer.class) + || placeholder.getClass().equals(String.class) + || placeholder.getClass().isEnum()) { + map.put("placeholder", placeholder); + } else if (isListOfFile(placeholder)) { + for (int i = 0; i < getListSize(placeholder); i++) { + map.put("placeholder[" + i + "]", getFromList(placeholder, i)); + } + } else { + map.put( + "placeholder", + JSON.getDefault().getMapper().writeValueAsString(placeholder)); + } + } + if (autoFillType != null) { + if (isFileTypeOrListOfFiles(autoFillType)) { + fileTypeFound = true; + } + + if (autoFillType.getClass().equals(java.io.File.class) + || autoFillType.getClass().equals(Integer.class) + || autoFillType.getClass().equals(String.class) + || autoFillType.getClass().isEnum()) { + map.put("auto_fill_type", autoFillType); + } else if (isListOfFile(autoFillType)) { + for (int i = 0; i < getListSize(autoFillType); i++) { + map.put("auto_fill_type[" + i + "]", getFromList(autoFillType, i)); + } + } else { + map.put( + "auto_fill_type", + JSON.getDefault().getMapper().writeValueAsString(autoFillType)); + } + } + if (linkId != null) { + if (isFileTypeOrListOfFiles(linkId)) { + fileTypeFound = true; + } + + if (linkId.getClass().equals(java.io.File.class) + || linkId.getClass().equals(Integer.class) + || linkId.getClass().equals(String.class) + || linkId.getClass().isEnum()) { + map.put("link_id", linkId); + } else if (isListOfFile(linkId)) { + for (int i = 0; i < getListSize(linkId); i++) { + map.put("link_id[" + i + "]", getFromList(linkId, i)); + } + } else { + map.put("link_id", JSON.getDefault().getMapper().writeValueAsString(linkId)); + } + } + if (masked != null) { + if (isFileTypeOrListOfFiles(masked)) { + fileTypeFound = true; + } + + if (masked.getClass().equals(java.io.File.class) + || masked.getClass().equals(Integer.class) + || masked.getClass().equals(String.class) + || masked.getClass().isEnum()) { + map.put("masked", masked); + } else if (isListOfFile(masked)) { + for (int i = 0; i < getListSize(masked); i++) { + map.put("masked[" + i + "]", getFromList(masked, i)); + } + } else { + map.put("masked", JSON.getDefault().getMapper().writeValueAsString(masked)); + } + } + if (validationType != null) { + if (isFileTypeOrListOfFiles(validationType)) { + fileTypeFound = true; + } + + if (validationType.getClass().equals(java.io.File.class) + || validationType.getClass().equals(Integer.class) + || validationType.getClass().equals(String.class) + || validationType.getClass().isEnum()) { + map.put("validation_type", validationType); + } else if (isListOfFile(validationType)) { + for (int i = 0; i < getListSize(validationType); i++) { + map.put("validation_type[" + i + "]", getFromList(validationType, i)); + } + } else { + map.put( + "validation_type", + JSON.getDefault().getMapper().writeValueAsString(validationType)); + } + } + if (validationCustomRegex != null) { + if (isFileTypeOrListOfFiles(validationCustomRegex)) { + fileTypeFound = true; + } + + if (validationCustomRegex.getClass().equals(java.io.File.class) + || validationCustomRegex.getClass().equals(Integer.class) + || validationCustomRegex.getClass().equals(String.class) + || validationCustomRegex.getClass().isEnum()) { + map.put("validation_custom_regex", validationCustomRegex); + } else if (isListOfFile(validationCustomRegex)) { + for (int i = 0; i < getListSize(validationCustomRegex); i++) { + map.put( + "validation_custom_regex[" + i + "]", + getFromList(validationCustomRegex, i)); + } + } else { + map.put( + "validation_custom_regex", + JSON.getDefault() + .getMapper() + .writeValueAsString(validationCustomRegex)); + } + } + if (validationCustomRegexFormatLabel != null) { + if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { + fileTypeFound = true; + } + + if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) + || validationCustomRegexFormatLabel.getClass().equals(Integer.class) + || validationCustomRegexFormatLabel.getClass().equals(String.class) + || validationCustomRegexFormatLabel.getClass().isEnum()) { + map.put( + "validation_custom_regex_format_label", + validationCustomRegexFormatLabel); + } else if (isListOfFile(validationCustomRegexFormatLabel)) { + for (int i = 0; i < getListSize(validationCustomRegexFormatLabel); i++) { + map.put( + "validation_custom_regex_format_label[" + i + "]", + getFromList(validationCustomRegexFormatLabel, i)); + } + } else { + map.put( + "validation_custom_regex_format_label", + JSON.getDefault() + .getMapper() + .writeValueAsString(validationCustomRegexFormatLabel)); + } + } + if (content != null) { + if (isFileTypeOrListOfFiles(content)) { + fileTypeFound = true; + } + + if (content.getClass().equals(java.io.File.class) + || content.getClass().equals(Integer.class) + || content.getClass().equals(String.class) + || content.getClass().isEnum()) { + map.put("content", content); + } else if (isListOfFile(content)) { + for (int i = 0; i < getListSize(content); i++) { + map.put("content[" + i + "]", getFromList(content, i)); + } + } else { + map.put("content", JSON.getDefault().getMapper().writeValueAsString(content)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "font_family", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } + + if (fontSize.getClass().equals(java.io.File.class) + || fontSize.getClass().equals(Integer.class) + || fontSize.getClass().equals(String.class) + || fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for (int i = 0; i < getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); + } + } else { + map.put( + "font_size", + JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } + } + } 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java index a023b64..833bfc7 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTextMerge.java @@ -10,350 +10,342 @@ * 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.SubFormFieldsPerDocumentBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `SubFormFieldsPerDocumentBase`. - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text-merge"; - - /** - * Font family for the field. - */ - public enum FontFamilyEnum { - HELVETICA("helvetica"), - - ARIAL("arial"), - - COURIER("courier"), - - CALIBRI("calibri"), - - CAMBRIA("cambria"), - - GEORGIA("georgia"), - - TIMES("times"), - - TREBUCHET("trebuchet"), - - VERDANA("verdana"), - - ROBOTO("roboto"), - - 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"); - - private String value; - - FontFamilyEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text-merge"; + + /** Font family for the field. */ + public enum FontFamilyEnum { + HELVETICA("helvetica"), + + ARIAL("arial"), + + COURIER("courier"), + + CALIBRI("calibri"), + + CAMBRIA("cambria"), + + GEORGIA("georgia"), + + TIMES("times"), + + TREBUCHET("trebuchet"), + + VERDANA("verdana"), + + ROBOTO("roboto"), + + 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"); + + private String value; + + FontFamilyEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FontFamilyEnum fromValue(String value) { + for (FontFamilyEnum b : FontFamilyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; + private FontFamilyEnum fontFamily; + + public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; + private Integer fontSize = 12; + + public SubFormFieldsPerDocumentTextMerge() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubFormFieldsPerDocumentTextMerge init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentTextMerge.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubFormFieldsPerDocumentTextMerge init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubFormFieldsPerDocumentTextMerge.class); } - @JsonCreator - public static FontFamilyEnum fromValue(String value) { - for (FontFamilyEnum b : FontFamilyEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubFormFieldsPerDocumentTextMerge type(String type) { + this.type = type; + return this; } - } - - public static final String JSON_PROPERTY_FONT_FAMILY = "font_family"; - private FontFamilyEnum fontFamily; - - public static final String JSON_PROPERTY_FONT_SIZE = "font_size"; - private Integer fontSize = 12; - - public SubFormFieldsPerDocumentTextMerge() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubFormFieldsPerDocumentTextMerge init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubFormFieldsPerDocumentTextMerge.class); - } - - static public SubFormFieldsPerDocumentTextMerge init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubFormFieldsPerDocumentTextMerge.class - ); - } - - public SubFormFieldsPerDocumentTextMerge type(String type) { - this.type = type; - return this; - } - - /** - * A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public SubFormFieldsPerDocumentTextMerge fontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family for the field. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public FontFamilyEnum getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(FontFamilyEnum fontFamily) { - this.fontFamily = fontFamily; - } - - - public SubFormFieldsPerDocumentTextMerge fontSize(Integer fontSize) { - this.fontSize = 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 - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getFontSize() { - return fontSize; - } - - - @JsonProperty(JSON_PROPERTY_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontSize(Integer fontSize) { - this.fontSize = fontSize; - } - - - /** - * Return true if this SubFormFieldsPerDocumentTextMerge object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * A text field that has default text set using pre-filled data. Use the + * `SubFormFieldsPerDocumentTextMerge` class. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - SubFormFieldsPerDocumentTextMerge subFormFieldsPerDocumentTextMerge = (SubFormFieldsPerDocumentTextMerge) o; - return Objects.equals(this.type, subFormFieldsPerDocumentTextMerge.type) && - Objects.equals(this.fontFamily, subFormFieldsPerDocumentTextMerge.fontFamily) && - Objects.equals(this.fontSize, subFormFieldsPerDocumentTextMerge.fontSize) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, fontFamily, fontSize, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubFormFieldsPerDocumentTextMerge {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public SubFormFieldsPerDocumentTextMerge fontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + return this; } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("font_family", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("font_family[" + i + "]", getFromList(fontFamily, i)); - } + /** + * Font family for the field. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FontFamilyEnum getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(FontFamilyEnum fontFamily) { + this.fontFamily = fontFamily; + } + + public SubFormFieldsPerDocumentTextMerge fontSize(Integer fontSize) { + this.fontSize = 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 @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getFontSize() { + return fontSize; + } + + @JsonProperty(JSON_PROPERTY_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontSize(Integer fontSize) { + this.fontSize = fontSize; + } + + /** Return true if this SubFormFieldsPerDocumentTextMerge object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("font_family", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubFormFieldsPerDocumentTextMerge subFormFieldsPerDocumentTextMerge = + (SubFormFieldsPerDocumentTextMerge) o; + return Objects.equals(this.type, subFormFieldsPerDocumentTextMerge.type) + && Objects.equals(this.fontFamily, subFormFieldsPerDocumentTextMerge.fontFamily) + && Objects.equals(this.fontSize, subFormFieldsPerDocumentTextMerge.fontSize) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fontFamily, fontSize, super.hashCode()); } - if (fontSize != null) { - if (isFileTypeOrListOfFiles(fontSize)) { - fileTypeFound = true; - } - if (fontSize.getClass().equals(java.io.File.class) || - fontSize.getClass().equals(Integer.class) || - fontSize.getClass().equals(String.class) || - fontSize.getClass().isEnum()) { - map.put("font_size", fontSize); - } else if (isListOfFile(fontSize)) { - for(int i = 0; i< getListSize(fontSize); i++) { - map.put("font_size[" + i + "]", getFromList(fontSize, i)); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubFormFieldsPerDocumentTextMerge {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" fontSize: ").append(toIndentedString(fontSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("font_family", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("font_family[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "font_family", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (fontSize != null) { + if (isFileTypeOrListOfFiles(fontSize)) { + fileTypeFound = true; + } + + if (fontSize.getClass().equals(java.io.File.class) + || fontSize.getClass().equals(Integer.class) + || fontSize.getClass().equals(String.class) + || fontSize.getClass().isEnum()) { + map.put("font_size", fontSize); + } else if (isListOfFile(fontSize)) { + for (int i = 0; i < getListSize(fontSize); i++) { + map.put("font_size[" + i + "]", getFromList(fontSize, i)); + } + } else { + map.put( + "font_size", + JSON.getDefault().getMapper().writeValueAsString(fontSize)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("font_size", JSON.getDefault().getMapper().writeValueAsString(fontSize)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put("SubFormFieldsPerDocumentTextMerge", SubFormFieldsPerDocumentTextMerge.class); + JSON.registerDiscriminator(SubFormFieldsPerDocumentTextMerge.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java index 2b9d9c0..7b3d7e5 100644 --- a/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java +++ b/src/main/java/com/dropbox/sign/model/SubFormFieldsPerDocumentTypeEnum.java @@ -10,70 +10,56 @@ * 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 SubFormFieldsPerDocumentTypeEnum - */ +/** Gets or Sets SubFormFieldsPerDocumentTypeEnum */ public enum SubFormFieldsPerDocumentTypeEnum { - - 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"); - - private String value; - - SubFormFieldsPerDocumentTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SubFormFieldsPerDocumentTypeEnum fromValue(String value) { - for (SubFormFieldsPerDocumentTypeEnum b : SubFormFieldsPerDocumentTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } + 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"); + + private String value; + + SubFormFieldsPerDocumentTypeEnum(String value) { + this.value = value; } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubFormFieldsPerDocumentTypeEnum fromValue(String value) { + for (SubFormFieldsPerDocumentTypeEnum b : SubFormFieldsPerDocumentTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/dropbox/sign/model/SubMergeField.java b/src/main/java/com/dropbox/sign/model/SubMergeField.java index 2ff60ac..53accb1 100644 --- a/src/main/java/com/dropbox/sign/model/SubMergeField.java +++ b/src/main/java/com/dropbox/sign/model/SubMergeField.java @@ -10,254 +10,238 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubMergeField - */ -@JsonPropertyOrder({ - 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) +/** SubMergeField */ +@JsonPropertyOrder({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) public class SubMergeField { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** The type of merge field. */ + public enum TypeEnum { + TEXT("text"), + + CHECKBOX("checkbox"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } - /** - * The type of merge field. - */ - public enum TypeEnum { - TEXT("text"), - - CHECKBOX("checkbox"); + @JsonValue + public String getValue() { + return value; + } - private String value; + @Override + public String toString() { + return String.valueOf(value); + } - TypeEnum(String value) { - this.value = value; + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public SubMergeField() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubMergeField init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubMergeField.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubMergeField init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubMergeField.class); } - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubMergeField name(String name) { + this.name = name; + return this; } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; - - public SubMergeField() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubMergeField init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubMergeField.class); - } - - static public SubMergeField init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubMergeField.class - ); - } - - public SubMergeField name(String name) { - this.name = name; - return this; - } - - /** - * The name of the merge field. Must be unique. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubMergeField type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of merge field. - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TypeEnum getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(TypeEnum type) { - this.type = type; - } - - - /** - * Return true if this SubMergeField object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * The name of the merge field. Must be unique. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; } - SubMergeField subMergeField = (SubMergeField) o; - return Objects.equals(this.name, subMergeField.name) && - Objects.equals(this.type, subMergeField.type); - } - - @Override - public int hashCode() { - return Objects.hash(name, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubMergeField {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public SubMergeField type(TypeEnum type) { + this.type = type; + return this; } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + /** + * The type of merge field. + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TypeEnum getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + + /** Return true if this SubMergeField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubMergeField subMergeField = (SubMergeField) o; + return Objects.equals(this.name, subMergeField.name) + && Objects.equals(this.type, subMergeField.type); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, type); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubMergeField {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubOAuth.java b/src/main/java/com/dropbox/sign/model/SubOAuth.java index b598b71..015efbc 100644 --- a/src/main/java/com/dropbox/sign/model/SubOAuth.java +++ b/src/main/java/com/dropbox/sign/model/SubOAuth.java @@ -10,276 +10,262 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * OAuth related parameters. - */ -@JsonPropertyOrder({ - 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) +/** OAuth related parameters. */ +@JsonPropertyOrder({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) public class SubOAuth { - public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; - private String callbackUrl; - - /** - * Gets or Sets scopes - */ - public enum ScopesEnum { - 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(""); - - private String value; - - ScopesEnum(String value) { - this.value = value; + public static final String JSON_PROPERTY_CALLBACK_URL = "callback_url"; + private String callbackUrl; + + /** Gets or Sets scopes */ + public enum ScopesEnum { + 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(""); + + private String value; + + ScopesEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ScopesEnum fromValue(String value) { + for (ScopesEnum b : ScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_SCOPES = "scopes"; + private List scopes = null; + + public SubOAuth() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubOAuth init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubOAuth.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubOAuth init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubOAuth.class); } - @JsonCreator - public static ScopesEnum fromValue(String value) { - for (ScopesEnum b : ScopesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubOAuth callbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + return this; } - } - - public static final String JSON_PROPERTY_SCOPES = "scopes"; - private List scopes = null; - - public SubOAuth() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubOAuth init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubOAuth.class); - } - - static public SubOAuth init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubOAuth.class - ); - } - - public SubOAuth callbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - return this; - } - - /** - * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) - * @return callbackUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCallbackUrl() { - return callbackUrl; - } - - - @JsonProperty(JSON_PROPERTY_CALLBACK_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - - public SubOAuth scopes(List scopes) { - this.scopes = scopes; - return this; - } - - public SubOAuth addScopesItem(ScopesEnum scopesItem) { - if (this.scopes == null) { - this.scopes = new ArrayList<>(); + + /** + * The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is + * provided) + * + * @return callbackUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallbackUrl() { + return callbackUrl; } - this.scopes.add(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 - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getScopes() { - return scopes; - } - - - @JsonProperty(JSON_PROPERTY_SCOPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScopes(List scopes) { - this.scopes = scopes; - } - - - /** - * Return true if this SubOAuth object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + @JsonProperty(JSON_PROPERTY_CALLBACK_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; } - if (o == null || getClass() != o.getClass()) { - return false; + + public SubOAuth scopes(List scopes) { + this.scopes = scopes; + return this; } - SubOAuth subOAuth = (SubOAuth) o; - return Objects.equals(this.callbackUrl, subOAuth.callbackUrl) && - Objects.equals(this.scopes, subOAuth.scopes); - } - - @Override - public int hashCode() { - return Objects.hash(callbackUrl, scopes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubOAuth {\n"); - sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); - sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (callbackUrl != null) { - if (isFileTypeOrListOfFiles(callbackUrl)) { - fileTypeFound = true; - } - if (callbackUrl.getClass().equals(java.io.File.class) || - callbackUrl.getClass().equals(Integer.class) || - callbackUrl.getClass().equals(String.class) || - callbackUrl.getClass().isEnum()) { - map.put("callback_url", callbackUrl); - } else if (isListOfFile(callbackUrl)) { - for(int i = 0; i< getListSize(callbackUrl); i++) { - map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); - } - } - else { - map.put("callback_url", JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + public SubOAuth addScopesItem(ScopesEnum scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); } + this.scopes.add(scopesItem); + return this; } - if (scopes != null) { - if (isFileTypeOrListOfFiles(scopes)) { - fileTypeFound = true; - } - if (scopes.getClass().equals(java.io.File.class) || - scopes.getClass().equals(Integer.class) || - scopes.getClass().equals(String.class) || - scopes.getClass().isEnum()) { - map.put("scopes", scopes); - } else if (isListOfFile(scopes)) { - for(int i = 0; i< getListSize(scopes); i++) { - map.put("scopes[" + i + "]", getFromList(scopes, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getScopes() { + return scopes; + } + + @JsonProperty(JSON_PROPERTY_SCOPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScopes(List scopes) { + this.scopes = scopes; + } + + /** Return true if this SubOAuth object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubOAuth subOAuth = (SubOAuth) o; + return Objects.equals(this.callbackUrl, subOAuth.callbackUrl) + && Objects.equals(this.scopes, subOAuth.scopes); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(callbackUrl, scopes); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubOAuth {\n"); + sb.append(" callbackUrl: ").append(toIndentedString(callbackUrl)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (callbackUrl != null) { + if (isFileTypeOrListOfFiles(callbackUrl)) { + fileTypeFound = true; + } + + if (callbackUrl.getClass().equals(java.io.File.class) + || callbackUrl.getClass().equals(Integer.class) + || callbackUrl.getClass().equals(String.class) + || callbackUrl.getClass().isEnum()) { + map.put("callback_url", callbackUrl); + } else if (isListOfFile(callbackUrl)) { + for (int i = 0; i < getListSize(callbackUrl); i++) { + map.put("callback_url[" + i + "]", getFromList(callbackUrl, i)); + } + } else { + map.put( + "callback_url", + JSON.getDefault().getMapper().writeValueAsString(callbackUrl)); + } + } + if (scopes != null) { + if (isFileTypeOrListOfFiles(scopes)) { + fileTypeFound = true; + } + + if (scopes.getClass().equals(java.io.File.class) + || scopes.getClass().equals(Integer.class) + || scopes.getClass().equals(String.class) + || scopes.getClass().isEnum()) { + map.put("scopes", scopes); + } else if (isListOfFile(scopes)) { + for (int i = 0; i < getListSize(scopes); i++) { + map.put("scopes[" + i + "]", getFromList(scopes, i)); + } + } else { + map.put("scopes", JSON.getDefault().getMapper().writeValueAsString(scopes)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubOptions.java b/src/main/java/com/dropbox/sign/model/SubOptions.java index d0908c7..c172a1b 100644 --- a/src/main/java/com/dropbox/sign/model/SubOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubOptions.java @@ -10,169 +10,162 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Additional options supported by API App. - */ -@JsonPropertyOrder({ - SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** Additional options supported by API App. */ +@JsonPropertyOrder({SubOptions.JSON_PROPERTY_CAN_INSERT_EVERYWHERE}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubOptions { - public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; - private Boolean canInsertEverywhere = false; - - public SubOptions() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubOptions.class); - } - - static public SubOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubOptions.class - ); - } - - public SubOptions canInsertEverywhere(Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - return this; - } - - /** - * Determines if signers can use \"Insert Everywhere\" when signing a document. - * @return canInsertEverywhere - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getCanInsertEverywhere() { - return canInsertEverywhere; - } - - - @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanInsertEverywhere(Boolean canInsertEverywhere) { - this.canInsertEverywhere = canInsertEverywhere; - } - - - /** - * Return true if this SubOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_CAN_INSERT_EVERYWHERE = "can_insert_everywhere"; + private Boolean canInsertEverywhere = false; + + public SubOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubOptions.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static SubOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubOptions.class); } - SubOptions subOptions = (SubOptions) o; - return Objects.equals(this.canInsertEverywhere, subOptions.canInsertEverywhere); - } - - @Override - public int hashCode() { - return Objects.hash(canInsertEverywhere); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubOptions {\n"); - sb.append(" canInsertEverywhere: ").append(toIndentedString(canInsertEverywhere)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (canInsertEverywhere != null) { - if (isFileTypeOrListOfFiles(canInsertEverywhere)) { - fileTypeFound = true; - } - if (canInsertEverywhere.getClass().equals(java.io.File.class) || - canInsertEverywhere.getClass().equals(Integer.class) || - canInsertEverywhere.getClass().equals(String.class) || - canInsertEverywhere.getClass().isEnum()) { - map.put("can_insert_everywhere", canInsertEverywhere); - } else if (isListOfFile(canInsertEverywhere)) { - for(int i = 0; i< getListSize(canInsertEverywhere); i++) { - map.put("can_insert_everywhere[" + i + "]", getFromList(canInsertEverywhere, i)); - } + public SubOptions canInsertEverywhere(Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + return this; + } + + /** + * Determines if signers can use \"Insert Everywhere\" when signing a document. + * + * @return canInsertEverywhere + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanInsertEverywhere() { + return canInsertEverywhere; + } + + @JsonProperty(JSON_PROPERTY_CAN_INSERT_EVERYWHERE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanInsertEverywhere(Boolean canInsertEverywhere) { + this.canInsertEverywhere = canInsertEverywhere; + } + + /** Return true if this SubOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("can_insert_everywhere", JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubOptions subOptions = (SubOptions) o; + return Objects.equals(this.canInsertEverywhere, subOptions.canInsertEverywhere); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(canInsertEverywhere); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubOptions {\n"); + sb.append(" canInsertEverywhere: ") + .append(toIndentedString(canInsertEverywhere)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (canInsertEverywhere != null) { + if (isFileTypeOrListOfFiles(canInsertEverywhere)) { + fileTypeFound = true; + } + + if (canInsertEverywhere.getClass().equals(java.io.File.class) + || canInsertEverywhere.getClass().equals(Integer.class) + || canInsertEverywhere.getClass().equals(String.class) + || canInsertEverywhere.getClass().isEnum()) { + map.put("can_insert_everywhere", canInsertEverywhere); + } else if (isListOfFile(canInsertEverywhere)) { + for (int i = 0; i < getListSize(canInsertEverywhere); i++) { + map.put( + "can_insert_everywhere[" + i + "]", + getFromList(canInsertEverywhere, i)); + } + } else { + map.put( + "can_insert_everywhere", + JSON.getDefault().getMapper().writeValueAsString(canInsertEverywhere)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java index 5d7a978..e6c28a5 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestGroupedSigners.java @@ -10,280 +10,268 @@ * 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.SubSignatureRequestSigner; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubSignatureRequestGroupedSigners - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubSignatureRequestGroupedSigners { - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; - - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = new ArrayList<>(); - - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; - - public SubSignatureRequestGroupedSigners() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubSignatureRequestGroupedSigners init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestGroupedSigners.class); - } - - static public SubSignatureRequestGroupedSigners init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestGroupedSigners.class - ); - } - - public SubSignatureRequestGroupedSigners group(String group) { - this.group = group; - return this; - } - - /** - * The name of the group. - * @return group - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setGroup(String group) { - this.group = group; - } - - - public SubSignatureRequestGroupedSigners signers(List signers) { - this.signers = signers; - return this; - } - - public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = new ArrayList<>(); + + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; + + public SubSignatureRequestGroupedSigners() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubSignatureRequestGroupedSigners init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestGroupedSigners.class); } - 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 - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public SubSignatureRequestGroupedSigners order(Integer order) { - this.order = order; - return this; - } - - /** - * The order the group is required to sign in. Use this instead of Signer-level `order`. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOrder() { - return order; - } - - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } - - - /** - * Return true if this SubSignatureRequestGroupedSigners object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static SubSignatureRequestGroupedSigners init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestGroupedSigners.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public SubSignatureRequestGroupedSigners group(String group) { + this.group = group; + return this; } - SubSignatureRequestGroupedSigners subSignatureRequestGroupedSigners = (SubSignatureRequestGroupedSigners) o; - return Objects.equals(this.group, subSignatureRequestGroupedSigners.group) && - Objects.equals(this.signers, subSignatureRequestGroupedSigners.signers) && - Objects.equals(this.order, subSignatureRequestGroupedSigners.order); - } - - @Override - public int hashCode() { - return Objects.hash(group, signers, order); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestGroupedSigners {\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } - } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); - } + /** + * The name of the group. + * + * @return group + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getGroup() { + return group; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setGroup(String group) { + this.group = group; + } + + public SubSignatureRequestGroupedSigners signers(List signers) { + this.signers = signers; + return this; } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; + + public SubSignatureRequestGroupedSigners addSignersItem(SubSignatureRequestSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; + } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSigners(List signers) { + this.signers = signers; + } + + public SubSignatureRequestGroupedSigners order(Integer order) { + this.order = order; + return this; + } + + /** + * The order the group is required to sign in. Use this instead of Signer-level + * `order`. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; + } + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + /** Return true if this SubSignatureRequestGroupedSigners object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubSignatureRequestGroupedSigners subSignatureRequestGroupedSigners = + (SubSignatureRequestGroupedSigners) o; + return Objects.equals(this.group, subSignatureRequestGroupedSigners.group) + && Objects.equals(this.signers, subSignatureRequestGroupedSigners.signers) + && Objects.equals(this.order, subSignatureRequestGroupedSigners.order); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(group, signers, order); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestGroupedSigners {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java index 9fba0ef..a110601 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestSigner.java @@ -10,454 +10,451 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubSignatureRequestSigner - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubSignatureRequestSigner { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; - public static final String JSON_PROPERTY_PIN = "pin"; - private String pin; + public static final String JSON_PROPERTY_PIN = "pin"; + private String pin; - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - private String smsPhoneNumber; + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + private String smsPhoneNumber; - /** - * 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). - */ - public enum SmsPhoneNumberTypeEnum { - AUTHENTICATION("authentication"), - - DELIVERY("delivery"); + /** + * 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). + */ + public enum SmsPhoneNumberTypeEnum { + AUTHENTICATION("authentication"), + + DELIVERY("delivery"); + + private String value; + + SmsPhoneNumberTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - private String value; + @Override + public String toString() { + return String.valueOf(value); + } - SmsPhoneNumberTypeEnum(String value) { - this.value = value; + @JsonCreator + public static SmsPhoneNumberTypeEnum fromValue(String value) { + for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; + private SmsPhoneNumberTypeEnum smsPhoneNumberType; + + public SubSignatureRequestSigner() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubSignatureRequestSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestSigner.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubSignatureRequestSigner init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestSigner.class); } - @JsonCreator - public static SmsPhoneNumberTypeEnum fromValue(String value) { - for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubSignatureRequestSigner name(String name) { + this.name = name; + return this; } - } - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; - private SmsPhoneNumberTypeEnum smsPhoneNumberType; - - public SubSignatureRequestSigner() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubSignatureRequestSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestSigner.class); - } - - static public SubSignatureRequestSigner init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestSigner.class - ); - } - - public SubSignatureRequestSigner name(String name) { - this.name = name; - return this; - } - - /** - * The name of the signer. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubSignatureRequestSigner emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - public SubSignatureRequestSigner order(Integer order) { - this.order = order; - return this; - } - - /** - * The order the signer is required to sign in. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOrder() { - return order; - } - - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } - - - public SubSignatureRequestSigner pin(String pin) { - this.pin = pin; - return this; - } - - /** - * The 4- to 12-character access code that will secure this signer's signature page. - * @return pin - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPin() { - return pin; - } - - - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPin(String pin) { - this.pin = pin; - } - - - public SubSignatureRequestSigner smsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = 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 - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSmsPhoneNumber() { - return smsPhoneNumber; - } - - - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - } - - - public SubSignatureRequestSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - 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 - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { - return smsPhoneNumberType; - } - - - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - } - - - /** - * Return true if this SubSignatureRequestSigner object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * The name of the signer. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; } - SubSignatureRequestSigner subSignatureRequestSigner = (SubSignatureRequestSigner) o; - return Objects.equals(this.name, subSignatureRequestSigner.name) && - Objects.equals(this.emailAddress, subSignatureRequestSigner.emailAddress) && - Objects.equals(this.order, subSignatureRequestSigner.order) && - Objects.equals(this.pin, subSignatureRequestSigner.pin) && - Objects.equals(this.smsPhoneNumber, subSignatureRequestSigner.smsPhoneNumber) && - Objects.equals(this.smsPhoneNumberType, subSignatureRequestSigner.smsPhoneNumberType); - } - - @Override - public int hashCode() { - return Objects.hash(name, emailAddress, order, pin, smsPhoneNumber, smsPhoneNumberType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestSigner {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" smsPhoneNumberType: ").append(toIndentedString(smsPhoneNumberType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public SubSignatureRequestSigner emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - 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)); - } + /** + * The email address of the signer. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - if (pin != null) { - if (isFileTypeOrListOfFiles(pin)) { - fileTypeFound = true; - } - if (pin.getClass().equals(java.io.File.class) || - pin.getClass().equals(Integer.class) || - pin.getClass().equals(String.class) || - pin.getClass().isEnum()) { - map.put("pin", pin); - } else if (isListOfFile(pin)) { - for(int i = 0; i< getListSize(pin); i++) { - map.put("pin[" + i + "]", getFromList(pin, i)); - } - } - else { - map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); - } + public SubSignatureRequestSigner order(Integer order) { + this.order = order; + return this; } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - if (smsPhoneNumber.getClass().equals(java.io.File.class) || - smsPhoneNumber.getClass().equals(Integer.class) || - smsPhoneNumber.getClass().equals(String.class) || - smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for(int i = 0; i< getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } - else { - map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } + /** + * The order the signer is required to sign in. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; } - if (smsPhoneNumberType != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { - fileTypeFound = true; - } - if (smsPhoneNumberType.getClass().equals(java.io.File.class) || - smsPhoneNumberType.getClass().equals(Integer.class) || - smsPhoneNumberType.getClass().equals(String.class) || - smsPhoneNumberType.getClass().isEnum()) { - map.put("sms_phone_number_type", smsPhoneNumberType); - } else if (isListOfFile(smsPhoneNumberType)) { - for(int i = 0; i< getListSize(smsPhoneNumberType); i++) { - map.put("sms_phone_number_type[" + i + "]", getFromList(smsPhoneNumberType, i)); - } + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + public SubSignatureRequestSigner pin(String pin) { + this.pin = pin; + return this; + } + + /** + * The 4- to 12-character access code that will secure this signer's signature page. + * + * @return pin + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPin() { + return pin; + } + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPin(String pin) { + this.pin = pin; + } + + public SubSignatureRequestSigner smsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = 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 @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + public SubSignatureRequestSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + 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 @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { + return smsPhoneNumberType; + } + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + } + + /** Return true if this SubSignatureRequestSigner object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("sms_phone_number_type", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubSignatureRequestSigner subSignatureRequestSigner = (SubSignatureRequestSigner) o; + return Objects.equals(this.name, subSignatureRequestSigner.name) + && Objects.equals(this.emailAddress, subSignatureRequestSigner.emailAddress) + && Objects.equals(this.order, subSignatureRequestSigner.order) + && Objects.equals(this.pin, subSignatureRequestSigner.pin) + && Objects.equals(this.smsPhoneNumber, subSignatureRequestSigner.smsPhoneNumber) + && Objects.equals( + this.smsPhoneNumberType, subSignatureRequestSigner.smsPhoneNumberType); + } + + @Override + public int hashCode() { + return Objects.hash(name, emailAddress, order, pin, smsPhoneNumber, smsPhoneNumberType); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestSigner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" smsPhoneNumberType: ") + .append(toIndentedString(smsPhoneNumberType)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + 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)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + if (pin != null) { + if (isFileTypeOrListOfFiles(pin)) { + fileTypeFound = true; + } + + if (pin.getClass().equals(java.io.File.class) + || pin.getClass().equals(Integer.class) + || pin.getClass().equals(String.class) + || pin.getClass().isEnum()) { + map.put("pin", pin); + } else if (isListOfFile(pin)) { + for (int i = 0; i < getListSize(pin); i++) { + map.put("pin[" + i + "]", getFromList(pin, i)); + } + } else { + map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); + } + } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } + + if (smsPhoneNumber.getClass().equals(java.io.File.class) + || smsPhoneNumber.getClass().equals(Integer.class) + || smsPhoneNumber.getClass().equals(String.class) + || smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for (int i = 0; i < getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } + } else { + map.put( + "sms_phone_number", + JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); + } + } + if (smsPhoneNumberType != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { + fileTypeFound = true; + } + + if (smsPhoneNumberType.getClass().equals(java.io.File.class) + || smsPhoneNumberType.getClass().equals(Integer.class) + || smsPhoneNumberType.getClass().equals(String.class) + || smsPhoneNumberType.getClass().isEnum()) { + map.put("sms_phone_number_type", smsPhoneNumberType); + } else if (isListOfFile(smsPhoneNumberType)) { + for (int i = 0; i < getListSize(smsPhoneNumberType); i++) { + map.put( + "sms_phone_number_type[" + i + "]", + getFromList(smsPhoneNumberType, i)); + } + } else { + map.put( + "sms_phone_number_type", + JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java b/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java index 71fbf6d..1c2b9ee 100644 --- a/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubSignatureRequestTemplateSigner.java @@ -10,454 +10,456 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubSignatureRequestTemplateSigner - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubSignatureRequestTemplateSigner { - public static final String JSON_PROPERTY_ROLE = "role"; - private String role; + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public static final String JSON_PROPERTY_PIN = "pin"; - private String pin; + public static final String JSON_PROPERTY_PIN = "pin"; + private String pin; - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; - private String smsPhoneNumber; + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER = "sms_phone_number"; + private String smsPhoneNumber; - /** - * 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). - */ - public enum SmsPhoneNumberTypeEnum { - AUTHENTICATION("authentication"), - - DELIVERY("delivery"); + /** + * 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). + */ + public enum SmsPhoneNumberTypeEnum { + AUTHENTICATION("authentication"), + + DELIVERY("delivery"); + + private String value; + + SmsPhoneNumberTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - private String value; + @Override + public String toString() { + return String.valueOf(value); + } - SmsPhoneNumberTypeEnum(String value) { - this.value = value; + @JsonCreator + public static SmsPhoneNumberTypeEnum fromValue(String value) { + for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; + private SmsPhoneNumberTypeEnum smsPhoneNumberType; + + public SubSignatureRequestTemplateSigner() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubSignatureRequestTemplateSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSignatureRequestTemplateSigner.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubSignatureRequestTemplateSigner init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubSignatureRequestTemplateSigner.class); } - @JsonCreator - public static SmsPhoneNumberTypeEnum fromValue(String value) { - for (SmsPhoneNumberTypeEnum b : SmsPhoneNumberTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubSignatureRequestTemplateSigner role(String role) { + this.role = role; + return this; } - } - - public static final String JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE = "sms_phone_number_type"; - private SmsPhoneNumberTypeEnum smsPhoneNumberType; - - public SubSignatureRequestTemplateSigner() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubSignatureRequestTemplateSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSignatureRequestTemplateSigner.class); - } - - static public SubSignatureRequestTemplateSigner init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubSignatureRequestTemplateSigner.class - ); - } - - public SubSignatureRequestTemplateSigner role(String role) { - this.role = role; - return this; - } - - /** - * Must match an existing role in chosen Template(s). It's case-sensitive. - * @return role - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getRole() { - return role; - } - - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(String role) { - this.role = role; - } - - - public SubSignatureRequestTemplateSigner name(String name) { - this.name = name; - return this; - } - - /** - * The name of the signer. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubSignatureRequestTemplateSigner emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - public SubSignatureRequestTemplateSigner pin(String pin) { - this.pin = pin; - return this; - } - - /** - * The 4- to 12-character access code that will secure this signer's signature page. - * @return pin - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPin() { - return pin; - } - - - @JsonProperty(JSON_PROPERTY_PIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPin(String pin) { - this.pin = pin; - } - - - public SubSignatureRequestTemplateSigner smsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = 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 - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSmsPhoneNumber() { - return smsPhoneNumber; - } - - - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumber(String smsPhoneNumber) { - this.smsPhoneNumber = smsPhoneNumber; - } - - - public SubSignatureRequestTemplateSigner smsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - 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 - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { - return smsPhoneNumberType; - } - - - @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { - this.smsPhoneNumberType = smsPhoneNumberType; - } - - - /** - * Return true if this SubSignatureRequestTemplateSigner object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * Must match an existing role in chosen Template(s). It's case-sensitive. + * + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRole() { + return role; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(String role) { + this.role = role; } - SubSignatureRequestTemplateSigner subSignatureRequestTemplateSigner = (SubSignatureRequestTemplateSigner) o; - return Objects.equals(this.role, subSignatureRequestTemplateSigner.role) && - Objects.equals(this.name, subSignatureRequestTemplateSigner.name) && - Objects.equals(this.emailAddress, subSignatureRequestTemplateSigner.emailAddress) && - Objects.equals(this.pin, subSignatureRequestTemplateSigner.pin) && - Objects.equals(this.smsPhoneNumber, subSignatureRequestTemplateSigner.smsPhoneNumber) && - Objects.equals(this.smsPhoneNumberType, subSignatureRequestTemplateSigner.smsPhoneNumberType); - } - - @Override - public int hashCode() { - return Objects.hash(role, name, emailAddress, pin, smsPhoneNumber, smsPhoneNumberType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSignatureRequestTemplateSigner {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); - sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); - sb.append(" smsPhoneNumberType: ").append(toIndentedString(smsPhoneNumberType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } + public SubSignatureRequestTemplateSigner name(String name) { + this.name = name; + return this; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + /** + * The name of the signer. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - 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)); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; } - if (pin != null) { - if (isFileTypeOrListOfFiles(pin)) { - fileTypeFound = true; - } - if (pin.getClass().equals(java.io.File.class) || - pin.getClass().equals(Integer.class) || - pin.getClass().equals(String.class) || - pin.getClass().isEnum()) { - map.put("pin", pin); - } else if (isListOfFile(pin)) { - for(int i = 0; i< getListSize(pin); i++) { - map.put("pin[" + i + "]", getFromList(pin, i)); - } - } - else { - map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); - } + public SubSignatureRequestTemplateSigner emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (smsPhoneNumber != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumber)) { - fileTypeFound = true; - } - if (smsPhoneNumber.getClass().equals(java.io.File.class) || - smsPhoneNumber.getClass().equals(Integer.class) || - smsPhoneNumber.getClass().equals(String.class) || - smsPhoneNumber.getClass().isEnum()) { - map.put("sms_phone_number", smsPhoneNumber); - } else if (isListOfFile(smsPhoneNumber)) { - for(int i = 0; i< getListSize(smsPhoneNumber); i++) { - map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); - } - } - else { - map.put("sms_phone_number", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); - } + /** + * The email address of the signer. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; } - if (smsPhoneNumberType != null) { - if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { - fileTypeFound = true; - } - if (smsPhoneNumberType.getClass().equals(java.io.File.class) || - smsPhoneNumberType.getClass().equals(Integer.class) || - smsPhoneNumberType.getClass().equals(String.class) || - smsPhoneNumberType.getClass().isEnum()) { - map.put("sms_phone_number_type", smsPhoneNumberType); - } else if (isListOfFile(smsPhoneNumberType)) { - for(int i = 0; i< getListSize(smsPhoneNumberType); i++) { - map.put("sms_phone_number_type[" + i + "]", getFromList(smsPhoneNumberType, i)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public SubSignatureRequestTemplateSigner pin(String pin) { + this.pin = pin; + return this; + } + + /** + * The 4- to 12-character access code that will secure this signer's signature page. + * + * @return pin + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPin() { + return pin; + } + + @JsonProperty(JSON_PROPERTY_PIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPin(String pin) { + this.pin = pin; + } + + public SubSignatureRequestTemplateSigner smsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = 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 @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmsPhoneNumber() { + return smsPhoneNumber; + } + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumber(String smsPhoneNumber) { + this.smsPhoneNumber = smsPhoneNumber; + } + + public SubSignatureRequestTemplateSigner smsPhoneNumberType( + SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + 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 @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SmsPhoneNumberTypeEnum getSmsPhoneNumberType() { + return smsPhoneNumberType; + } + + @JsonProperty(JSON_PROPERTY_SMS_PHONE_NUMBER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsPhoneNumberType(SmsPhoneNumberTypeEnum smsPhoneNumberType) { + this.smsPhoneNumberType = smsPhoneNumberType; + } + + /** Return true if this SubSignatureRequestTemplateSigner object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("sms_phone_number_type", JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubSignatureRequestTemplateSigner subSignatureRequestTemplateSigner = + (SubSignatureRequestTemplateSigner) o; + return Objects.equals(this.role, subSignatureRequestTemplateSigner.role) + && Objects.equals(this.name, subSignatureRequestTemplateSigner.name) + && Objects.equals(this.emailAddress, subSignatureRequestTemplateSigner.emailAddress) + && Objects.equals(this.pin, subSignatureRequestTemplateSigner.pin) + && Objects.equals( + this.smsPhoneNumber, subSignatureRequestTemplateSigner.smsPhoneNumber) + && Objects.equals( + this.smsPhoneNumberType, + subSignatureRequestTemplateSigner.smsPhoneNumberType); + } + + @Override + public int hashCode() { + return Objects.hash(role, name, emailAddress, pin, smsPhoneNumber, smsPhoneNumberType); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSignatureRequestTemplateSigner {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" smsPhoneNumber: ").append(toIndentedString(smsPhoneNumber)).append("\n"); + sb.append(" smsPhoneNumberType: ") + .append(toIndentedString(smsPhoneNumberType)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + 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)); + } + } + if (pin != null) { + if (isFileTypeOrListOfFiles(pin)) { + fileTypeFound = true; + } + + if (pin.getClass().equals(java.io.File.class) + || pin.getClass().equals(Integer.class) + || pin.getClass().equals(String.class) + || pin.getClass().isEnum()) { + map.put("pin", pin); + } else if (isListOfFile(pin)) { + for (int i = 0; i < getListSize(pin); i++) { + map.put("pin[" + i + "]", getFromList(pin, i)); + } + } else { + map.put("pin", JSON.getDefault().getMapper().writeValueAsString(pin)); + } + } + if (smsPhoneNumber != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumber)) { + fileTypeFound = true; + } + + if (smsPhoneNumber.getClass().equals(java.io.File.class) + || smsPhoneNumber.getClass().equals(Integer.class) + || smsPhoneNumber.getClass().equals(String.class) + || smsPhoneNumber.getClass().isEnum()) { + map.put("sms_phone_number", smsPhoneNumber); + } else if (isListOfFile(smsPhoneNumber)) { + for (int i = 0; i < getListSize(smsPhoneNumber); i++) { + map.put("sms_phone_number[" + i + "]", getFromList(smsPhoneNumber, i)); + } + } else { + map.put( + "sms_phone_number", + JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumber)); + } + } + if (smsPhoneNumberType != null) { + if (isFileTypeOrListOfFiles(smsPhoneNumberType)) { + fileTypeFound = true; + } + + if (smsPhoneNumberType.getClass().equals(java.io.File.class) + || smsPhoneNumberType.getClass().equals(Integer.class) + || smsPhoneNumberType.getClass().equals(String.class) + || smsPhoneNumberType.getClass().isEnum()) { + map.put("sms_phone_number_type", smsPhoneNumberType); + } else if (isListOfFile(smsPhoneNumberType)) { + for (int i = 0; i < getListSize(smsPhoneNumberType); i++) { + map.put( + "sms_phone_number_type[" + i + "]", + getFromList(smsPhoneNumberType, i)); + } + } else { + map.put( + "sms_phone_number_type", + JSON.getDefault().getMapper().writeValueAsString(smsPhoneNumberType)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubSigningOptions.java b/src/main/java/com/dropbox/sign/model/SubSigningOptions.java index 6429cf6..c1be71e 100644 --- a/src/main/java/com/dropbox/sign/model/SubSigningOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubSigningOptions.java @@ -10,408 +10,388 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubSigningOptions { - /** - * The default type shown (limited to the listed types) - */ - public enum DefaultTypeEnum { - DRAW("draw"), - - PHONE("phone"), - - TYPE("type"), - - UPLOAD("upload"); - - private String value; - - DefaultTypeEnum(String value) { - this.value = value; + /** The default type shown (limited to the listed types) */ + public enum DefaultTypeEnum { + DRAW("draw"), + + PHONE("phone"), + + TYPE("type"), + + UPLOAD("upload"); + + private String value; + + DefaultTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DefaultTypeEnum fromValue(String value) { + for (DefaultTypeEnum b : DefaultTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_DEFAULT_TYPE = "default_type"; + private DefaultTypeEnum defaultType; + + public static final String JSON_PROPERTY_DRAW = "draw"; + private Boolean draw = false; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private Boolean phone = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private Boolean type = false; + + public static final String JSON_PROPERTY_UPLOAD = "upload"; + private Boolean upload = false; + + public SubSigningOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubSigningOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubSigningOptions.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubSigningOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubSigningOptions.class); } - @JsonCreator - public static DefaultTypeEnum fromValue(String value) { - for (DefaultTypeEnum b : DefaultTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubSigningOptions defaultType(DefaultTypeEnum defaultType) { + this.defaultType = defaultType; + return this; } - } - - public static final String JSON_PROPERTY_DEFAULT_TYPE = "default_type"; - private DefaultTypeEnum defaultType; - - public static final String JSON_PROPERTY_DRAW = "draw"; - private Boolean draw = false; - - public static final String JSON_PROPERTY_PHONE = "phone"; - private Boolean phone = false; - public static final String JSON_PROPERTY_TYPE = "type"; - private Boolean type = false; - - public static final String JSON_PROPERTY_UPLOAD = "upload"; - private Boolean upload = false; - - public SubSigningOptions() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubSigningOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubSigningOptions.class); - } - - static public SubSigningOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubSigningOptions.class - ); - } + /** + * The default type shown (limited to the listed types) + * + * @return defaultType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DefaultTypeEnum getDefaultType() { + return defaultType; + } - public SubSigningOptions defaultType(DefaultTypeEnum defaultType) { - this.defaultType = defaultType; - return this; - } - - /** - * The default type shown (limited to the listed types) - * @return defaultType - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public DefaultTypeEnum getDefaultType() { - return defaultType; - } - - - @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDefaultType(DefaultTypeEnum defaultType) { - this.defaultType = defaultType; - } - - - public SubSigningOptions draw(Boolean draw) { - this.draw = draw; - return this; - } - - /** - * Allows drawing the signature - * @return draw - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DRAW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getDraw() { - return draw; - } - - - @JsonProperty(JSON_PROPERTY_DRAW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDraw(Boolean draw) { - this.draw = draw; - } - - - public SubSigningOptions phone(Boolean phone) { - this.phone = phone; - return this; - } - - /** - * Allows using a smartphone to email the signature - * @return phone - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPhone() { - return phone; - } - - - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(Boolean phone) { - this.phone = phone; - } - - - public SubSigningOptions type(Boolean type) { - this.type = type; - return this; - } - - /** - * Allows typing the signature - * @return type - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(Boolean type) { - this.type = type; - } - - - public SubSigningOptions upload(Boolean upload) { - this.upload = upload; - return this; - } - - /** - * Allows uploading the signature - * @return upload - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UPLOAD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUpload() { - return upload; - } - - - @JsonProperty(JSON_PROPERTY_UPLOAD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUpload(Boolean upload) { - this.upload = upload; - } - - - /** - * Return true if this SubSigningOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_DEFAULT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDefaultType(DefaultTypeEnum defaultType) { + this.defaultType = defaultType; } - if (o == null || getClass() != o.getClass()) { - return false; + + public SubSigningOptions draw(Boolean draw) { + this.draw = draw; + return this; } - SubSigningOptions subSigningOptions = (SubSigningOptions) o; - return Objects.equals(this.defaultType, subSigningOptions.defaultType) && - Objects.equals(this.draw, subSigningOptions.draw) && - Objects.equals(this.phone, subSigningOptions.phone) && - Objects.equals(this.type, subSigningOptions.type) && - Objects.equals(this.upload, subSigningOptions.upload); - } - - @Override - public int hashCode() { - return Objects.hash(defaultType, draw, phone, type, upload); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubSigningOptions {\n"); - sb.append(" defaultType: ").append(toIndentedString(defaultType)).append("\n"); - sb.append(" draw: ").append(toIndentedString(draw)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" upload: ").append(toIndentedString(upload)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (defaultType != null) { - if (isFileTypeOrListOfFiles(defaultType)) { - fileTypeFound = true; - } - if (defaultType.getClass().equals(java.io.File.class) || - defaultType.getClass().equals(Integer.class) || - defaultType.getClass().equals(String.class) || - defaultType.getClass().isEnum()) { - map.put("default_type", defaultType); - } else if (isListOfFile(defaultType)) { - for(int i = 0; i< getListSize(defaultType); i++) { - map.put("default_type[" + i + "]", getFromList(defaultType, i)); - } - } - else { - map.put("default_type", JSON.getDefault().getMapper().writeValueAsString(defaultType)); - } + /** + * Allows drawing the signature + * + * @return draw + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DRAW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDraw() { + return draw; } - if (draw != null) { - if (isFileTypeOrListOfFiles(draw)) { - fileTypeFound = true; - } - if (draw.getClass().equals(java.io.File.class) || - draw.getClass().equals(Integer.class) || - draw.getClass().equals(String.class) || - draw.getClass().isEnum()) { - map.put("draw", draw); - } else if (isListOfFile(draw)) { - for(int i = 0; i< getListSize(draw); i++) { - map.put("draw[" + i + "]", getFromList(draw, i)); - } - } - else { - map.put("draw", JSON.getDefault().getMapper().writeValueAsString(draw)); - } + @JsonProperty(JSON_PROPERTY_DRAW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDraw(Boolean draw) { + this.draw = draw; } - if (phone != null) { - if (isFileTypeOrListOfFiles(phone)) { - fileTypeFound = true; - } - if (phone.getClass().equals(java.io.File.class) || - phone.getClass().equals(Integer.class) || - phone.getClass().equals(String.class) || - phone.getClass().isEnum()) { - map.put("phone", phone); - } else if (isListOfFile(phone)) { - for(int i = 0; i< getListSize(phone); i++) { - map.put("phone[" + i + "]", getFromList(phone, i)); - } - } - else { - map.put("phone", JSON.getDefault().getMapper().writeValueAsString(phone)); - } + public SubSigningOptions phone(Boolean phone) { + this.phone = phone; + return this; } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + /** + * Allows using a smartphone to email the signature + * + * @return phone + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPhone() { + return phone; } - if (upload != null) { - if (isFileTypeOrListOfFiles(upload)) { - fileTypeFound = true; - } - if (upload.getClass().equals(java.io.File.class) || - upload.getClass().equals(Integer.class) || - upload.getClass().equals(String.class) || - upload.getClass().isEnum()) { - map.put("upload", upload); - } else if (isListOfFile(upload)) { - for(int i = 0; i< getListSize(upload); i++) { - map.put("upload[" + i + "]", getFromList(upload, i)); - } + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(Boolean phone) { + this.phone = phone; + } + + public SubSigningOptions type(Boolean type) { + this.type = type; + return this; + } + + /** + * Allows typing the signature + * + * @return type + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(Boolean type) { + this.type = type; + } + + public SubSigningOptions upload(Boolean upload) { + this.upload = upload; + return this; + } + + /** + * Allows uploading the signature + * + * @return upload + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUpload() { + return upload; + } + + @JsonProperty(JSON_PROPERTY_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpload(Boolean upload) { + this.upload = upload; + } + + /** Return true if this SubSigningOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("upload", JSON.getDefault().getMapper().writeValueAsString(upload)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubSigningOptions subSigningOptions = (SubSigningOptions) o; + return Objects.equals(this.defaultType, subSigningOptions.defaultType) + && Objects.equals(this.draw, subSigningOptions.draw) + && Objects.equals(this.phone, subSigningOptions.phone) + && Objects.equals(this.type, subSigningOptions.type) + && Objects.equals(this.upload, subSigningOptions.upload); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(defaultType, draw, phone, type, upload); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubSigningOptions {\n"); + sb.append(" defaultType: ").append(toIndentedString(defaultType)).append("\n"); + sb.append(" draw: ").append(toIndentedString(draw)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" upload: ").append(toIndentedString(upload)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (defaultType != null) { + if (isFileTypeOrListOfFiles(defaultType)) { + fileTypeFound = true; + } + + if (defaultType.getClass().equals(java.io.File.class) + || defaultType.getClass().equals(Integer.class) + || defaultType.getClass().equals(String.class) + || defaultType.getClass().isEnum()) { + map.put("default_type", defaultType); + } else if (isListOfFile(defaultType)) { + for (int i = 0; i < getListSize(defaultType); i++) { + map.put("default_type[" + i + "]", getFromList(defaultType, i)); + } + } else { + map.put( + "default_type", + JSON.getDefault().getMapper().writeValueAsString(defaultType)); + } + } + if (draw != null) { + if (isFileTypeOrListOfFiles(draw)) { + fileTypeFound = true; + } + + if (draw.getClass().equals(java.io.File.class) + || draw.getClass().equals(Integer.class) + || draw.getClass().equals(String.class) + || draw.getClass().isEnum()) { + map.put("draw", draw); + } else if (isListOfFile(draw)) { + for (int i = 0; i < getListSize(draw); i++) { + map.put("draw[" + i + "]", getFromList(draw, i)); + } + } else { + map.put("draw", JSON.getDefault().getMapper().writeValueAsString(draw)); + } + } + if (phone != null) { + if (isFileTypeOrListOfFiles(phone)) { + fileTypeFound = true; + } + + if (phone.getClass().equals(java.io.File.class) + || phone.getClass().equals(Integer.class) + || phone.getClass().equals(String.class) + || phone.getClass().isEnum()) { + map.put("phone", phone); + } else if (isListOfFile(phone)) { + for (int i = 0; i < getListSize(phone); i++) { + map.put("phone[" + i + "]", getFromList(phone, i)); + } + } else { + map.put("phone", JSON.getDefault().getMapper().writeValueAsString(phone)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (upload != null) { + if (isFileTypeOrListOfFiles(upload)) { + fileTypeFound = true; + } + + if (upload.getClass().equals(java.io.File.class) + || upload.getClass().equals(Integer.class) + || upload.getClass().equals(String.class) + || upload.getClass().isEnum()) { + map.put("upload", upload); + } else if (isListOfFile(upload)) { + for (int i = 0; i < getListSize(upload); i++) { + map.put("upload[" + i + "]", getFromList(upload, i)); + } + } else { + map.put("upload", JSON.getDefault().getMapper().writeValueAsString(upload)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/SubTeamResponse.java b/src/main/java/com/dropbox/sign/model/SubTeamResponse.java index 1b14dd3..359c32a 100644 --- a/src/main/java/com/dropbox/sign/model/SubTeamResponse.java +++ b/src/main/java/com/dropbox/sign/model/SubTeamResponse.java @@ -10,219 +10,201 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubTeamResponse - */ -@JsonPropertyOrder({ - 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) +/** SubTeamResponse */ +@JsonPropertyOrder({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) public class SubTeamResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - private String teamId; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public SubTeamResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubTeamResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubTeamResponse.class); - } - - static public SubTeamResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubTeamResponse.class - ); - } - - public SubTeamResponse teamId(String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * @return teamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTeamId() { - return teamId; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - - public SubTeamResponse name(String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this SubTeamResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubTeamResponse subTeamResponse = (SubTeamResponse) o; - return Objects.equals(this.teamId, subTeamResponse.teamId) && - Objects.equals(this.name, subTeamResponse.name); - } - - @Override - public int hashCode() { - return Objects.hash(teamId, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubTeamResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; - if (teamId.getClass().equals(java.io.File.class) || - teamId.getClass().equals(Integer.class) || - teamId.getClass().equals(String.class) || - teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for(int i = 0; i< getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } - else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SubTeamResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubTeamResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubTeamResponse.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public static SubTeamResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubTeamResponse.class); + } + + public SubTeamResponse teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of a team + * + * @return teamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public SubTeamResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this SubTeamResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubTeamResponse subTeamResponse = (SubTeamResponse) o; + return Objects.equals(this.teamId, subTeamResponse.teamId) + && Objects.equals(this.name, subTeamResponse.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(teamId, name); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubTeamResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } + + if (teamId.getClass().equals(java.io.File.class) + || teamId.getClass().equals(Integer.class) + || teamId.getClass().equals(String.class) + || teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for (int i = 0; i < getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubTemplateRole.java b/src/main/java/com/dropbox/sign/model/SubTemplateRole.java index 0e38d6f..78413aa 100644 --- a/src/main/java/com/dropbox/sign/model/SubTemplateRole.java +++ b/src/main/java/com/dropbox/sign/model/SubTemplateRole.java @@ -10,219 +10,202 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubTemplateRole - */ -@JsonPropertyOrder({ - 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) +/** SubTemplateRole */ +@JsonPropertyOrder({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) public class SubTemplateRole { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; - - public SubTemplateRole() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubTemplateRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubTemplateRole.class); - } - - static public SubTemplateRole init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubTemplateRole.class - ); - } - - public SubTemplateRole name(String name) { - this.name = 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 - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public SubTemplateRole order(Integer order) { - this.order = order; - return this; - } - - /** - * The order in which this signer role is required to sign. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOrder() { - return order; - } - - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } - - - /** - * Return true if this SubTemplateRole object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubTemplateRole subTemplateRole = (SubTemplateRole) o; - return Objects.equals(this.name, subTemplateRole.name) && - Objects.equals(this.order, subTemplateRole.order); - } - - @Override - public int hashCode() { - return Objects.hash(name, order); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubTemplateRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; + + public SubTemplateRole() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubTemplateRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubTemplateRole.class); } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } + public static SubTemplateRole init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), SubTemplateRole.class); + } + + public SubTemplateRole name(String name) { + this.name = 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 @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public SubTemplateRole order(Integer order) { + this.order = order; + return this; + } + + /** + * The order in which this signer role is required to sign. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; + } + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + /** Return true if this SubTemplateRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubTemplateRole subTemplateRole = (SubTemplateRole) o; + return Objects.equals(this.name, subTemplateRole.name) + && Objects.equals(this.order, subTemplateRole.order); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, order); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubTemplateRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java index bea1438..0118049 100644 --- a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftSigner.java @@ -10,269 +10,255 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubUnclaimedDraftSigner - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubUnclaimedDraftSigner { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public SubUnclaimedDraftSigner() { - } + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubUnclaimedDraftSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftSigner.class); - } + public SubUnclaimedDraftSigner() {} - static public SubUnclaimedDraftSigner init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubUnclaimedDraftSigner.class - ); - } - - public SubUnclaimedDraftSigner emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getEmailAddress() { - return emailAddress; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - - public SubUnclaimedDraftSigner name(String name) { - this.name = name; - return this; - } - - /** - * The name of the signer. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubUnclaimedDraftSigner order(Integer order) { - this.order = order; - return this; - } - - /** - * The order the signer is required to sign in. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubUnclaimedDraftSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftSigner.class); + } - public Integer getOrder() { - return order; - } + public static SubUnclaimedDraftSigner init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), SubUnclaimedDraftSigner.class); + } + public SubUnclaimedDraftSigner emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } + /** + * The email address of the signer. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; + } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } - /** - * Return true if this SubUnclaimedDraftSigner object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public SubUnclaimedDraftSigner name(String name) { + this.name = name; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The name of the signer. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - SubUnclaimedDraftSigner subUnclaimedDraftSigner = (SubUnclaimedDraftSigner) o; - return Objects.equals(this.emailAddress, subUnclaimedDraftSigner.emailAddress) && - Objects.equals(this.name, subUnclaimedDraftSigner.name) && - Objects.equals(this.order, subUnclaimedDraftSigner.order); - } - @Override - public int hashCode() { - return Objects.hash(emailAddress, name, order); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubUnclaimedDraftSigner {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public SubUnclaimedDraftSigner order(Integer order) { + this.order = order; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (emailAddress != null) { - if (isFileTypeOrListOfFiles(emailAddress)) { - fileTypeFound = true; - } + /** + * The order the signer is required to sign in. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + /** Return true if this SubUnclaimedDraftSigner object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubUnclaimedDraftSigner subUnclaimedDraftSigner = (SubUnclaimedDraftSigner) o; + return Objects.equals(this.emailAddress, subUnclaimedDraftSigner.emailAddress) + && Objects.equals(this.name, subUnclaimedDraftSigner.name) + && Objects.equals(this.order, subUnclaimedDraftSigner.order); } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } - } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); - } + @Override + public int hashCode() { + return Objects.hash(emailAddress, name, order); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubUnclaimedDraftSigner {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java index 67b1ca0..58128a7 100644 --- a/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java +++ b/src/main/java/com/dropbox/sign/model/SubUnclaimedDraftTemplateSigner.java @@ -10,269 +10,258 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * SubUnclaimedDraftTemplateSigner - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubUnclaimedDraftTemplateSigner { - public static final String JSON_PROPERTY_ROLE = "role"; - private String role; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public SubUnclaimedDraftTemplateSigner() { - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubUnclaimedDraftTemplateSigner init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftTemplateSigner.class); - } + public SubUnclaimedDraftTemplateSigner() {} - static public SubUnclaimedDraftTemplateSigner init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubUnclaimedDraftTemplateSigner.class - ); - } - - public SubUnclaimedDraftTemplateSigner role(String role) { - this.role = role; - return this; - } - - /** - * Must match an existing role in chosen Template(s). - * @return role - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getRole() { - return role; - } - - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRole(String role) { - this.role = role; - } - - - public SubUnclaimedDraftTemplateSigner name(String name) { - this.name = name; - return this; - } - - /** - * The name of the signer filling the role of `role`. - * @return name - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public SubUnclaimedDraftTemplateSigner emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address of the signer filling the role of `role`. - * @return emailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubUnclaimedDraftTemplateSigner init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubUnclaimedDraftTemplateSigner.class); + } - public String getEmailAddress() { - return emailAddress; - } + public static SubUnclaimedDraftTemplateSigner init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + SubUnclaimedDraftTemplateSigner.class); + } + public SubUnclaimedDraftTemplateSigner role(String role) { + this.role = role; + return this; + } - @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } + /** + * Must match an existing role in chosen Template(s). + * + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRole() { + return role; + } + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(String role) { + this.role = role; + } - /** - * Return true if this SubUnclaimedDraftTemplateSigner object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public SubUnclaimedDraftTemplateSigner name(String name) { + this.name = name; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * The name of the signer filling the role of `role`. + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; } - SubUnclaimedDraftTemplateSigner subUnclaimedDraftTemplateSigner = (SubUnclaimedDraftTemplateSigner) o; - return Objects.equals(this.role, subUnclaimedDraftTemplateSigner.role) && - Objects.equals(this.name, subUnclaimedDraftTemplateSigner.name) && - Objects.equals(this.emailAddress, subUnclaimedDraftTemplateSigner.emailAddress); - } - @Override - public int hashCode() { - return Objects.hash(role, name, emailAddress); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubUnclaimedDraftTemplateSigner {\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public SubUnclaimedDraftTemplateSigner emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } + /** + * The email address of the signer filling the role of `role`. + * + * @return emailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEmailAddress() { + return emailAddress; + } - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + /** Return true if this SubUnclaimedDraftTemplateSigner object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + SubUnclaimedDraftTemplateSigner subUnclaimedDraftTemplateSigner = + (SubUnclaimedDraftTemplateSigner) o; + return Objects.equals(this.role, subUnclaimedDraftTemplateSigner.role) + && Objects.equals(this.name, subUnclaimedDraftTemplateSigner.name) + && Objects.equals(this.emailAddress, subUnclaimedDraftTemplateSigner.emailAddress); } - 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)); - } + @Override + public int hashCode() { + return Objects.hash(role, name, emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubUnclaimedDraftTemplateSigner {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java b/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java index 3679ee8..450ca3d 100644 --- a/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java +++ b/src/main/java/com/dropbox/sign/model/SubWhiteLabelingOptions.java @@ -10,904 +10,963 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class SubWhiteLabelingOptions { - public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; - private String headerBackgroundColor = "#1A1A1A"; + public static final String JSON_PROPERTY_HEADER_BACKGROUND_COLOR = "header_background_color"; + private String headerBackgroundColor = "#1A1A1A"; + + /** Gets or Sets legalVersion */ + public enum LegalVersionEnum { + TERMS1("terms1"), + + TERMS2("terms2"); + + private String value; - /** - * Gets or Sets legalVersion - */ - public enum LegalVersionEnum { - TERMS1("terms1"), - - TERMS2("terms2"); + LegalVersionEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - private String value; + @Override + public String toString() { + return String.valueOf(value); + } - LegalVersionEnum(String value) { - this.value = value; + @JsonCreator + public static LegalVersionEnum fromValue(String value) { + for (LegalVersionEnum b : LegalVersionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; + private LegalVersionEnum legalVersion = LegalVersionEnum.TERMS1; + + public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; + private String linkColor = "#00B3E6"; + + public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; + private String pageBackgroundColor = "#F7F8F9"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; + private String primaryButtonColor = "#00B3E6"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = + "primary_button_color_hover"; + private String primaryButtonColorHover = "#00B3E6"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = + "primary_button_text_color"; + private String primaryButtonTextColor = "#FFFFFF"; + + public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = + "primary_button_text_color_hover"; + private String primaryButtonTextColorHover = "#FFFFFF"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; + private String secondaryButtonColor = "#FFFFFF"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = + "secondary_button_color_hover"; + private String secondaryButtonColorHover = "#FFFFFF"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = + "secondary_button_text_color"; + private String secondaryButtonTextColor = "#00B3E6"; + + public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = + "secondary_button_text_color_hover"; + private String secondaryButtonTextColorHover = "#00B3E6"; + + public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; + private String textColor1 = "#808080"; + + public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; + private String textColor2 = "#FFFFFF"; + + public static final String JSON_PROPERTY_RESET_TO_DEFAULT = "reset_to_default"; + private Boolean resetToDefault; + + public SubWhiteLabelingOptions() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static SubWhiteLabelingOptions init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, SubWhiteLabelingOptions.class); } - @Override - public String toString() { - return String.valueOf(value); + public static SubWhiteLabelingOptions init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), SubWhiteLabelingOptions.class); } - @JsonCreator - public static LegalVersionEnum fromValue(String value) { - for (LegalVersionEnum b : LegalVersionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public SubWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + return this; } - } - public static final String JSON_PROPERTY_LEGAL_VERSION = "legal_version"; - private LegalVersionEnum legalVersion = LegalVersionEnum.TERMS1; + /** + * Get headerBackgroundColor + * + * @return headerBackgroundColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHeaderBackgroundColor() { + return headerBackgroundColor; + } - public static final String JSON_PROPERTY_LINK_COLOR = "link_color"; - private String linkColor = "#00B3E6"; + @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaderBackgroundColor(String headerBackgroundColor) { + this.headerBackgroundColor = headerBackgroundColor; + } - public static final String JSON_PROPERTY_PAGE_BACKGROUND_COLOR = "page_background_color"; - private String pageBackgroundColor = "#F7F8F9"; + public SubWhiteLabelingOptions legalVersion(LegalVersionEnum legalVersion) { + this.legalVersion = legalVersion; + return this; + } - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR = "primary_button_color"; - private String primaryButtonColor = "#00B3E6"; + /** + * Get legalVersion + * + * @return legalVersion + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LegalVersionEnum getLegalVersion() { + return legalVersion; + } - public static final String JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER = "primary_button_color_hover"; - private String primaryButtonColorHover = "#00B3E6"; + @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLegalVersion(LegalVersionEnum legalVersion) { + this.legalVersion = legalVersion; + } - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR = "primary_button_text_color"; - private String primaryButtonTextColor = "#FFFFFF"; + public SubWhiteLabelingOptions linkColor(String linkColor) { + this.linkColor = linkColor; + return this; + } - public static final String JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER = "primary_button_text_color_hover"; - private String primaryButtonTextColorHover = "#FFFFFF"; + /** + * Get linkColor + * + * @return linkColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLinkColor() { + return linkColor; + } - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR = "secondary_button_color"; - private String secondaryButtonColor = "#FFFFFF"; + @JsonProperty(JSON_PROPERTY_LINK_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLinkColor(String linkColor) { + this.linkColor = linkColor; + } - public static final String JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER = "secondary_button_color_hover"; - private String secondaryButtonColorHover = "#FFFFFF"; + public SubWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + return this; + } - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR = "secondary_button_text_color"; - private String secondaryButtonTextColor = "#00B3E6"; + /** + * Get pageBackgroundColor + * + * @return pageBackgroundColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPageBackgroundColor() { + return pageBackgroundColor; + } - public static final String JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER = "secondary_button_text_color_hover"; - private String secondaryButtonTextColorHover = "#00B3E6"; + @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageBackgroundColor(String pageBackgroundColor) { + this.pageBackgroundColor = pageBackgroundColor; + } - public static final String JSON_PROPERTY_TEXT_COLOR1 = "text_color1"; - private String textColor1 = "#808080"; + public SubWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + return this; + } - public static final String JSON_PROPERTY_TEXT_COLOR2 = "text_color2"; - private String textColor2 = "#FFFFFF"; + /** + * Get primaryButtonColor + * + * @return primaryButtonColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonColor() { + return primaryButtonColor; + } - public static final String JSON_PROPERTY_RESET_TO_DEFAULT = "reset_to_default"; - private Boolean resetToDefault; + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColor(String primaryButtonColor) { + this.primaryButtonColor = primaryButtonColor; + } - public SubWhiteLabelingOptions() { - } + public SubWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + return this; + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public SubWhiteLabelingOptions init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, SubWhiteLabelingOptions.class); - } + /** + * Get primaryButtonColorHover + * + * @return primaryButtonColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonColorHover() { + return primaryButtonColorHover; + } - static public SubWhiteLabelingOptions init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - SubWhiteLabelingOptions.class - ); - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonColorHover(String primaryButtonColorHover) { + this.primaryButtonColorHover = primaryButtonColorHover; + } - public SubWhiteLabelingOptions headerBackgroundColor(String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - return this; - } + public SubWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + return this; + } - /** - * Get headerBackgroundColor - * @return headerBackgroundColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get primaryButtonTextColor + * + * @return primaryButtonTextColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonTextColor() { + return primaryButtonTextColor; + } - public String getHeaderBackgroundColor() { - return headerBackgroundColor; - } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColor(String primaryButtonTextColor) { + this.primaryButtonTextColor = primaryButtonTextColor; + } + public SubWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + return this; + } - @JsonProperty(JSON_PROPERTY_HEADER_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderBackgroundColor(String headerBackgroundColor) { - this.headerBackgroundColor = headerBackgroundColor; - } + /** + * Get primaryButtonTextColorHover + * + * @return primaryButtonTextColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrimaryButtonTextColorHover() { + return primaryButtonTextColorHover; + } + @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrimaryButtonTextColorHover(String primaryButtonTextColorHover) { + this.primaryButtonTextColorHover = primaryButtonTextColorHover; + } - public SubWhiteLabelingOptions legalVersion(LegalVersionEnum legalVersion) { - this.legalVersion = legalVersion; - return this; - } + public SubWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + return this; + } - /** - * Get legalVersion - * @return legalVersion - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get secondaryButtonColor + * + * @return secondaryButtonColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonColor() { + return secondaryButtonColor; + } - public LegalVersionEnum getLegalVersion() { - return legalVersion; - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColor(String secondaryButtonColor) { + this.secondaryButtonColor = secondaryButtonColor; + } + public SubWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + return this; + } - @JsonProperty(JSON_PROPERTY_LEGAL_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLegalVersion(LegalVersionEnum legalVersion) { - this.legalVersion = legalVersion; - } + /** + * Get secondaryButtonColorHover + * + * @return secondaryButtonColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonColorHover() { + return secondaryButtonColorHover; + } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonColorHover(String secondaryButtonColorHover) { + this.secondaryButtonColorHover = secondaryButtonColorHover; + } - public SubWhiteLabelingOptions linkColor(String linkColor) { - this.linkColor = linkColor; - return this; - } + public SubWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; + return this; + } - /** - * Get linkColor - * @return linkColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLinkColor() { - return linkColor; - } - - - @JsonProperty(JSON_PROPERTY_LINK_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLinkColor(String linkColor) { - this.linkColor = linkColor; - } - - - public SubWhiteLabelingOptions pageBackgroundColor(String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - return this; - } - - /** - * Get pageBackgroundColor - * @return pageBackgroundColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPageBackgroundColor() { - return pageBackgroundColor; - } - - - @JsonProperty(JSON_PROPERTY_PAGE_BACKGROUND_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPageBackgroundColor(String pageBackgroundColor) { - this.pageBackgroundColor = pageBackgroundColor; - } - - - public SubWhiteLabelingOptions primaryButtonColor(String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - return this; - } - - /** - * Get primaryButtonColor - * @return primaryButtonColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonColor() { - return primaryButtonColor; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColor(String primaryButtonColor) { - this.primaryButtonColor = primaryButtonColor; - } - - - public SubWhiteLabelingOptions primaryButtonColorHover(String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - return this; - } - - /** - * Get primaryButtonColorHover - * @return primaryButtonColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonColorHover() { - return primaryButtonColorHover; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonColorHover(String primaryButtonColorHover) { - this.primaryButtonColorHover = primaryButtonColorHover; - } - - - public SubWhiteLabelingOptions primaryButtonTextColor(String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - return this; - } - - /** - * Get primaryButtonTextColor - * @return primaryButtonTextColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonTextColor() { - return primaryButtonTextColor; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColor(String primaryButtonTextColor) { - this.primaryButtonTextColor = primaryButtonTextColor; - } - - - public SubWhiteLabelingOptions primaryButtonTextColorHover(String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - return this; - } - - /** - * Get primaryButtonTextColorHover - * @return primaryButtonTextColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrimaryButtonTextColorHover() { - return primaryButtonTextColorHover; - } - - - @JsonProperty(JSON_PROPERTY_PRIMARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrimaryButtonTextColorHover(String primaryButtonTextColorHover) { - this.primaryButtonTextColorHover = primaryButtonTextColorHover; - } - - - public SubWhiteLabelingOptions secondaryButtonColor(String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - return this; - } - - /** - * Get secondaryButtonColor - * @return secondaryButtonColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonColor() { - return secondaryButtonColor; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColor(String secondaryButtonColor) { - this.secondaryButtonColor = secondaryButtonColor; - } - - - public SubWhiteLabelingOptions secondaryButtonColorHover(String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - return this; - } - - /** - * Get secondaryButtonColorHover - * @return secondaryButtonColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonColorHover() { - return secondaryButtonColorHover; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonColorHover(String secondaryButtonColorHover) { - this.secondaryButtonColorHover = secondaryButtonColorHover; - } - - - public SubWhiteLabelingOptions secondaryButtonTextColor(String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - return this; - } - - /** - * Get secondaryButtonTextColor - * @return secondaryButtonTextColor - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonTextColor() { - return secondaryButtonTextColor; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColor(String secondaryButtonTextColor) { - this.secondaryButtonTextColor = secondaryButtonTextColor; - } - - - public SubWhiteLabelingOptions secondaryButtonTextColorHover(String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - return this; - } - - /** - * Get secondaryButtonTextColorHover - * @return secondaryButtonTextColorHover - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSecondaryButtonTextColorHover() { - return secondaryButtonTextColorHover; - } - - - @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSecondaryButtonTextColorHover(String secondaryButtonTextColorHover) { - this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; - } - - - public SubWhiteLabelingOptions textColor1(String textColor1) { - this.textColor1 = textColor1; - return this; - } - - /** - * Get textColor1 - * @return textColor1 - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTextColor1() { - return textColor1; - } - - - @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor1(String textColor1) { - this.textColor1 = textColor1; - } - - - public SubWhiteLabelingOptions textColor2(String textColor2) { - this.textColor2 = textColor2; - return this; - } - - /** - * Get textColor2 - * @return textColor2 - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTextColor2() { - return textColor2; - } - - - @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTextColor2(String textColor2) { - this.textColor2 = textColor2; - } - - - public SubWhiteLabelingOptions resetToDefault(Boolean resetToDefault) { - this.resetToDefault = resetToDefault; - return this; - } - - /** - * Resets white labeling options to defaults. Only useful when updating an API App. - * @return resetToDefault - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getResetToDefault() { - return resetToDefault; - } - - - @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResetToDefault(Boolean resetToDefault) { - this.resetToDefault = resetToDefault; - } - - - /** - * Return true if this SubWhiteLabelingOptions object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubWhiteLabelingOptions subWhiteLabelingOptions = (SubWhiteLabelingOptions) o; - return Objects.equals(this.headerBackgroundColor, subWhiteLabelingOptions.headerBackgroundColor) && - Objects.equals(this.legalVersion, subWhiteLabelingOptions.legalVersion) && - Objects.equals(this.linkColor, subWhiteLabelingOptions.linkColor) && - Objects.equals(this.pageBackgroundColor, subWhiteLabelingOptions.pageBackgroundColor) && - Objects.equals(this.primaryButtonColor, subWhiteLabelingOptions.primaryButtonColor) && - Objects.equals(this.primaryButtonColorHover, subWhiteLabelingOptions.primaryButtonColorHover) && - Objects.equals(this.primaryButtonTextColor, subWhiteLabelingOptions.primaryButtonTextColor) && - Objects.equals(this.primaryButtonTextColorHover, subWhiteLabelingOptions.primaryButtonTextColorHover) && - Objects.equals(this.secondaryButtonColor, subWhiteLabelingOptions.secondaryButtonColor) && - Objects.equals(this.secondaryButtonColorHover, subWhiteLabelingOptions.secondaryButtonColorHover) && - Objects.equals(this.secondaryButtonTextColor, subWhiteLabelingOptions.secondaryButtonTextColor) && - Objects.equals(this.secondaryButtonTextColorHover, subWhiteLabelingOptions.secondaryButtonTextColorHover) && - Objects.equals(this.textColor1, subWhiteLabelingOptions.textColor1) && - Objects.equals(this.textColor2, subWhiteLabelingOptions.textColor2) && - Objects.equals(this.resetToDefault, subWhiteLabelingOptions.resetToDefault); - } - - @Override - public int hashCode() { - return Objects.hash(headerBackgroundColor, legalVersion, linkColor, pageBackgroundColor, primaryButtonColor, primaryButtonColorHover, primaryButtonTextColor, primaryButtonTextColorHover, secondaryButtonColor, secondaryButtonColorHover, secondaryButtonTextColor, secondaryButtonTextColorHover, textColor1, textColor2, resetToDefault); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubWhiteLabelingOptions {\n"); - sb.append(" headerBackgroundColor: ").append(toIndentedString(headerBackgroundColor)).append("\n"); - sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); - sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); - sb.append(" pageBackgroundColor: ").append(toIndentedString(pageBackgroundColor)).append("\n"); - sb.append(" primaryButtonColor: ").append(toIndentedString(primaryButtonColor)).append("\n"); - sb.append(" primaryButtonColorHover: ").append(toIndentedString(primaryButtonColorHover)).append("\n"); - sb.append(" primaryButtonTextColor: ").append(toIndentedString(primaryButtonTextColor)).append("\n"); - sb.append(" primaryButtonTextColorHover: ").append(toIndentedString(primaryButtonTextColorHover)).append("\n"); - sb.append(" secondaryButtonColor: ").append(toIndentedString(secondaryButtonColor)).append("\n"); - sb.append(" secondaryButtonColorHover: ").append(toIndentedString(secondaryButtonColorHover)).append("\n"); - sb.append(" secondaryButtonTextColor: ").append(toIndentedString(secondaryButtonTextColor)).append("\n"); - sb.append(" secondaryButtonTextColorHover: ").append(toIndentedString(secondaryButtonTextColorHover)).append("\n"); - sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); - sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); - sb.append(" resetToDefault: ").append(toIndentedString(resetToDefault)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (headerBackgroundColor != null) { - if (isFileTypeOrListOfFiles(headerBackgroundColor)) { - fileTypeFound = true; - } + /** + * Get secondaryButtonTextColor + * + * @return secondaryButtonTextColor + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonTextColor() { + return secondaryButtonTextColor; + } - if (headerBackgroundColor.getClass().equals(java.io.File.class) || - headerBackgroundColor.getClass().equals(Integer.class) || - headerBackgroundColor.getClass().equals(String.class) || - headerBackgroundColor.getClass().isEnum()) { - map.put("header_background_color", headerBackgroundColor); - } else if (isListOfFile(headerBackgroundColor)) { - for(int i = 0; i< getListSize(headerBackgroundColor); i++) { - map.put("header_background_color[" + i + "]", getFromList(headerBackgroundColor, i)); - } - } - else { - map.put("header_background_color", JSON.getDefault().getMapper().writeValueAsString(headerBackgroundColor)); - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColor(String secondaryButtonTextColor) { + this.secondaryButtonTextColor = secondaryButtonTextColor; } - if (legalVersion != null) { - if (isFileTypeOrListOfFiles(legalVersion)) { - fileTypeFound = true; - } - if (legalVersion.getClass().equals(java.io.File.class) || - legalVersion.getClass().equals(Integer.class) || - legalVersion.getClass().equals(String.class) || - legalVersion.getClass().isEnum()) { - map.put("legal_version", legalVersion); - } else if (isListOfFile(legalVersion)) { - for(int i = 0; i< getListSize(legalVersion); i++) { - map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); - } - } - else { - map.put("legal_version", JSON.getDefault().getMapper().writeValueAsString(legalVersion)); - } + public SubWhiteLabelingOptions secondaryButtonTextColorHover( + String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; + return this; } - if (linkColor != null) { - if (isFileTypeOrListOfFiles(linkColor)) { - fileTypeFound = true; - } - if (linkColor.getClass().equals(java.io.File.class) || - linkColor.getClass().equals(Integer.class) || - linkColor.getClass().equals(String.class) || - linkColor.getClass().isEnum()) { - map.put("link_color", linkColor); - } else if (isListOfFile(linkColor)) { - for(int i = 0; i< getListSize(linkColor); i++) { - map.put("link_color[" + i + "]", getFromList(linkColor, i)); - } - } - else { - map.put("link_color", JSON.getDefault().getMapper().writeValueAsString(linkColor)); - } + /** + * Get secondaryButtonTextColorHover + * + * @return secondaryButtonTextColorHover + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecondaryButtonTextColorHover() { + return secondaryButtonTextColorHover; } - if (pageBackgroundColor != null) { - if (isFileTypeOrListOfFiles(pageBackgroundColor)) { - fileTypeFound = true; - } - if (pageBackgroundColor.getClass().equals(java.io.File.class) || - pageBackgroundColor.getClass().equals(Integer.class) || - pageBackgroundColor.getClass().equals(String.class) || - pageBackgroundColor.getClass().isEnum()) { - map.put("page_background_color", pageBackgroundColor); - } else if (isListOfFile(pageBackgroundColor)) { - for(int i = 0; i< getListSize(pageBackgroundColor); i++) { - map.put("page_background_color[" + i + "]", getFromList(pageBackgroundColor, i)); - } - } - else { - map.put("page_background_color", JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); - } + @JsonProperty(JSON_PROPERTY_SECONDARY_BUTTON_TEXT_COLOR_HOVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecondaryButtonTextColorHover(String secondaryButtonTextColorHover) { + this.secondaryButtonTextColorHover = secondaryButtonTextColorHover; } - if (primaryButtonColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonColor)) { - fileTypeFound = true; - } - if (primaryButtonColor.getClass().equals(java.io.File.class) || - primaryButtonColor.getClass().equals(Integer.class) || - primaryButtonColor.getClass().equals(String.class) || - primaryButtonColor.getClass().isEnum()) { - map.put("primary_button_color", primaryButtonColor); - } else if (isListOfFile(primaryButtonColor)) { - for(int i = 0; i< getListSize(primaryButtonColor); i++) { - map.put("primary_button_color[" + i + "]", getFromList(primaryButtonColor, i)); - } - } - else { - map.put("primary_button_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); - } + public SubWhiteLabelingOptions textColor1(String textColor1) { + this.textColor1 = textColor1; + return this; } - if (primaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { - fileTypeFound = true; - } - if (primaryButtonColorHover.getClass().equals(java.io.File.class) || - primaryButtonColorHover.getClass().equals(Integer.class) || - primaryButtonColorHover.getClass().equals(String.class) || - primaryButtonColorHover.getClass().isEnum()) { - map.put("primary_button_color_hover", primaryButtonColorHover); - } else if (isListOfFile(primaryButtonColorHover)) { - for(int i = 0; i< getListSize(primaryButtonColorHover); i++) { - map.put("primary_button_color_hover[" + i + "]", getFromList(primaryButtonColorHover, i)); - } - } - else { - map.put("primary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonColorHover)); - } + /** + * Get textColor1 + * + * @return textColor1 + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextColor1() { + return textColor1; } - if (primaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { - fileTypeFound = true; - } - if (primaryButtonTextColor.getClass().equals(java.io.File.class) || - primaryButtonTextColor.getClass().equals(Integer.class) || - primaryButtonTextColor.getClass().equals(String.class) || - primaryButtonTextColor.getClass().isEnum()) { - map.put("primary_button_text_color", primaryButtonTextColor); - } else if (isListOfFile(primaryButtonTextColor)) { - for(int i = 0; i< getListSize(primaryButtonTextColor); i++) { - map.put("primary_button_text_color[" + i + "]", getFromList(primaryButtonTextColor, i)); - } - } - else { - map.put("primary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColor)); - } + @JsonProperty(JSON_PROPERTY_TEXT_COLOR1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor1(String textColor1) { + this.textColor1 = textColor1; } - if (primaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { - fileTypeFound = true; - } - if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) || - primaryButtonTextColorHover.getClass().equals(Integer.class) || - primaryButtonTextColorHover.getClass().equals(String.class) || - primaryButtonTextColorHover.getClass().isEnum()) { - map.put("primary_button_text_color_hover", primaryButtonTextColorHover); - } else if (isListOfFile(primaryButtonTextColorHover)) { - for(int i = 0; i< getListSize(primaryButtonTextColorHover); i++) { - map.put("primary_button_text_color_hover[" + i + "]", getFromList(primaryButtonTextColorHover, i)); - } - } - else { - map.put("primary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(primaryButtonTextColorHover)); - } + public SubWhiteLabelingOptions textColor2(String textColor2) { + this.textColor2 = textColor2; + return this; } - if (secondaryButtonColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColor)) { - fileTypeFound = true; - } - if (secondaryButtonColor.getClass().equals(java.io.File.class) || - secondaryButtonColor.getClass().equals(Integer.class) || - secondaryButtonColor.getClass().equals(String.class) || - secondaryButtonColor.getClass().isEnum()) { - map.put("secondary_button_color", secondaryButtonColor); - } else if (isListOfFile(secondaryButtonColor)) { - for(int i = 0; i< getListSize(secondaryButtonColor); i++) { - map.put("secondary_button_color[" + i + "]", getFromList(secondaryButtonColor, i)); - } - } - else { - map.put("secondary_button_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); - } + /** + * Get textColor2 + * + * @return textColor2 + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTextColor2() { + return textColor2; } - if (secondaryButtonColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { - fileTypeFound = true; - } - if (secondaryButtonColorHover.getClass().equals(java.io.File.class) || - secondaryButtonColorHover.getClass().equals(Integer.class) || - secondaryButtonColorHover.getClass().equals(String.class) || - secondaryButtonColorHover.getClass().isEnum()) { - map.put("secondary_button_color_hover", secondaryButtonColorHover); - } else if (isListOfFile(secondaryButtonColorHover)) { - for(int i = 0; i< getListSize(secondaryButtonColorHover); i++) { - map.put("secondary_button_color_hover[" + i + "]", getFromList(secondaryButtonColorHover, i)); - } - } - else { - map.put("secondary_button_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColorHover)); - } + @JsonProperty(JSON_PROPERTY_TEXT_COLOR2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTextColor2(String textColor2) { + this.textColor2 = textColor2; } - if (secondaryButtonTextColor != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { - fileTypeFound = true; - } - if (secondaryButtonTextColor.getClass().equals(java.io.File.class) || - secondaryButtonTextColor.getClass().equals(Integer.class) || - secondaryButtonTextColor.getClass().equals(String.class) || - secondaryButtonTextColor.getClass().isEnum()) { - map.put("secondary_button_text_color", secondaryButtonTextColor); - } else if (isListOfFile(secondaryButtonTextColor)) { - for(int i = 0; i< getListSize(secondaryButtonTextColor); i++) { - map.put("secondary_button_text_color[" + i + "]", getFromList(secondaryButtonTextColor, i)); - } - } - else { - map.put("secondary_button_text_color", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColor)); - } + public SubWhiteLabelingOptions resetToDefault(Boolean resetToDefault) { + this.resetToDefault = resetToDefault; + return this; } - if (secondaryButtonTextColorHover != null) { - if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { - fileTypeFound = true; - } - if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) || - secondaryButtonTextColorHover.getClass().equals(Integer.class) || - secondaryButtonTextColorHover.getClass().equals(String.class) || - secondaryButtonTextColorHover.getClass().isEnum()) { - map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); - } else if (isListOfFile(secondaryButtonTextColorHover)) { - for(int i = 0; i< getListSize(secondaryButtonTextColorHover); i++) { - map.put("secondary_button_text_color_hover[" + i + "]", getFromList(secondaryButtonTextColorHover, i)); - } - } - else { - map.put("secondary_button_text_color_hover", JSON.getDefault().getMapper().writeValueAsString(secondaryButtonTextColorHover)); - } + /** + * Resets white labeling options to defaults. Only useful when updating an API App. + * + * @return resetToDefault + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getResetToDefault() { + return resetToDefault; } - if (textColor1 != null) { - if (isFileTypeOrListOfFiles(textColor1)) { - fileTypeFound = true; - } - if (textColor1.getClass().equals(java.io.File.class) || - textColor1.getClass().equals(Integer.class) || - textColor1.getClass().equals(String.class) || - textColor1.getClass().isEnum()) { - map.put("text_color1", textColor1); - } else if (isListOfFile(textColor1)) { - for(int i = 0; i< getListSize(textColor1); i++) { - map.put("text_color1[" + i + "]", getFromList(textColor1, i)); - } - } - else { - map.put("text_color1", JSON.getDefault().getMapper().writeValueAsString(textColor1)); - } + @JsonProperty(JSON_PROPERTY_RESET_TO_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResetToDefault(Boolean resetToDefault) { + this.resetToDefault = resetToDefault; } - if (textColor2 != null) { - if (isFileTypeOrListOfFiles(textColor2)) { - fileTypeFound = true; - } - if (textColor2.getClass().equals(java.io.File.class) || - textColor2.getClass().equals(Integer.class) || - textColor2.getClass().equals(String.class) || - textColor2.getClass().isEnum()) { - map.put("text_color2", textColor2); - } else if (isListOfFile(textColor2)) { - for(int i = 0; i< getListSize(textColor2); i++) { - map.put("text_color2[" + i + "]", getFromList(textColor2, i)); - } - } - else { - map.put("text_color2", JSON.getDefault().getMapper().writeValueAsString(textColor2)); - } + /** Return true if this SubWhiteLabelingOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubWhiteLabelingOptions subWhiteLabelingOptions = (SubWhiteLabelingOptions) o; + return Objects.equals( + this.headerBackgroundColor, subWhiteLabelingOptions.headerBackgroundColor) + && Objects.equals(this.legalVersion, subWhiteLabelingOptions.legalVersion) + && Objects.equals(this.linkColor, subWhiteLabelingOptions.linkColor) + && Objects.equals( + this.pageBackgroundColor, subWhiteLabelingOptions.pageBackgroundColor) + && Objects.equals( + this.primaryButtonColor, subWhiteLabelingOptions.primaryButtonColor) + && Objects.equals( + this.primaryButtonColorHover, + subWhiteLabelingOptions.primaryButtonColorHover) + && Objects.equals( + this.primaryButtonTextColor, subWhiteLabelingOptions.primaryButtonTextColor) + && Objects.equals( + this.primaryButtonTextColorHover, + subWhiteLabelingOptions.primaryButtonTextColorHover) + && Objects.equals( + this.secondaryButtonColor, subWhiteLabelingOptions.secondaryButtonColor) + && Objects.equals( + this.secondaryButtonColorHover, + subWhiteLabelingOptions.secondaryButtonColorHover) + && Objects.equals( + this.secondaryButtonTextColor, + subWhiteLabelingOptions.secondaryButtonTextColor) + && Objects.equals( + this.secondaryButtonTextColorHover, + subWhiteLabelingOptions.secondaryButtonTextColorHover) + && Objects.equals(this.textColor1, subWhiteLabelingOptions.textColor1) + && Objects.equals(this.textColor2, subWhiteLabelingOptions.textColor2) + && Objects.equals(this.resetToDefault, subWhiteLabelingOptions.resetToDefault); } - if (resetToDefault != null) { - if (isFileTypeOrListOfFiles(resetToDefault)) { - fileTypeFound = true; - } - if (resetToDefault.getClass().equals(java.io.File.class) || - resetToDefault.getClass().equals(Integer.class) || - resetToDefault.getClass().equals(String.class) || - resetToDefault.getClass().isEnum()) { - map.put("reset_to_default", resetToDefault); - } else if (isListOfFile(resetToDefault)) { - for(int i = 0; i< getListSize(resetToDefault); i++) { - map.put("reset_to_default[" + i + "]", getFromList(resetToDefault, i)); - } - } - else { - map.put("reset_to_default", JSON.getDefault().getMapper().writeValueAsString(resetToDefault)); - } + @Override + public int hashCode() { + return Objects.hash( + headerBackgroundColor, + legalVersion, + linkColor, + pageBackgroundColor, + primaryButtonColor, + primaryButtonColorHover, + primaryButtonTextColor, + primaryButtonTextColorHover, + secondaryButtonColor, + secondaryButtonColorHover, + secondaryButtonTextColor, + secondaryButtonTextColorHover, + textColor1, + textColor2, + resetToDefault); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubWhiteLabelingOptions {\n"); + sb.append(" headerBackgroundColor: ") + .append(toIndentedString(headerBackgroundColor)) + .append("\n"); + sb.append(" legalVersion: ").append(toIndentedString(legalVersion)).append("\n"); + sb.append(" linkColor: ").append(toIndentedString(linkColor)).append("\n"); + sb.append(" pageBackgroundColor: ") + .append(toIndentedString(pageBackgroundColor)) + .append("\n"); + sb.append(" primaryButtonColor: ") + .append(toIndentedString(primaryButtonColor)) + .append("\n"); + sb.append(" primaryButtonColorHover: ") + .append(toIndentedString(primaryButtonColorHover)) + .append("\n"); + sb.append(" primaryButtonTextColor: ") + .append(toIndentedString(primaryButtonTextColor)) + .append("\n"); + sb.append(" primaryButtonTextColorHover: ") + .append(toIndentedString(primaryButtonTextColorHover)) + .append("\n"); + sb.append(" secondaryButtonColor: ") + .append(toIndentedString(secondaryButtonColor)) + .append("\n"); + sb.append(" secondaryButtonColorHover: ") + .append(toIndentedString(secondaryButtonColorHover)) + .append("\n"); + sb.append(" secondaryButtonTextColor: ") + .append(toIndentedString(secondaryButtonTextColor)) + .append("\n"); + sb.append(" secondaryButtonTextColorHover: ") + .append(toIndentedString(secondaryButtonTextColorHover)) + .append("\n"); + sb.append(" textColor1: ").append(toIndentedString(textColor1)).append("\n"); + sb.append(" textColor2: ").append(toIndentedString(textColor2)).append("\n"); + sb.append(" resetToDefault: ").append(toIndentedString(resetToDefault)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (headerBackgroundColor != null) { + if (isFileTypeOrListOfFiles(headerBackgroundColor)) { + fileTypeFound = true; + } + + if (headerBackgroundColor.getClass().equals(java.io.File.class) + || headerBackgroundColor.getClass().equals(Integer.class) + || headerBackgroundColor.getClass().equals(String.class) + || headerBackgroundColor.getClass().isEnum()) { + map.put("header_background_color", headerBackgroundColor); + } else if (isListOfFile(headerBackgroundColor)) { + for (int i = 0; i < getListSize(headerBackgroundColor); i++) { + map.put( + "header_background_color[" + i + "]", + getFromList(headerBackgroundColor, i)); + } + } else { + map.put( + "header_background_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(headerBackgroundColor)); + } + } + if (legalVersion != null) { + if (isFileTypeOrListOfFiles(legalVersion)) { + fileTypeFound = true; + } + + if (legalVersion.getClass().equals(java.io.File.class) + || legalVersion.getClass().equals(Integer.class) + || legalVersion.getClass().equals(String.class) + || legalVersion.getClass().isEnum()) { + map.put("legal_version", legalVersion); + } else if (isListOfFile(legalVersion)) { + for (int i = 0; i < getListSize(legalVersion); i++) { + map.put("legal_version[" + i + "]", getFromList(legalVersion, i)); + } + } else { + map.put( + "legal_version", + JSON.getDefault().getMapper().writeValueAsString(legalVersion)); + } + } + if (linkColor != null) { + if (isFileTypeOrListOfFiles(linkColor)) { + fileTypeFound = true; + } + + if (linkColor.getClass().equals(java.io.File.class) + || linkColor.getClass().equals(Integer.class) + || linkColor.getClass().equals(String.class) + || linkColor.getClass().isEnum()) { + map.put("link_color", linkColor); + } else if (isListOfFile(linkColor)) { + for (int i = 0; i < getListSize(linkColor); i++) { + map.put("link_color[" + i + "]", getFromList(linkColor, i)); + } + } else { + map.put( + "link_color", + JSON.getDefault().getMapper().writeValueAsString(linkColor)); + } + } + if (pageBackgroundColor != null) { + if (isFileTypeOrListOfFiles(pageBackgroundColor)) { + fileTypeFound = true; + } + + if (pageBackgroundColor.getClass().equals(java.io.File.class) + || pageBackgroundColor.getClass().equals(Integer.class) + || pageBackgroundColor.getClass().equals(String.class) + || pageBackgroundColor.getClass().isEnum()) { + map.put("page_background_color", pageBackgroundColor); + } else if (isListOfFile(pageBackgroundColor)) { + for (int i = 0; i < getListSize(pageBackgroundColor); i++) { + map.put( + "page_background_color[" + i + "]", + getFromList(pageBackgroundColor, i)); + } + } else { + map.put( + "page_background_color", + JSON.getDefault().getMapper().writeValueAsString(pageBackgroundColor)); + } + } + if (primaryButtonColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonColor)) { + fileTypeFound = true; + } + + if (primaryButtonColor.getClass().equals(java.io.File.class) + || primaryButtonColor.getClass().equals(Integer.class) + || primaryButtonColor.getClass().equals(String.class) + || primaryButtonColor.getClass().isEnum()) { + map.put("primary_button_color", primaryButtonColor); + } else if (isListOfFile(primaryButtonColor)) { + for (int i = 0; i < getListSize(primaryButtonColor); i++) { + map.put( + "primary_button_color[" + i + "]", + getFromList(primaryButtonColor, i)); + } + } else { + map.put( + "primary_button_color", + JSON.getDefault().getMapper().writeValueAsString(primaryButtonColor)); + } + } + if (primaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonColorHover)) { + fileTypeFound = true; + } + + if (primaryButtonColorHover.getClass().equals(java.io.File.class) + || primaryButtonColorHover.getClass().equals(Integer.class) + || primaryButtonColorHover.getClass().equals(String.class) + || primaryButtonColorHover.getClass().isEnum()) { + map.put("primary_button_color_hover", primaryButtonColorHover); + } else if (isListOfFile(primaryButtonColorHover)) { + for (int i = 0; i < getListSize(primaryButtonColorHover); i++) { + map.put( + "primary_button_color_hover[" + i + "]", + getFromList(primaryButtonColorHover, i)); + } + } else { + map.put( + "primary_button_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonColorHover)); + } + } + if (primaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColor)) { + fileTypeFound = true; + } + + if (primaryButtonTextColor.getClass().equals(java.io.File.class) + || primaryButtonTextColor.getClass().equals(Integer.class) + || primaryButtonTextColor.getClass().equals(String.class) + || primaryButtonTextColor.getClass().isEnum()) { + map.put("primary_button_text_color", primaryButtonTextColor); + } else if (isListOfFile(primaryButtonTextColor)) { + for (int i = 0; i < getListSize(primaryButtonTextColor); i++) { + map.put( + "primary_button_text_color[" + i + "]", + getFromList(primaryButtonTextColor, i)); + } + } else { + map.put( + "primary_button_text_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonTextColor)); + } + } + if (primaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(primaryButtonTextColorHover)) { + fileTypeFound = true; + } + + if (primaryButtonTextColorHover.getClass().equals(java.io.File.class) + || primaryButtonTextColorHover.getClass().equals(Integer.class) + || primaryButtonTextColorHover.getClass().equals(String.class) + || primaryButtonTextColorHover.getClass().isEnum()) { + map.put("primary_button_text_color_hover", primaryButtonTextColorHover); + } else if (isListOfFile(primaryButtonTextColorHover)) { + for (int i = 0; i < getListSize(primaryButtonTextColorHover); i++) { + map.put( + "primary_button_text_color_hover[" + i + "]", + getFromList(primaryButtonTextColorHover, i)); + } + } else { + map.put( + "primary_button_text_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(primaryButtonTextColorHover)); + } + } + if (secondaryButtonColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColor)) { + fileTypeFound = true; + } + + if (secondaryButtonColor.getClass().equals(java.io.File.class) + || secondaryButtonColor.getClass().equals(Integer.class) + || secondaryButtonColor.getClass().equals(String.class) + || secondaryButtonColor.getClass().isEnum()) { + map.put("secondary_button_color", secondaryButtonColor); + } else if (isListOfFile(secondaryButtonColor)) { + for (int i = 0; i < getListSize(secondaryButtonColor); i++) { + map.put( + "secondary_button_color[" + i + "]", + getFromList(secondaryButtonColor, i)); + } + } else { + map.put( + "secondary_button_color", + JSON.getDefault().getMapper().writeValueAsString(secondaryButtonColor)); + } + } + if (secondaryButtonColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonColorHover)) { + fileTypeFound = true; + } + + if (secondaryButtonColorHover.getClass().equals(java.io.File.class) + || secondaryButtonColorHover.getClass().equals(Integer.class) + || secondaryButtonColorHover.getClass().equals(String.class) + || secondaryButtonColorHover.getClass().isEnum()) { + map.put("secondary_button_color_hover", secondaryButtonColorHover); + } else if (isListOfFile(secondaryButtonColorHover)) { + for (int i = 0; i < getListSize(secondaryButtonColorHover); i++) { + map.put( + "secondary_button_color_hover[" + i + "]", + getFromList(secondaryButtonColorHover, i)); + } + } else { + map.put( + "secondary_button_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonColorHover)); + } + } + if (secondaryButtonTextColor != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColor)) { + fileTypeFound = true; + } + + if (secondaryButtonTextColor.getClass().equals(java.io.File.class) + || secondaryButtonTextColor.getClass().equals(Integer.class) + || secondaryButtonTextColor.getClass().equals(String.class) + || secondaryButtonTextColor.getClass().isEnum()) { + map.put("secondary_button_text_color", secondaryButtonTextColor); + } else if (isListOfFile(secondaryButtonTextColor)) { + for (int i = 0; i < getListSize(secondaryButtonTextColor); i++) { + map.put( + "secondary_button_text_color[" + i + "]", + getFromList(secondaryButtonTextColor, i)); + } + } else { + map.put( + "secondary_button_text_color", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonTextColor)); + } + } + if (secondaryButtonTextColorHover != null) { + if (isFileTypeOrListOfFiles(secondaryButtonTextColorHover)) { + fileTypeFound = true; + } + + if (secondaryButtonTextColorHover.getClass().equals(java.io.File.class) + || secondaryButtonTextColorHover.getClass().equals(Integer.class) + || secondaryButtonTextColorHover.getClass().equals(String.class) + || secondaryButtonTextColorHover.getClass().isEnum()) { + map.put("secondary_button_text_color_hover", secondaryButtonTextColorHover); + } else if (isListOfFile(secondaryButtonTextColorHover)) { + for (int i = 0; i < getListSize(secondaryButtonTextColorHover); i++) { + map.put( + "secondary_button_text_color_hover[" + i + "]", + getFromList(secondaryButtonTextColorHover, i)); + } + } else { + map.put( + "secondary_button_text_color_hover", + JSON.getDefault() + .getMapper() + .writeValueAsString(secondaryButtonTextColorHover)); + } + } + if (textColor1 != null) { + if (isFileTypeOrListOfFiles(textColor1)) { + fileTypeFound = true; + } + + if (textColor1.getClass().equals(java.io.File.class) + || textColor1.getClass().equals(Integer.class) + || textColor1.getClass().equals(String.class) + || textColor1.getClass().isEnum()) { + map.put("text_color1", textColor1); + } else if (isListOfFile(textColor1)) { + for (int i = 0; i < getListSize(textColor1); i++) { + map.put("text_color1[" + i + "]", getFromList(textColor1, i)); + } + } else { + map.put( + "text_color1", + JSON.getDefault().getMapper().writeValueAsString(textColor1)); + } + } + if (textColor2 != null) { + if (isFileTypeOrListOfFiles(textColor2)) { + fileTypeFound = true; + } + + if (textColor2.getClass().equals(java.io.File.class) + || textColor2.getClass().equals(Integer.class) + || textColor2.getClass().equals(String.class) + || textColor2.getClass().isEnum()) { + map.put("text_color2", textColor2); + } else if (isListOfFile(textColor2)) { + for (int i = 0; i < getListSize(textColor2); i++) { + map.put("text_color2[" + i + "]", getFromList(textColor2, i)); + } + } else { + map.put( + "text_color2", + JSON.getDefault().getMapper().writeValueAsString(textColor2)); + } + } + if (resetToDefault != null) { + if (isFileTypeOrListOfFiles(resetToDefault)) { + fileTypeFound = true; + } + + if (resetToDefault.getClass().equals(java.io.File.class) + || resetToDefault.getClass().equals(Integer.class) + || resetToDefault.getClass().equals(String.class) + || resetToDefault.getClass().isEnum()) { + map.put("reset_to_default", resetToDefault); + } else if (isListOfFile(resetToDefault)) { + for (int i = 0; i < getListSize(resetToDefault); i++) { + map.put("reset_to_default[" + i + "]", getFromList(resetToDefault, i)); + } + } else { + map.put( + "reset_to_default", + JSON.getDefault().getMapper().writeValueAsString(resetToDefault)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java b/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java index 8c2b5bd..49beaf2 100644 --- a/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamAddMemberRequest.java @@ -10,308 +10,299 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamAddMemberRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamAddMemberRequest { - 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; - - /** - * A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. - */ - public enum RoleEnum { - MEMBER("Member"), - - DEVELOPER("Developer"), - - TEAM_MANAGER("Team Manager"), - - ADMIN("Admin"); - - private String value; - - RoleEnum(String value) { - this.value = value; + 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; + + /** + * A role member will take in a new Team. **NOTE:** This parameter is used only if + * `team_id` is provided. + */ + public enum RoleEnum { + MEMBER("Member"), + + DEVELOPER("Developer"), + + TEAM_MANAGER("Team Manager"), + + ADMIN("Admin"); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_ROLE = "role"; + private RoleEnum role; + + public TeamAddMemberRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamAddMemberRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamAddMemberRequest.class); } - @Override - public String toString() { - return String.valueOf(value); + public static TeamAddMemberRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamAddMemberRequest.class); } - @JsonCreator - public static RoleEnum fromValue(String value) { - for (RoleEnum b : RoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public TeamAddMemberRequest accountId(String accountId) { + this.accountId = accountId; + return this; } - } - - public static final String JSON_PROPERTY_ROLE = "role"; - private RoleEnum role; - - public TeamAddMemberRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamAddMemberRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamAddMemberRequest.class); - } - - static public TeamAddMemberRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamAddMemberRequest.class - ); - } - - public TeamAddMemberRequest accountId(String accountId) { - this.accountId = 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 - @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 TeamAddMemberRequest emailAddress(String emailAddress) { - this.emailAddress = 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 - @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; - } - - - public TeamAddMemberRequest role(RoleEnum role) { - this.role = 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 - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public RoleEnum getRole() { - return role; - } - - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(RoleEnum role) { - this.role = role; - } - - - /** - * Return true if this TeamAddMemberRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * `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 @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; } - TeamAddMemberRequest teamAddMemberRequest = (TeamAddMemberRequest) o; - return Objects.equals(this.accountId, teamAddMemberRequest.accountId) && - Objects.equals(this.emailAddress, teamAddMemberRequest.emailAddress) && - Objects.equals(this.role, teamAddMemberRequest.role); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, role); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamAddMemberRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - 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)); - } + public TeamAddMemberRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - 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)); - } + /** + * `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 @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public TeamAddMemberRequest role(RoleEnum role) { + this.role = 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 @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RoleEnum getRole() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(RoleEnum role) { + this.role = role; + } + + /** Return true if this TeamAddMemberRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamAddMemberRequest teamAddMemberRequest = (TeamAddMemberRequest) o; + return Objects.equals(this.accountId, teamAddMemberRequest.accountId) + && Objects.equals(this.emailAddress, teamAddMemberRequest.emailAddress) + && Objects.equals(this.role, teamAddMemberRequest.role); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, role); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamAddMemberRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java b/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java index 5c8d584..6724eea 100644 --- a/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamCreateRequest.java @@ -10,169 +10,156 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamCreateRequest - */ -@JsonPropertyOrder({ - TeamCreateRequest.JSON_PROPERTY_NAME -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** TeamCreateRequest */ +@JsonPropertyOrder({TeamCreateRequest.JSON_PROPERTY_NAME}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamCreateRequest { - public static final String JSON_PROPERTY_NAME = "name"; - private String name = "Untitled Team"; - - public TeamCreateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamCreateRequest.class); - } - - static public TeamCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamCreateRequest.class - ); - } - - public TeamCreateRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of your Team. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this TeamCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "Untitled Team"; + + public TeamCreateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamCreateRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TeamCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamCreateRequest.class); } - TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; - return Objects.equals(this.name, teamCreateRequest.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamCreateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public TeamCreateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of your Team. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this TeamCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; + return Objects.equals(this.name, teamCreateRequest.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java b/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java index 25ce087..fbb889e 100644 --- a/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamGetInfoResponse.java @@ -10,231 +10,215 @@ * 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.TeamInfoResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamGetInfoResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public TeamGetInfoResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamGetInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamGetInfoResponse.class); - } - - static public TeamGetInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamGetInfoResponse.class - ); - } - - public TeamGetInfoResponse team(TeamInfoResponse team) { - this.team = team; - return this; - } - - /** - * Get team - * @return team - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TeamInfoResponse getTeam() { - return team; - } - - - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeam(TeamInfoResponse team) { - this.team = team; - } - - - public TeamGetInfoResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TeamGetInfoResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TeamGetInfoResponse teamGetInfoResponse = (TeamGetInfoResponse) o; - return Objects.equals(this.team, teamGetInfoResponse.team) && - Objects.equals(this.warnings, teamGetInfoResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(team, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamGetInfoResponse {\n"); - sb.append(" team: ").append(toIndentedString(team)).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 (team != null) { - if (isFileTypeOrListOfFiles(team)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEAM = "team"; + private TeamInfoResponse team; - if (team.getClass().equals(java.io.File.class) || - team.getClass().equals(Integer.class) || - team.getClass().equals(String.class) || - team.getClass().isEnum()) { - map.put("team", team); - } else if (isListOfFile(team)) { - for(int i = 0; i< getListSize(team); i++) { - map.put("team[" + i + "]", getFromList(team, i)); - } - } - else { - map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TeamGetInfoResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamGetInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamGetInfoResponse.class); + } + + public static TeamGetInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamGetInfoResponse.class); + } + + public TeamGetInfoResponse team(TeamInfoResponse team) { + this.team = team; + return this; + } + + /** + * Get team + * + * @return team + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamInfoResponse getTeam() { + return team; + } + + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeam(TeamInfoResponse team) { + this.team = team; + } + + public TeamGetInfoResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TeamGetInfoResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TeamGetInfoResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamGetInfoResponse teamGetInfoResponse = (TeamGetInfoResponse) o; + return Objects.equals(this.team, teamGetInfoResponse.team) + && Objects.equals(this.warnings, teamGetInfoResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(team, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamGetInfoResponse {\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (team != null) { + if (isFileTypeOrListOfFiles(team)) { + fileTypeFound = true; + } + + if (team.getClass().equals(java.io.File.class) + || team.getClass().equals(Integer.class) + || team.getClass().equals(String.class) + || team.getClass().isEnum()) { + map.put("team", team); + } else if (isListOfFile(team)) { + for (int i = 0; i < getListSize(team); i++) { + map.put("team[" + i + "]", getFromList(team, i)); + } + } else { + map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamGetResponse.java b/src/main/java/com/dropbox/sign/model/TeamGetResponse.java index f862702..c7be1f6 100644 --- a/src/main/java/com/dropbox/sign/model/TeamGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamGetResponse.java @@ -10,231 +10,212 @@ * 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.TeamResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamGetResponse - */ -@JsonPropertyOrder({ - 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) +/** TeamGetResponse */ +@JsonPropertyOrder({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) 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 = null; - - public TeamGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamGetResponse.class); - } - - static public TeamGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamGetResponse.class - ); - } - - public TeamGetResponse team(TeamResponse team) { - this.team = team; - return this; - } - - /** - * Get team - * @return team - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TeamResponse getTeam() { - return team; - } - - - @JsonProperty(JSON_PROPERTY_TEAM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeam(TeamResponse team) { - this.team = team; - } - - - public TeamGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TeamGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TeamGetResponse teamGetResponse = (TeamGetResponse) o; - return Objects.equals(this.team, teamGetResponse.team) && - Objects.equals(this.warnings, teamGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(team, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamGetResponse {\n"); - sb.append(" team: ").append(toIndentedString(team)).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 (team != null) { - if (isFileTypeOrListOfFiles(team)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEAM = "team"; + private TeamResponse team; - if (team.getClass().equals(java.io.File.class) || - team.getClass().equals(Integer.class) || - team.getClass().equals(String.class) || - team.getClass().isEnum()) { - map.put("team", team); - } else if (isListOfFile(team)) { - for(int i = 0; i< getListSize(team); i++) { - map.put("team[" + i + "]", getFromList(team, i)); - } - } - else { - map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TeamGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamGetResponse.class); + } + + public static TeamGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamGetResponse.class); + } + + public TeamGetResponse team(TeamResponse team) { + this.team = team; + return this; + } + + /** + * Get team + * + * @return team + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamResponse getTeam() { + return team; + } + + @JsonProperty(JSON_PROPERTY_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeam(TeamResponse team) { + this.team = team; + } + + public TeamGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TeamGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TeamGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamGetResponse teamGetResponse = (TeamGetResponse) o; + return Objects.equals(this.team, teamGetResponse.team) + && Objects.equals(this.warnings, teamGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(team, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamGetResponse {\n"); + sb.append(" team: ").append(toIndentedString(team)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (team != null) { + if (isFileTypeOrListOfFiles(team)) { + fileTypeFound = true; + } + + if (team.getClass().equals(java.io.File.class) + || team.getClass().equals(Integer.class) + || team.getClass().equals(String.class) + || team.getClass().isEnum()) { + map.put("team", team); + } else if (isListOfFile(team)) { + for (int i = 0; i < getListSize(team); i++) { + map.put("team[" + i + "]", getFromList(team, i)); + } + } else { + map.put("team", JSON.getDefault().getMapper().writeValueAsString(team)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java b/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java index 8dad2c1..7edabf5 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInfoResponse.java @@ -10,370 +10,348 @@ * 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.TeamParentResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamInfoResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamInfoResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - private String teamId; - - public static final String JSON_PROPERTY_TEAM_PARENT = "team_parent"; - private TeamParentResponse teamParent; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_NUM_MEMBERS = "num_members"; - private Integer numMembers; - - public static final String JSON_PROPERTY_NUM_SUB_TEAMS = "num_sub_teams"; - private Integer numSubTeams; - - public TeamInfoResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamInfoResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInfoResponse.class); - } - - static public TeamInfoResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamInfoResponse.class - ); - } - - public TeamInfoResponse teamId(String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * @return teamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTeamId() { - return teamId; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - - public TeamInfoResponse teamParent(TeamParentResponse teamParent) { - this.teamParent = teamParent; - return this; - } - - /** - * Get teamParent - * @return teamParent - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_PARENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TeamParentResponse getTeamParent() { - return teamParent; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_PARENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamParent(TeamParentResponse teamParent) { - this.teamParent = teamParent; - } - - - public TeamInfoResponse name(String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TeamInfoResponse numMembers(Integer numMembers) { - this.numMembers = numMembers; - return this; - } - - /** - * Number of members within a team - * @return numMembers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumMembers() { - return numMembers; - } - - - @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumMembers(Integer numMembers) { - this.numMembers = numMembers; - } - - - public TeamInfoResponse numSubTeams(Integer numSubTeams) { - this.numSubTeams = numSubTeams; - return this; - } - - /** - * Number of sub teams within a team - * @return numSubTeams - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumSubTeams() { - return numSubTeams; - } - - - @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumSubTeams(Integer numSubTeams) { - this.numSubTeams = numSubTeams; - } - - - /** - * Return true if this TeamInfoResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_TEAM_PARENT = "team_parent"; + private TeamParentResponse teamParent; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NUM_MEMBERS = "num_members"; + private Integer numMembers; + + public static final String JSON_PROPERTY_NUM_SUB_TEAMS = "num_sub_teams"; + private Integer numSubTeams; + + public TeamInfoResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamInfoResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInfoResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TeamInfoResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamInfoResponse.class); } - TeamInfoResponse teamInfoResponse = (TeamInfoResponse) o; - return Objects.equals(this.teamId, teamInfoResponse.teamId) && - Objects.equals(this.teamParent, teamInfoResponse.teamParent) && - Objects.equals(this.name, teamInfoResponse.name) && - Objects.equals(this.numMembers, teamInfoResponse.numMembers) && - Objects.equals(this.numSubTeams, teamInfoResponse.numSubTeams); - } - - @Override - public int hashCode() { - return Objects.hash(teamId, teamParent, name, numMembers, numSubTeams); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInfoResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" teamParent: ").append(toIndentedString(teamParent)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" numMembers: ").append(toIndentedString(numMembers)).append("\n"); - sb.append(" numSubTeams: ").append(toIndentedString(numSubTeams)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - if (teamId.getClass().equals(java.io.File.class) || - teamId.getClass().equals(Integer.class) || - teamId.getClass().equals(String.class) || - teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for(int i = 0; i< getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } - else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } + public TeamInfoResponse teamId(String teamId) { + this.teamId = teamId; + return this; } - if (teamParent != null) { - if (isFileTypeOrListOfFiles(teamParent)) { - fileTypeFound = true; - } - if (teamParent.getClass().equals(java.io.File.class) || - teamParent.getClass().equals(Integer.class) || - teamParent.getClass().equals(String.class) || - teamParent.getClass().isEnum()) { - map.put("team_parent", teamParent); - } else if (isListOfFile(teamParent)) { - for(int i = 0; i< getListSize(teamParent); i++) { - map.put("team_parent[" + i + "]", getFromList(teamParent, i)); - } - } - else { - map.put("team_parent", JSON.getDefault().getMapper().writeValueAsString(teamParent)); - } + /** + * The id of a team + * + * @return teamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(String teamId) { + this.teamId = teamId; } - if (numMembers != null) { - if (isFileTypeOrListOfFiles(numMembers)) { - fileTypeFound = true; - } - if (numMembers.getClass().equals(java.io.File.class) || - numMembers.getClass().equals(Integer.class) || - numMembers.getClass().equals(String.class) || - numMembers.getClass().isEnum()) { - map.put("num_members", numMembers); - } else if (isListOfFile(numMembers)) { - for(int i = 0; i< getListSize(numMembers); i++) { - map.put("num_members[" + i + "]", getFromList(numMembers, i)); - } - } - else { - map.put("num_members", JSON.getDefault().getMapper().writeValueAsString(numMembers)); - } + public TeamInfoResponse teamParent(TeamParentResponse teamParent) { + this.teamParent = teamParent; + return this; } - if (numSubTeams != null) { - if (isFileTypeOrListOfFiles(numSubTeams)) { - fileTypeFound = true; - } - if (numSubTeams.getClass().equals(java.io.File.class) || - numSubTeams.getClass().equals(Integer.class) || - numSubTeams.getClass().equals(String.class) || - numSubTeams.getClass().isEnum()) { - map.put("num_sub_teams", numSubTeams); - } else if (isListOfFile(numSubTeams)) { - for(int i = 0; i< getListSize(numSubTeams); i++) { - map.put("num_sub_teams[" + i + "]", getFromList(numSubTeams, i)); - } + /** + * Get teamParent + * + * @return teamParent + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamParentResponse getTeamParent() { + return teamParent; + } + + @JsonProperty(JSON_PROPERTY_TEAM_PARENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamParent(TeamParentResponse teamParent) { + this.teamParent = teamParent; + } + + public TeamInfoResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public TeamInfoResponse numMembers(Integer numMembers) { + this.numMembers = numMembers; + return this; + } + + /** + * Number of members within a team + * + * @return numMembers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumMembers() { + return numMembers; + } + + @JsonProperty(JSON_PROPERTY_NUM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumMembers(Integer numMembers) { + this.numMembers = numMembers; + } + + public TeamInfoResponse numSubTeams(Integer numSubTeams) { + this.numSubTeams = numSubTeams; + return this; + } + + /** + * Number of sub teams within a team + * + * @return numSubTeams + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumSubTeams() { + return numSubTeams; + } + + @JsonProperty(JSON_PROPERTY_NUM_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumSubTeams(Integer numSubTeams) { + this.numSubTeams = numSubTeams; + } + + /** Return true if this TeamInfoResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("num_sub_teams", JSON.getDefault().getMapper().writeValueAsString(numSubTeams)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamInfoResponse teamInfoResponse = (TeamInfoResponse) o; + return Objects.equals(this.teamId, teamInfoResponse.teamId) + && Objects.equals(this.teamParent, teamInfoResponse.teamParent) + && Objects.equals(this.name, teamInfoResponse.name) + && Objects.equals(this.numMembers, teamInfoResponse.numMembers) + && Objects.equals(this.numSubTeams, teamInfoResponse.numSubTeams); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(teamId, teamParent, name, numMembers, numSubTeams); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInfoResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" teamParent: ").append(toIndentedString(teamParent)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" numMembers: ").append(toIndentedString(numMembers)).append("\n"); + sb.append(" numSubTeams: ").append(toIndentedString(numSubTeams)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } + + if (teamId.getClass().equals(java.io.File.class) + || teamId.getClass().equals(Integer.class) + || teamId.getClass().equals(String.class) + || teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for (int i = 0; i < getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } + } + if (teamParent != null) { + if (isFileTypeOrListOfFiles(teamParent)) { + fileTypeFound = true; + } + + if (teamParent.getClass().equals(java.io.File.class) + || teamParent.getClass().equals(Integer.class) + || teamParent.getClass().equals(String.class) + || teamParent.getClass().isEnum()) { + map.put("team_parent", teamParent); + } else if (isListOfFile(teamParent)) { + for (int i = 0; i < getListSize(teamParent); i++) { + map.put("team_parent[" + i + "]", getFromList(teamParent, i)); + } + } else { + map.put( + "team_parent", + JSON.getDefault().getMapper().writeValueAsString(teamParent)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (numMembers != null) { + if (isFileTypeOrListOfFiles(numMembers)) { + fileTypeFound = true; + } + + if (numMembers.getClass().equals(java.io.File.class) + || numMembers.getClass().equals(Integer.class) + || numMembers.getClass().equals(String.class) + || numMembers.getClass().isEnum()) { + map.put("num_members", numMembers); + } else if (isListOfFile(numMembers)) { + for (int i = 0; i < getListSize(numMembers); i++) { + map.put("num_members[" + i + "]", getFromList(numMembers, i)); + } + } else { + map.put( + "num_members", + JSON.getDefault().getMapper().writeValueAsString(numMembers)); + } + } + if (numSubTeams != null) { + if (isFileTypeOrListOfFiles(numSubTeams)) { + fileTypeFound = true; + } + + if (numSubTeams.getClass().equals(java.io.File.class) + || numSubTeams.getClass().equals(Integer.class) + || numSubTeams.getClass().equals(String.class) + || numSubTeams.getClass().isEnum()) { + map.put("num_sub_teams", numSubTeams); + } else if (isListOfFile(numSubTeams)) { + for (int i = 0; i < getListSize(numSubTeams); i++) { + map.put("num_sub_teams[" + i + "]", getFromList(numSubTeams, i)); + } + } else { + map.put( + "num_sub_teams", + JSON.getDefault().getMapper().writeValueAsString(numSubTeams)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java b/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java index d59d630..2d49161 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInviteResponse.java @@ -10,419 +10,394 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamInviteResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamInviteResponse { - public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; - private String emailAddress; - - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - private String teamId; - - public static final String JSON_PROPERTY_ROLE = "role"; - private String role; - - public static final String JSON_PROPERTY_SENT_AT = "sent_at"; - private Integer sentAt; - - public static final String JSON_PROPERTY_REDEEMED_AT = "redeemed_at"; - private Integer redeemedAt; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public TeamInviteResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamInviteResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInviteResponse.class); - } - - static public TeamInviteResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamInviteResponse.class - ); - } - - public TeamInviteResponse emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Email address of the user invited to this team. - * @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; - } - - - public TeamInviteResponse teamId(String teamId) { - this.teamId = teamId; - return this; - } - - /** - * Id of the team. - * @return teamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTeamId() { - return teamId; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - - public TeamInviteResponse role(String role) { - this.role = role; - return this; - } - - /** - * Role of the user invited to this team. - * @return role - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRole() { - return role; - } - - - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(String role) { - this.role = role; - } - - - public TeamInviteResponse sentAt(Integer sentAt) { - this.sentAt = sentAt; - return this; - } - - /** - * Timestamp when the invitation was sent. - * @return sentAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getSentAt() { - return sentAt; - } - - - @JsonProperty(JSON_PROPERTY_SENT_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSentAt(Integer sentAt) { - this.sentAt = sentAt; - } - - - public TeamInviteResponse redeemedAt(Integer redeemedAt) { - this.redeemedAt = redeemedAt; - return this; - } - - /** - * Timestamp when the invitation was redeemed. - * @return redeemedAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REDEEMED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getRedeemedAt() { - return redeemedAt; - } - - - @JsonProperty(JSON_PROPERTY_REDEEMED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRedeemedAt(Integer redeemedAt) { - this.redeemedAt = redeemedAt; - } - - - public TeamInviteResponse expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * Timestamp when the invitation is expiring. - * @return expiresAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this TeamInviteResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public static final String JSON_PROPERTY_SENT_AT = "sent_at"; + private Integer sentAt; + + public static final String JSON_PROPERTY_REDEEMED_AT = "redeemed_at"; + private Integer redeemedAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public TeamInviteResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamInviteResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInviteResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TeamInviteResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamInviteResponse.class); } - TeamInviteResponse teamInviteResponse = (TeamInviteResponse) o; - return Objects.equals(this.emailAddress, teamInviteResponse.emailAddress) && - Objects.equals(this.teamId, teamInviteResponse.teamId) && - Objects.equals(this.role, teamInviteResponse.role) && - Objects.equals(this.sentAt, teamInviteResponse.sentAt) && - Objects.equals(this.redeemedAt, teamInviteResponse.redeemedAt) && - Objects.equals(this.expiresAt, teamInviteResponse.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(emailAddress, teamId, role, sentAt, redeemedAt, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInviteResponse {\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); - sb.append(" redeemedAt: ").append(toIndentedString(redeemedAt)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (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)); - } + public TeamInviteResponse emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } - if (teamId.getClass().equals(java.io.File.class) || - teamId.getClass().equals(Integer.class) || - teamId.getClass().equals(String.class) || - teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for(int i = 0; i< getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } - else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } + /** + * Email address of the user invited to this team. + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - if (sentAt != null) { - if (isFileTypeOrListOfFiles(sentAt)) { - fileTypeFound = true; - } - if (sentAt.getClass().equals(java.io.File.class) || - sentAt.getClass().equals(Integer.class) || - sentAt.getClass().equals(String.class) || - sentAt.getClass().isEnum()) { - map.put("sent_at", sentAt); - } else if (isListOfFile(sentAt)) { - for(int i = 0; i< getListSize(sentAt); i++) { - map.put("sent_at[" + i + "]", getFromList(sentAt, i)); - } - } - else { - map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); - } + public TeamInviteResponse teamId(String teamId) { + this.teamId = teamId; + return this; } - if (redeemedAt != null) { - if (isFileTypeOrListOfFiles(redeemedAt)) { - fileTypeFound = true; - } - if (redeemedAt.getClass().equals(java.io.File.class) || - redeemedAt.getClass().equals(Integer.class) || - redeemedAt.getClass().equals(String.class) || - redeemedAt.getClass().isEnum()) { - map.put("redeemed_at", redeemedAt); - } else if (isListOfFile(redeemedAt)) { - for(int i = 0; i< getListSize(redeemedAt); i++) { - map.put("redeemed_at[" + i + "]", getFromList(redeemedAt, i)); - } - } - else { - map.put("redeemed_at", JSON.getDefault().getMapper().writeValueAsString(redeemedAt)); - } + /** + * Id of the team. + * + * @return teamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public TeamInviteResponse role(String role) { + this.role = role; + return this; + } + + /** + * Role of the user invited to this team. + * + * @return role + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRole() { + return role; + } + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + public TeamInviteResponse sentAt(Integer sentAt) { + this.sentAt = sentAt; + return this; + } + + /** + * Timestamp when the invitation was sent. + * + * @return sentAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSentAt() { + return sentAt; + } + + @JsonProperty(JSON_PROPERTY_SENT_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSentAt(Integer sentAt) { + this.sentAt = sentAt; + } + + public TeamInviteResponse redeemedAt(Integer redeemedAt) { + this.redeemedAt = redeemedAt; + return this; + } + + /** + * Timestamp when the invitation was redeemed. + * + * @return redeemedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REDEEMED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getRedeemedAt() { + return redeemedAt; + } + + @JsonProperty(JSON_PROPERTY_REDEEMED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRedeemedAt(Integer redeemedAt) { + this.redeemedAt = redeemedAt; + } + + public TeamInviteResponse expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Timestamp when the invitation is expiring. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this TeamInviteResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamInviteResponse teamInviteResponse = (TeamInviteResponse) o; + return Objects.equals(this.emailAddress, teamInviteResponse.emailAddress) + && Objects.equals(this.teamId, teamInviteResponse.teamId) + && Objects.equals(this.role, teamInviteResponse.role) + && Objects.equals(this.sentAt, teamInviteResponse.sentAt) + && Objects.equals(this.redeemedAt, teamInviteResponse.redeemedAt) + && Objects.equals(this.expiresAt, teamInviteResponse.expiresAt); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(emailAddress, teamId, role, sentAt, redeemedAt, expiresAt); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInviteResponse {\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" sentAt: ").append(toIndentedString(sentAt)).append("\n"); + sb.append(" redeemedAt: ").append(toIndentedString(redeemedAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (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)); + } + } + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } + + if (teamId.getClass().equals(java.io.File.class) + || teamId.getClass().equals(Integer.class) + || teamId.getClass().equals(String.class) + || teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for (int i = 0; i < getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } + } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + if (sentAt != null) { + if (isFileTypeOrListOfFiles(sentAt)) { + fileTypeFound = true; + } + + if (sentAt.getClass().equals(java.io.File.class) + || sentAt.getClass().equals(Integer.class) + || sentAt.getClass().equals(String.class) + || sentAt.getClass().isEnum()) { + map.put("sent_at", sentAt); + } else if (isListOfFile(sentAt)) { + for (int i = 0; i < getListSize(sentAt); i++) { + map.put("sent_at[" + i + "]", getFromList(sentAt, i)); + } + } else { + map.put("sent_at", JSON.getDefault().getMapper().writeValueAsString(sentAt)); + } + } + if (redeemedAt != null) { + if (isFileTypeOrListOfFiles(redeemedAt)) { + fileTypeFound = true; + } + + if (redeemedAt.getClass().equals(java.io.File.class) + || redeemedAt.getClass().equals(Integer.class) + || redeemedAt.getClass().equals(String.class) + || redeemedAt.getClass().isEnum()) { + map.put("redeemed_at", redeemedAt); + } else if (isListOfFile(redeemedAt)) { + for (int i = 0; i < getListSize(redeemedAt); i++) { + map.put("redeemed_at[" + i + "]", getFromList(redeemedAt, i)); + } + } else { + map.put( + "redeemed_at", + JSON.getDefault().getMapper().writeValueAsString(redeemedAt)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java b/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java index 17d025b..0e13d74 100644 --- a/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamInvitesResponse.java @@ -10,239 +10,225 @@ * 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.TeamInviteResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamInvitesResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamInvitesResponse { - public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; - private List teamInvites = new ArrayList<>(); - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - private List warnings = null; - - public TeamInvitesResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamInvitesResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamInvitesResponse.class); - } - - static public TeamInvitesResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamInvitesResponse.class - ); - } - - public TeamInvitesResponse teamInvites(List teamInvites) { - this.teamInvites = teamInvites; - return this; - } - - public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem) { - if (this.teamInvites == null) { - this.teamInvites = new ArrayList<>(); - } - this.teamInvites.add(teamInvitesItem); - return this; - } - - /** - * Contains a list of team invites and their roles. - * @return teamInvites - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getTeamInvites() { - return teamInvites; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_INVITES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeamInvites(List teamInvites) { - this.teamInvites = teamInvites; - } - - - public TeamInvitesResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * Get warnings - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TeamInvitesResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TeamInvitesResponse teamInvitesResponse = (TeamInvitesResponse) o; - return Objects.equals(this.teamInvites, teamInvitesResponse.teamInvites) && - Objects.equals(this.warnings, teamInvitesResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(teamInvites, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamInvitesResponse {\n"); - sb.append(" teamInvites: ").append(toIndentedString(teamInvites)).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 (teamInvites != null) { - if (isFileTypeOrListOfFiles(teamInvites)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEAM_INVITES = "team_invites"; + private List teamInvites = new ArrayList<>(); - if (teamInvites.getClass().equals(java.io.File.class) || - teamInvites.getClass().equals(Integer.class) || - teamInvites.getClass().equals(String.class) || - teamInvites.getClass().isEnum()) { - map.put("team_invites", teamInvites); - } else if (isListOfFile(teamInvites)) { - for(int i = 0; i< getListSize(teamInvites); i++) { - map.put("team_invites[" + i + "]", getFromList(teamInvites, i)); - } - } - else { - map.put("team_invites", JSON.getDefault().getMapper().writeValueAsString(teamInvites)); + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TeamInvitesResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamInvitesResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamInvitesResponse.class); + } + + public static TeamInvitesResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamInvitesResponse.class); + } + + public TeamInvitesResponse teamInvites(List teamInvites) { + this.teamInvites = teamInvites; + return this; + } + + public TeamInvitesResponse addTeamInvitesItem(TeamInviteResponse teamInvitesItem) { + if (this.teamInvites == null) { + this.teamInvites = new ArrayList<>(); } + this.teamInvites.add(teamInvitesItem); + return this; + } + + /** + * Contains a list of team invites and their roles. + * + * @return teamInvites + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM_INVITES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTeamInvites() { + return teamInvites; + } + + @JsonProperty(JSON_PROPERTY_TEAM_INVITES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeamInvites(List teamInvites) { + this.teamInvites = teamInvites; + } + + public TeamInvitesResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TeamInvitesResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * Get warnings + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TeamInvitesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamInvitesResponse teamInvitesResponse = (TeamInvitesResponse) o; + return Objects.equals(this.teamInvites, teamInvitesResponse.teamInvites) + && Objects.equals(this.warnings, teamInvitesResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(teamInvites, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamInvitesResponse {\n"); + sb.append(" teamInvites: ").append(toIndentedString(teamInvites)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamInvites != null) { + if (isFileTypeOrListOfFiles(teamInvites)) { + fileTypeFound = true; + } + + if (teamInvites.getClass().equals(java.io.File.class) + || teamInvites.getClass().equals(Integer.class) + || teamInvites.getClass().equals(String.class) + || teamInvites.getClass().isEnum()) { + map.put("team_invites", teamInvites); + } else if (isListOfFile(teamInvites)) { + for (int i = 0; i < getListSize(teamInvites); i++) { + map.put("team_invites[" + i + "]", getFromList(teamInvites, i)); + } + } else { + map.put( + "team_invites", + JSON.getDefault().getMapper().writeValueAsString(teamInvites)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java b/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java index b774089..1f86e2a 100644 --- a/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamMemberResponse.java @@ -10,269 +10,254 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamMemberResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamMemberResponse { - 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 static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - public static final String JSON_PROPERTY_ROLE = "role"; - private String role; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public TeamMemberResponse() { - } + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamMemberResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamMemberResponse.class); - } + public TeamMemberResponse() {} - static public TeamMemberResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamMemberResponse.class - ); - } - - public TeamMemberResponse accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Account id of the team member. - * @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 TeamMemberResponse emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * Email address of the team member. - * @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; - } - - - public TeamMemberResponse role(String role) { - this.role = role; - return this; - } - - /** - * The specific role a member has on the team. - * @return role - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamMemberResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamMemberResponse.class); + } - public String getRole() { - return role; - } + public static TeamMemberResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamMemberResponse.class); + } + public TeamMemberResponse accountId(String accountId) { + this.accountId = accountId; + return this; + } - @JsonProperty(JSON_PROPERTY_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRole(String role) { - this.role = role; - } + /** + * Account id of the team member. + * + * @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 TeamMemberResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TeamMemberResponse emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Email address of the team member. + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - TeamMemberResponse teamMemberResponse = (TeamMemberResponse) o; - return Objects.equals(this.accountId, teamMemberResponse.accountId) && - Objects.equals(this.emailAddress, teamMemberResponse.emailAddress) && - Objects.equals(this.role, teamMemberResponse.role); - } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, role); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamMemberResponse {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" role: ").append(toIndentedString(role)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public TeamMemberResponse role(String role) { + this.role = role; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + /** + * The specific role a member has on the team. + * + * @return role + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRole() { + return role; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; } - 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)); - } + /** Return true if this TeamMemberResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamMemberResponse teamMemberResponse = (TeamMemberResponse) o; + return Objects.equals(this.accountId, teamMemberResponse.accountId) + && Objects.equals(this.emailAddress, teamMemberResponse.emailAddress) + && Objects.equals(this.role, teamMemberResponse.role); } - if (role != null) { - if (isFileTypeOrListOfFiles(role)) { - fileTypeFound = true; - } - if (role.getClass().equals(java.io.File.class) || - role.getClass().equals(Integer.class) || - role.getClass().equals(String.class) || - role.getClass().isEnum()) { - map.put("role", role); - } else if (isListOfFile(role)) { - for(int i = 0; i< getListSize(role); i++) { - map.put("role[" + i + "]", getFromList(role, i)); - } - } - else { - map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); - } + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, role); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamMemberResponse {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (role != null) { + if (isFileTypeOrListOfFiles(role)) { + fileTypeFound = true; + } + + if (role.getClass().equals(java.io.File.class) + || role.getClass().equals(Integer.class) + || role.getClass().equals(String.class) + || role.getClass().isEnum()) { + map.put("role", role); + } else if (isListOfFile(role)) { + for (int i = 0; i < getListSize(role); i++) { + map.put("role[" + i + "]", getFromList(role, i)); + } + } else { + map.put("role", JSON.getDefault().getMapper().writeValueAsString(role)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java b/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java index 299e8a9..203819c 100644 --- a/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamMembersResponse.java @@ -10,290 +10,274 @@ * 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.ListInfoResponse; -import com.dropbox.sign.model.TeamMemberResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamMembersResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamMembersResponse { - public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; - 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 = null; - - public TeamMembersResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamMembersResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamMembersResponse.class); - } - - static public TeamMembersResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamMembersResponse.class - ); - } - - public TeamMembersResponse teamMembers(List teamMembers) { - this.teamMembers = teamMembers; - return this; - } - - public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem) { - if (this.teamMembers == null) { - this.teamMembers = new ArrayList<>(); - } - this.teamMembers.add(teamMembersItem); - return this; - } - - /** - * Contains a list of team members and their roles for a specific team. - * @return teamMembers - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getTeamMembers() { - return teamMembers; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTeamMembers(List teamMembers) { - this.teamMembers = teamMembers; - } - - - public TeamMembersResponse 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 TeamMembersResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEAM_MEMBERS = "team_members"; + 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 = null; + + public TeamMembersResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamMembersResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamMembersResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * Get warnings - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TeamMembersResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static TeamMembersResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamMembersResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public TeamMembersResponse teamMembers(List teamMembers) { + this.teamMembers = teamMembers; + return this; } - TeamMembersResponse teamMembersResponse = (TeamMembersResponse) o; - return Objects.equals(this.teamMembers, teamMembersResponse.teamMembers) && - Objects.equals(this.listInfo, teamMembersResponse.listInfo) && - Objects.equals(this.warnings, teamMembersResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(teamMembers, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamMembersResponse {\n"); - sb.append(" teamMembers: ").append(toIndentedString(teamMembers)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (teamMembers != null) { - if (isFileTypeOrListOfFiles(teamMembers)) { - fileTypeFound = true; - } - if (teamMembers.getClass().equals(java.io.File.class) || - teamMembers.getClass().equals(Integer.class) || - teamMembers.getClass().equals(String.class) || - teamMembers.getClass().isEnum()) { - map.put("team_members", teamMembers); - } else if (isListOfFile(teamMembers)) { - for(int i = 0; i< getListSize(teamMembers); i++) { - map.put("team_members[" + i + "]", getFromList(teamMembers, i)); - } - } - else { - map.put("team_members", JSON.getDefault().getMapper().writeValueAsString(teamMembers)); + public TeamMembersResponse addTeamMembersItem(TeamMemberResponse teamMembersItem) { + if (this.teamMembers == null) { + this.teamMembers = new ArrayList<>(); } + this.teamMembers.add(teamMembersItem); + return this; } - 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)); - } + /** + * Contains a list of team members and their roles for a specific team. + * + * @return teamMembers + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTeamMembers() { + return teamMembers; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_TEAM_MEMBERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTeamMembers(List teamMembers) { + this.teamMembers = teamMembers; + } + + public TeamMembersResponse 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 TeamMembersResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public TeamMembersResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * Get warnings + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TeamMembersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamMembersResponse teamMembersResponse = (TeamMembersResponse) o; + return Objects.equals(this.teamMembers, teamMembersResponse.teamMembers) + && Objects.equals(this.listInfo, teamMembersResponse.listInfo) + && Objects.equals(this.warnings, teamMembersResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(teamMembers, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamMembersResponse {\n"); + sb.append(" teamMembers: ").append(toIndentedString(teamMembers)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamMembers != null) { + if (isFileTypeOrListOfFiles(teamMembers)) { + fileTypeFound = true; + } + + if (teamMembers.getClass().equals(java.io.File.class) + || teamMembers.getClass().equals(Integer.class) + || teamMembers.getClass().equals(String.class) + || teamMembers.getClass().isEnum()) { + map.put("team_members", teamMembers); + } else if (isListOfFile(teamMembers)) { + for (int i = 0; i < getListSize(teamMembers); i++) { + map.put("team_members[" + i + "]", getFromList(teamMembers, i)); + } + } else { + map.put( + "team_members", + JSON.getDefault().getMapper().writeValueAsString(teamMembers)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamParentResponse.java b/src/main/java/com/dropbox/sign/model/TeamParentResponse.java index 180e3bb..cb5041a 100644 --- a/src/main/java/com/dropbox/sign/model/TeamParentResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamParentResponse.java @@ -10,219 +10,204 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Information about the parent team if a team has one, set to `null` otherwise. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamParentResponse { - public static final String JSON_PROPERTY_TEAM_ID = "team_id"; - private String teamId; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public TeamParentResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamParentResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamParentResponse.class); - } - - static public TeamParentResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamParentResponse.class - ); - } - - public TeamParentResponse teamId(String teamId) { - this.teamId = teamId; - return this; - } - - /** - * The id of a team - * @return teamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTeamId() { - return teamId; - } - - - @JsonProperty(JSON_PROPERTY_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTeamId(String teamId) { - this.teamId = teamId; - } - - - public TeamParentResponse name(String name) { - this.name = name; - return this; - } - - /** - * The name of a team - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this TeamParentResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TeamParentResponse teamParentResponse = (TeamParentResponse) o; - return Objects.equals(this.teamId, teamParentResponse.teamId) && - Objects.equals(this.name, teamParentResponse.name); - } - - @Override - public int hashCode() { - return Objects.hash(teamId, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamParentResponse {\n"); - sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (teamId != null) { - if (isFileTypeOrListOfFiles(teamId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEAM_ID = "team_id"; + private String teamId; - if (teamId.getClass().equals(java.io.File.class) || - teamId.getClass().equals(Integer.class) || - teamId.getClass().equals(String.class) || - teamId.getClass().isEnum()) { - map.put("team_id", teamId); - } else if (isListOfFile(teamId)) { - for(int i = 0; i< getListSize(teamId); i++) { - map.put("team_id[" + i + "]", getFromList(teamId, i)); - } - } - else { - map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TeamParentResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamParentResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamParentResponse.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public static TeamParentResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamParentResponse.class); + } + + public TeamParentResponse teamId(String teamId) { + this.teamId = teamId; + return this; + } + + /** + * The id of a team + * + * @return teamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamId() { + return teamId; + } + + @JsonProperty(JSON_PROPERTY_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTeamId(String teamId) { + this.teamId = teamId; + } + + public TeamParentResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of a team + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this TeamParentResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamParentResponse teamParentResponse = (TeamParentResponse) o; + return Objects.equals(this.teamId, teamParentResponse.teamId) + && Objects.equals(this.name, teamParentResponse.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(teamId, name); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamParentResponse {\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (teamId != null) { + if (isFileTypeOrListOfFiles(teamId)) { + fileTypeFound = true; + } + + if (teamId.getClass().equals(java.io.File.class) + || teamId.getClass().equals(Integer.class) + || teamId.getClass().equals(String.class) + || teamId.getClass().isEnum()) { + map.put("team_id", teamId); + } else if (isListOfFile(teamId)) { + for (int i = 0; i < getListSize(teamId); i++) { + map.put("team_id[" + i + "]", getFromList(teamId, i)); + } + } else { + map.put("team_id", JSON.getDefault().getMapper().writeValueAsString(teamId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java b/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java index fd82206..1dd8dc7 100644 --- a/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamRemoveMemberRequest.java @@ -10,408 +10,404 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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.annotation.JsonValue; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamRemoveMemberRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamRemoveMemberRequest { - 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 static final String JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS = "new_owner_email_address"; - private String newOwnerEmailAddress; - - public static final String JSON_PROPERTY_NEW_TEAM_ID = "new_team_id"; - private String newTeamId; - - /** - * A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. - */ - public enum NewRoleEnum { - MEMBER("Member"), - - DEVELOPER("Developer"), - - TEAM_MANAGER("Team Manager"), - - ADMIN("Admin"); - - private String value; - - NewRoleEnum(String value) { - this.value = value; + 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 static final String JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS = "new_owner_email_address"; + private String newOwnerEmailAddress; + + public static final String JSON_PROPERTY_NEW_TEAM_ID = "new_team_id"; + private String newTeamId; + + /** + * A new role member will take in a new Team. **NOTE:** This parameter is used only if + * `new_team_id` is provided. + */ + public enum NewRoleEnum { + MEMBER("Member"), + + DEVELOPER("Developer"), + + TEAM_MANAGER("Team Manager"), + + ADMIN("Admin"); + + private String value; + + NewRoleEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static NewRoleEnum fromValue(String value) { + for (NewRoleEnum b : NewRoleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_NEW_ROLE = "new_role"; + private NewRoleEnum newRole; + + public TeamRemoveMemberRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamRemoveMemberRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamRemoveMemberRequest.class); } - @Override - public String toString() { - return String.valueOf(value); + public static TeamRemoveMemberRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TeamRemoveMemberRequest.class); } - @JsonCreator - public static NewRoleEnum fromValue(String value) { - for (NewRoleEnum b : NewRoleEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + public TeamRemoveMemberRequest accountId(String accountId) { + this.accountId = accountId; + return this; } - } - - public static final String JSON_PROPERTY_NEW_ROLE = "new_role"; - private NewRoleEnum newRole; - - public TeamRemoveMemberRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamRemoveMemberRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamRemoveMemberRequest.class); - } - - static public TeamRemoveMemberRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamRemoveMemberRequest.class - ); - } - - public TeamRemoveMemberRequest accountId(String accountId) { - this.accountId = 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 - @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 TeamRemoveMemberRequest emailAddress(String emailAddress) { - this.emailAddress = 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 - @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; - } - - - public TeamRemoveMemberRequest newOwnerEmailAddress(String newOwnerEmailAddress) { - this.newOwnerEmailAddress = 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 - @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNewOwnerEmailAddress() { - return newOwnerEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewOwnerEmailAddress(String newOwnerEmailAddress) { - this.newOwnerEmailAddress = newOwnerEmailAddress; - } - - - public TeamRemoveMemberRequest newTeamId(String newTeamId) { - this.newTeamId = newTeamId; - return this; - } - - /** - * Id of the new Team. - * @return newTeamId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNewTeamId() { - return newTeamId; - } - - - @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewTeamId(String newTeamId) { - this.newTeamId = newTeamId; - } - - - public TeamRemoveMemberRequest newRole(NewRoleEnum newRole) { - this.newRole = 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 - @JsonProperty(JSON_PROPERTY_NEW_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public NewRoleEnum getNewRole() { - return newRole; - } - - - @JsonProperty(JSON_PROPERTY_NEW_ROLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNewRole(NewRoleEnum newRole) { - this.newRole = newRole; - } - - - /** - * Return true if this TeamRemoveMemberRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * **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 @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; } - TeamRemoveMemberRequest teamRemoveMemberRequest = (TeamRemoveMemberRequest) o; - return Objects.equals(this.accountId, teamRemoveMemberRequest.accountId) && - Objects.equals(this.emailAddress, teamRemoveMemberRequest.emailAddress) && - Objects.equals(this.newOwnerEmailAddress, teamRemoveMemberRequest.newOwnerEmailAddress) && - Objects.equals(this.newTeamId, teamRemoveMemberRequest.newTeamId) && - Objects.equals(this.newRole, teamRemoveMemberRequest.newRole); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, newOwnerEmailAddress, newTeamId, newRole); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamRemoveMemberRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" newOwnerEmailAddress: ").append(toIndentedString(newOwnerEmailAddress)).append("\n"); - sb.append(" newTeamId: ").append(toIndentedString(newTeamId)).append("\n"); - sb.append(" newRole: ").append(toIndentedString(newRole)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - 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)); - } + public TeamRemoveMemberRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - 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)); - } + /** + * **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 @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - if (newOwnerEmailAddress != null) { - if (isFileTypeOrListOfFiles(newOwnerEmailAddress)) { - fileTypeFound = true; - } - if (newOwnerEmailAddress.getClass().equals(java.io.File.class) || - newOwnerEmailAddress.getClass().equals(Integer.class) || - newOwnerEmailAddress.getClass().equals(String.class) || - newOwnerEmailAddress.getClass().isEnum()) { - map.put("new_owner_email_address", newOwnerEmailAddress); - } else if (isListOfFile(newOwnerEmailAddress)) { - for(int i = 0; i< getListSize(newOwnerEmailAddress); i++) { - map.put("new_owner_email_address[" + i + "]", getFromList(newOwnerEmailAddress, i)); - } - } - else { - map.put("new_owner_email_address", JSON.getDefault().getMapper().writeValueAsString(newOwnerEmailAddress)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; } - if (newTeamId != null) { - if (isFileTypeOrListOfFiles(newTeamId)) { - fileTypeFound = true; - } - if (newTeamId.getClass().equals(java.io.File.class) || - newTeamId.getClass().equals(Integer.class) || - newTeamId.getClass().equals(String.class) || - newTeamId.getClass().isEnum()) { - map.put("new_team_id", newTeamId); - } else if (isListOfFile(newTeamId)) { - for(int i = 0; i< getListSize(newTeamId); i++) { - map.put("new_team_id[" + i + "]", getFromList(newTeamId, i)); - } - } - else { - map.put("new_team_id", JSON.getDefault().getMapper().writeValueAsString(newTeamId)); - } + public TeamRemoveMemberRequest newOwnerEmailAddress(String newOwnerEmailAddress) { + this.newOwnerEmailAddress = newOwnerEmailAddress; + return this; } - if (newRole != null) { - if (isFileTypeOrListOfFiles(newRole)) { - fileTypeFound = true; - } - if (newRole.getClass().equals(java.io.File.class) || - newRole.getClass().equals(Integer.class) || - newRole.getClass().equals(String.class) || - newRole.getClass().isEnum()) { - map.put("new_role", newRole); - } else if (isListOfFile(newRole)) { - for(int i = 0; i< getListSize(newRole); i++) { - map.put("new_role[" + i + "]", getFromList(newRole, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewOwnerEmailAddress() { + return newOwnerEmailAddress; + } + + @JsonProperty(JSON_PROPERTY_NEW_OWNER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewOwnerEmailAddress(String newOwnerEmailAddress) { + this.newOwnerEmailAddress = newOwnerEmailAddress; + } + + public TeamRemoveMemberRequest newTeamId(String newTeamId) { + this.newTeamId = newTeamId; + return this; + } + + /** + * Id of the new Team. + * + * @return newTeamId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNewTeamId() { + return newTeamId; + } + + @JsonProperty(JSON_PROPERTY_NEW_TEAM_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewTeamId(String newTeamId) { + this.newTeamId = newTeamId; + } + + public TeamRemoveMemberRequest newRole(NewRoleEnum newRole) { + this.newRole = 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 @JsonProperty(JSON_PROPERTY_NEW_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NewRoleEnum getNewRole() { + return newRole; + } + + @JsonProperty(JSON_PROPERTY_NEW_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewRole(NewRoleEnum newRole) { + this.newRole = newRole; + } + + /** Return true if this TeamRemoveMemberRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("new_role", JSON.getDefault().getMapper().writeValueAsString(newRole)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamRemoveMemberRequest teamRemoveMemberRequest = (TeamRemoveMemberRequest) o; + return Objects.equals(this.accountId, teamRemoveMemberRequest.accountId) + && Objects.equals(this.emailAddress, teamRemoveMemberRequest.emailAddress) + && Objects.equals( + this.newOwnerEmailAddress, teamRemoveMemberRequest.newOwnerEmailAddress) + && Objects.equals(this.newTeamId, teamRemoveMemberRequest.newTeamId) + && Objects.equals(this.newRole, teamRemoveMemberRequest.newRole); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, newOwnerEmailAddress, newTeamId, newRole); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamRemoveMemberRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" newOwnerEmailAddress: ") + .append(toIndentedString(newOwnerEmailAddress)) + .append("\n"); + sb.append(" newTeamId: ").append(toIndentedString(newTeamId)).append("\n"); + sb.append(" newRole: ").append(toIndentedString(newRole)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (newOwnerEmailAddress != null) { + if (isFileTypeOrListOfFiles(newOwnerEmailAddress)) { + fileTypeFound = true; + } + + if (newOwnerEmailAddress.getClass().equals(java.io.File.class) + || newOwnerEmailAddress.getClass().equals(Integer.class) + || newOwnerEmailAddress.getClass().equals(String.class) + || newOwnerEmailAddress.getClass().isEnum()) { + map.put("new_owner_email_address", newOwnerEmailAddress); + } else if (isListOfFile(newOwnerEmailAddress)) { + for (int i = 0; i < getListSize(newOwnerEmailAddress); i++) { + map.put( + "new_owner_email_address[" + i + "]", + getFromList(newOwnerEmailAddress, i)); + } + } else { + map.put( + "new_owner_email_address", + JSON.getDefault().getMapper().writeValueAsString(newOwnerEmailAddress)); + } + } + if (newTeamId != null) { + if (isFileTypeOrListOfFiles(newTeamId)) { + fileTypeFound = true; + } + + if (newTeamId.getClass().equals(java.io.File.class) + || newTeamId.getClass().equals(Integer.class) + || newTeamId.getClass().equals(String.class) + || newTeamId.getClass().isEnum()) { + map.put("new_team_id", newTeamId); + } else if (isListOfFile(newTeamId)) { + for (int i = 0; i < getListSize(newTeamId); i++) { + map.put("new_team_id[" + i + "]", getFromList(newTeamId, i)); + } + } else { + map.put( + "new_team_id", + JSON.getDefault().getMapper().writeValueAsString(newTeamId)); + } + } + if (newRole != null) { + if (isFileTypeOrListOfFiles(newRole)) { + fileTypeFound = true; + } + + if (newRole.getClass().equals(java.io.File.class) + || newRole.getClass().equals(Integer.class) + || newRole.getClass().equals(String.class) + || newRole.getClass().isEnum()) { + map.put("new_role", newRole); + } else if (isListOfFile(newRole)) { + for (int i = 0; i < getListSize(newRole); i++) { + map.put("new_role[" + i + "]", getFromList(newRole, i)); + } + } else { + map.put("new_role", JSON.getDefault().getMapper().writeValueAsString(newRole)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamResponse.java b/src/main/java/com/dropbox/sign/model/TeamResponse.java index 06dc6b3..2abc906 100644 --- a/src/main/java/com/dropbox/sign/model/TeamResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamResponse.java @@ -10,346 +10,328 @@ * 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.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains information about your team and its members - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; - private List invitedAccounts = null; - - public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; - private List invitedEmails = null; - - public TeamResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamResponse.class); - } - - static public TeamResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamResponse.class - ); - } - - public TeamResponse name(String name) { - this.name = name; - return this; - } - - /** - * The name of your Team - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TeamResponse accounts(List accounts) { - this.accounts = accounts; - return this; - } - - public TeamResponse addAccountsItem(AccountResponse accountsItem) { - if (this.accounts == null) { - this.accounts = new ArrayList<>(); + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; + + public static final String JSON_PROPERTY_INVITED_ACCOUNTS = "invited_accounts"; + private List invitedAccounts = null; + + public static final String JSON_PROPERTY_INVITED_EMAILS = "invited_emails"; + private List invitedEmails = null; + + public TeamResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamResponse.class); } - 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; - } - - - public TeamResponse invitedAccounts(List invitedAccounts) { - this.invitedAccounts = invitedAccounts; - return this; - } - - public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) { - if (this.invitedAccounts == null) { - this.invitedAccounts = new ArrayList<>(); + + public static TeamResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamResponse.class); } - this.invitedAccounts.add(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 - @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getInvitedAccounts() { - return invitedAccounts; - } - - - @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInvitedAccounts(List invitedAccounts) { - this.invitedAccounts = invitedAccounts; - } - - - public TeamResponse invitedEmails(List invitedEmails) { - this.invitedEmails = invitedEmails; - return this; - } - - public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { - if (this.invitedEmails == null) { - this.invitedEmails = new ArrayList<>(); + + public TeamResponse name(String name) { + this.name = name; + return this; } - this.invitedEmails.add(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 - @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getInvitedEmails() { - return invitedEmails; - } - - - @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInvitedEmails(List invitedEmails) { - this.invitedEmails = invitedEmails; - } - - - /** - * Return true if this TeamResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + /** + * The name of your Team + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - if (o == null || getClass() != o.getClass()) { - return false; + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - TeamResponse teamResponse = (TeamResponse) o; - return Objects.equals(this.name, teamResponse.name) && - Objects.equals(this.accounts, teamResponse.accounts) && - Objects.equals(this.invitedAccounts, teamResponse.invitedAccounts) && - Objects.equals(this.invitedEmails, teamResponse.invitedEmails); - } - - @Override - public int hashCode() { - return Objects.hash(name, accounts, invitedAccounts, invitedEmails); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamResponse {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); - sb.append(" invitedAccounts: ").append(toIndentedString(invitedAccounts)).append("\n"); - sb.append(" invitedEmails: ").append(toIndentedString(invitedEmails)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public TeamResponse accounts(List accounts) { + this.accounts = accounts; + return this; } - 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)); + public TeamResponse addAccountsItem(AccountResponse accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); } + this.accounts.add(accountsItem); + return this; } - if (invitedAccounts != null) { - if (isFileTypeOrListOfFiles(invitedAccounts)) { - fileTypeFound = true; - } - if (invitedAccounts.getClass().equals(java.io.File.class) || - invitedAccounts.getClass().equals(Integer.class) || - invitedAccounts.getClass().equals(String.class) || - invitedAccounts.getClass().isEnum()) { - map.put("invited_accounts", invitedAccounts); - } else if (isListOfFile(invitedAccounts)) { - for(int i = 0; i< getListSize(invitedAccounts); i++) { - map.put("invited_accounts[" + i + "]", getFromList(invitedAccounts, i)); - } - } - else { - map.put("invited_accounts", JSON.getDefault().getMapper().writeValueAsString(invitedAccounts)); + /** + * 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; + } + + public TeamResponse invitedAccounts(List invitedAccounts) { + this.invitedAccounts = invitedAccounts; + return this; + } + + public TeamResponse addInvitedAccountsItem(AccountResponse invitedAccountsItem) { + if (this.invitedAccounts == null) { + this.invitedAccounts = new ArrayList<>(); } + this.invitedAccounts.add(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 @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvitedAccounts() { + return invitedAccounts; } - if (invitedEmails != null) { - if (isFileTypeOrListOfFiles(invitedEmails)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_INVITED_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvitedAccounts(List invitedAccounts) { + this.invitedAccounts = invitedAccounts; + } + + public TeamResponse invitedEmails(List invitedEmails) { + this.invitedEmails = invitedEmails; + return this; + } + + public TeamResponse addInvitedEmailsItem(String invitedEmailsItem) { + if (this.invitedEmails == null) { + this.invitedEmails = new ArrayList<>(); } + this.invitedEmails.add(invitedEmailsItem); + return this; + } - if (invitedEmails.getClass().equals(java.io.File.class) || - invitedEmails.getClass().equals(Integer.class) || - invitedEmails.getClass().equals(String.class) || - invitedEmails.getClass().isEnum()) { - map.put("invited_emails", invitedEmails); - } else if (isListOfFile(invitedEmails)) { - for(int i = 0; i< getListSize(invitedEmails); i++) { - map.put("invited_emails[" + i + "]", getFromList(invitedEmails, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvitedEmails() { + return invitedEmails; + } + + @JsonProperty(JSON_PROPERTY_INVITED_EMAILS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvitedEmails(List invitedEmails) { + this.invitedEmails = invitedEmails; + } + + /** Return true if this TeamResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("invited_emails", JSON.getDefault().getMapper().writeValueAsString(invitedEmails)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamResponse teamResponse = (TeamResponse) o; + return Objects.equals(this.name, teamResponse.name) + && Objects.equals(this.accounts, teamResponse.accounts) + && Objects.equals(this.invitedAccounts, teamResponse.invitedAccounts) + && Objects.equals(this.invitedEmails, teamResponse.invitedEmails); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, accounts, invitedAccounts, invitedEmails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponse {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append(" invitedAccounts: ").append(toIndentedString(invitedAccounts)).append("\n"); + sb.append(" invitedEmails: ").append(toIndentedString(invitedEmails)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + 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)); + } + } + if (invitedAccounts != null) { + if (isFileTypeOrListOfFiles(invitedAccounts)) { + fileTypeFound = true; + } + + if (invitedAccounts.getClass().equals(java.io.File.class) + || invitedAccounts.getClass().equals(Integer.class) + || invitedAccounts.getClass().equals(String.class) + || invitedAccounts.getClass().isEnum()) { + map.put("invited_accounts", invitedAccounts); + } else if (isListOfFile(invitedAccounts)) { + for (int i = 0; i < getListSize(invitedAccounts); i++) { + map.put("invited_accounts[" + i + "]", getFromList(invitedAccounts, i)); + } + } else { + map.put( + "invited_accounts", + JSON.getDefault().getMapper().writeValueAsString(invitedAccounts)); + } + } + if (invitedEmails != null) { + if (isFileTypeOrListOfFiles(invitedEmails)) { + fileTypeFound = true; + } + + if (invitedEmails.getClass().equals(java.io.File.class) + || invitedEmails.getClass().equals(Integer.class) + || invitedEmails.getClass().equals(String.class) + || invitedEmails.getClass().isEnum()) { + map.put("invited_emails", invitedEmails); + } else if (isListOfFile(invitedEmails)) { + for (int i = 0; i < getListSize(invitedEmails); i++) { + map.put("invited_emails[" + i + "]", getFromList(invitedEmails, i)); + } + } else { + map.put( + "invited_emails", + JSON.getDefault().getMapper().writeValueAsString(invitedEmails)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java b/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java index f103f5f..5ccab5b 100644 --- a/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java +++ b/src/main/java/com/dropbox/sign/model/TeamSubTeamsResponse.java @@ -10,290 +10,274 @@ * 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.ListInfoResponse; -import com.dropbox.sign.model.SubTeamResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamSubTeamsResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamSubTeamsResponse { - public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; - 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 = null; - - public TeamSubTeamsResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamSubTeamsResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamSubTeamsResponse.class); - } - - static public TeamSubTeamsResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamSubTeamsResponse.class - ); - } - - public TeamSubTeamsResponse subTeams(List subTeams) { - this.subTeams = subTeams; - return this; - } - - public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { - if (this.subTeams == null) { - this.subTeams = new ArrayList<>(); - } - this.subTeams.add(subTeamsItem); - return this; - } - - /** - * Contains a list with sub teams. - * @return subTeams - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSubTeams() { - return subTeams; - } - - - @JsonProperty(JSON_PROPERTY_SUB_TEAMS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSubTeams(List subTeams) { - this.subTeams = subTeams; - } - - - public TeamSubTeamsResponse 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 TeamSubTeamsResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_SUB_TEAMS = "sub_teams"; + 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 = null; + + public TeamSubTeamsResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamSubTeamsResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamSubTeamsResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * Get warnings - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TeamSubTeamsResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static TeamSubTeamsResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamSubTeamsResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public TeamSubTeamsResponse subTeams(List subTeams) { + this.subTeams = subTeams; + return this; } - TeamSubTeamsResponse teamSubTeamsResponse = (TeamSubTeamsResponse) o; - return Objects.equals(this.subTeams, teamSubTeamsResponse.subTeams) && - Objects.equals(this.listInfo, teamSubTeamsResponse.listInfo) && - Objects.equals(this.warnings, teamSubTeamsResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(subTeams, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamSubTeamsResponse {\n"); - sb.append(" subTeams: ").append(toIndentedString(subTeams)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (subTeams != null) { - if (isFileTypeOrListOfFiles(subTeams)) { - fileTypeFound = true; - } - if (subTeams.getClass().equals(java.io.File.class) || - subTeams.getClass().equals(Integer.class) || - subTeams.getClass().equals(String.class) || - subTeams.getClass().isEnum()) { - map.put("sub_teams", subTeams); - } else if (isListOfFile(subTeams)) { - for(int i = 0; i< getListSize(subTeams); i++) { - map.put("sub_teams[" + i + "]", getFromList(subTeams, i)); - } - } - else { - map.put("sub_teams", JSON.getDefault().getMapper().writeValueAsString(subTeams)); + public TeamSubTeamsResponse addSubTeamsItem(SubTeamResponse subTeamsItem) { + if (this.subTeams == null) { + this.subTeams = new ArrayList<>(); } + this.subTeams.add(subTeamsItem); + return this; } - 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)); - } + /** + * Contains a list with sub teams. + * + * @return subTeams + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSubTeams() { + return subTeams; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_SUB_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSubTeams(List subTeams) { + this.subTeams = subTeams; + } + + public TeamSubTeamsResponse 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 TeamSubTeamsResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public TeamSubTeamsResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * Get warnings + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TeamSubTeamsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamSubTeamsResponse teamSubTeamsResponse = (TeamSubTeamsResponse) o; + return Objects.equals(this.subTeams, teamSubTeamsResponse.subTeams) + && Objects.equals(this.listInfo, teamSubTeamsResponse.listInfo) + && Objects.equals(this.warnings, teamSubTeamsResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(subTeams, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamSubTeamsResponse {\n"); + sb.append(" subTeams: ").append(toIndentedString(subTeams)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (subTeams != null) { + if (isFileTypeOrListOfFiles(subTeams)) { + fileTypeFound = true; + } + + if (subTeams.getClass().equals(java.io.File.class) + || subTeams.getClass().equals(Integer.class) + || subTeams.getClass().equals(String.class) + || subTeams.getClass().isEnum()) { + map.put("sub_teams", subTeams); + } else if (isListOfFile(subTeams)) { + for (int i = 0; i < getListSize(subTeams); i++) { + map.put("sub_teams[" + i + "]", getFromList(subTeams, i)); + } + } else { + map.put( + "sub_teams", + JSON.getDefault().getMapper().writeValueAsString(subTeams)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java b/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java index b9388bd..c6a8f94 100644 --- a/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TeamUpdateRequest.java @@ -10,169 +10,156 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TeamUpdateRequest - */ -@JsonPropertyOrder({ - TeamUpdateRequest.JSON_PROPERTY_NAME -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** TeamUpdateRequest */ +@JsonPropertyOrder({TeamUpdateRequest.JSON_PROPERTY_NAME}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TeamUpdateRequest { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public TeamUpdateRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TeamUpdateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TeamUpdateRequest.class); - } - - static public TeamUpdateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TeamUpdateRequest.class - ); - } - - public TeamUpdateRequest name(String name) { - this.name = name; - return this; - } - - /** - * The name of your Team. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this TeamUpdateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TeamUpdateRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TeamUpdateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TeamUpdateRequest.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TeamUpdateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TeamUpdateRequest.class); } - TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; - return Objects.equals(this.name, teamUpdateRequest.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TeamUpdateRequest {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public TeamUpdateRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of your Team. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this TeamUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; + return Objects.equals(this.name, teamUpdateRequest.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java b/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java index e7dd65c..c52f070 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateAddUserRequest.java @@ -10,269 +10,260 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateAddUserRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateAddUserRequest { - 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 static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - public static final String JSON_PROPERTY_SKIP_NOTIFICATION = "skip_notification"; - private Boolean skipNotification = false; + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; - public TemplateAddUserRequest() { - } + public static final String JSON_PROPERTY_SKIP_NOTIFICATION = "skip_notification"; + private Boolean skipNotification = false; - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateAddUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateAddUserRequest.class); - } + public TemplateAddUserRequest() {} - static public TemplateAddUserRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateAddUserRequest.class - ); - } - - public TemplateAddUserRequest accountId(String accountId) { - this.accountId = 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 - @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 TemplateAddUserRequest emailAddress(String emailAddress) { - this.emailAddress = 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 - @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; - } - - - public TemplateAddUserRequest skipNotification(Boolean skipNotification) { - this.skipNotification = 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 - @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateAddUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateAddUserRequest.class); + } - public Boolean getSkipNotification() { - return skipNotification; - } + public static TemplateAddUserRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TemplateAddUserRequest.class); + } + public TemplateAddUserRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } - @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipNotification(Boolean skipNotification) { - this.skipNotification = skipNotification; - } + /** + * 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 @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 TemplateAddUserRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TemplateAddUserRequest emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * 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 @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - TemplateAddUserRequest templateAddUserRequest = (TemplateAddUserRequest) o; - return Objects.equals(this.accountId, templateAddUserRequest.accountId) && - Objects.equals(this.emailAddress, templateAddUserRequest.emailAddress) && - Objects.equals(this.skipNotification, templateAddUserRequest.skipNotification); - } - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, skipNotification); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateAddUserRequest {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" skipNotification: ").append(toIndentedString(skipNotification)).append("\n"); - sb.append("}"); - return sb.toString(); - } + public TemplateAddUserRequest skipNotification(Boolean skipNotification) { + this.skipNotification = skipNotification; + return this; + } - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipNotification() { + return skipNotification; + } - 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)); - } + @JsonProperty(JSON_PROPERTY_SKIP_NOTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipNotification(Boolean skipNotification) { + this.skipNotification = skipNotification; } - 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)); - } + /** Return true if this TemplateAddUserRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateAddUserRequest templateAddUserRequest = (TemplateAddUserRequest) o; + return Objects.equals(this.accountId, templateAddUserRequest.accountId) + && Objects.equals(this.emailAddress, templateAddUserRequest.emailAddress) + && Objects.equals(this.skipNotification, templateAddUserRequest.skipNotification); } - if (skipNotification != null) { - if (isFileTypeOrListOfFiles(skipNotification)) { - fileTypeFound = true; - } - if (skipNotification.getClass().equals(java.io.File.class) || - skipNotification.getClass().equals(Integer.class) || - skipNotification.getClass().equals(String.class) || - skipNotification.getClass().isEnum()) { - map.put("skip_notification", skipNotification); - } else if (isListOfFile(skipNotification)) { - for(int i = 0; i< getListSize(skipNotification); i++) { - map.put("skip_notification[" + i + "]", getFromList(skipNotification, i)); - } - } - else { - map.put("skip_notification", JSON.getDefault().getMapper().writeValueAsString(skipNotification)); - } + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, skipNotification); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateAddUserRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" skipNotification: ").append(toIndentedString(skipNotification)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (skipNotification != null) { + if (isFileTypeOrListOfFiles(skipNotification)) { + fileTypeFound = true; + } + + if (skipNotification.getClass().equals(java.io.File.class) + || skipNotification.getClass().equals(Integer.class) + || skipNotification.getClass().equals(String.class) + || skipNotification.getClass().isEnum()) { + map.put("skip_notification", skipNotification); + } else if (isListOfFile(skipNotification)) { + for (int i = 0; i < getListSize(skipNotification); i++) { + map.put("skip_notification[" + i + "]", getFromList(skipNotification, i)); + } + } else { + map.put( + "skip_notification", + JSON.getDefault().getMapper().writeValueAsString(skipNotification)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java index 902ec6f..9563284 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftRequest.java @@ -10,1462 +10,1490 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubEditorOptions; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubMergeField; -import com.dropbox.sign.model.SubTemplateRole; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * TemplateCreateEmbeddedDraftRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateCreateEmbeddedDraftRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - private Boolean allowCcs = true; + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + private Boolean allowCcs = true; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + 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 = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles = null; + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + private List ccRoles = null; - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - private SubEditorOptions editorOptions; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + private SubEditorOptions editorOptions; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - private Boolean forceSignerRoles = false; + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + private Boolean forceSignerRoles = false; - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - private Boolean forceSubjectMessage = false; + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + private Boolean forceSubjectMessage = false; - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups = null; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields = null; + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + private List mergeFields = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - private Boolean showPreview = false; + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + private Boolean showPreview = false; - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + private Boolean showProgressStepper = true; - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles = null; + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + private List signerRoles = null; - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - private Boolean skipMeNow = false; + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + private Boolean skipMeNow = false; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - private Boolean usePreexistingFields = false; + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + private Boolean usePreexistingFields = false; - public TemplateCreateEmbeddedDraftRequest() { - } + public TemplateCreateEmbeddedDraftRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateEmbeddedDraftRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateEmbeddedDraftRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftRequest.class); + } - static public TemplateCreateEmbeddedDraftRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftRequest.class - ); - } + public static TemplateCreateEmbeddedDraftRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftRequest.class); + } - public TemplateCreateEmbeddedDraftRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } + public TemplateCreateEmbeddedDraftRequest clientId(String clientId) { + this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } - public String getClientId() { - return clientId; - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + public TemplateCreateEmbeddedDraftRequest files(List files) { + this.files = files; + return this; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } + public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - public TemplateCreateEmbeddedDraftRequest files(List files) { - this.files = files; - return this; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } - public TemplateCreateEmbeddedDraftRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public TemplateCreateEmbeddedDraftRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } - public List getFiles() { - return files; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public TemplateCreateEmbeddedDraftRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public TemplateCreateEmbeddedDraftRequest allowCcs(Boolean allowCcs) { - this.allowCcs = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowCcs() { - return allowCcs; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(Boolean allowCcs) { - this.allowCcs = allowCcs; - } - - - public TemplateCreateEmbeddedDraftRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public TemplateCreateEmbeddedDraftRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); + public TemplateCreateEmbeddedDraftRequest allowCcs(Boolean allowCcs) { + this.allowCcs = allowCcs; + return this; } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public TemplateCreateEmbeddedDraftRequest ccRoles(List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); + + /** + * 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 @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowCcs() { + return allowCcs; } - this.ccRoles.add(ccRolesItem); - return this; - } - - /** - * The CC roles that must be assigned when using the template to send a signature request - * @return ccRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcRoles() { - return ccRoles; - } - - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(List ccRoles) { - this.ccRoles = ccRoles; - } - - public TemplateCreateEmbeddedDraftRequest editorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * @return editorOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - - public TemplateCreateEmbeddedDraftRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public TemplateCreateEmbeddedDraftRequest forceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * @return forceSignerRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } - - - public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * @return forceSubjectMessage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(Boolean allowCcs) { + this.allowCcs = allowCcs; + } + public TemplateCreateEmbeddedDraftRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - - public TemplateCreateEmbeddedDraftRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } - /** - * 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public TemplateCreateEmbeddedDraftRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); - } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } + public TemplateCreateEmbeddedDraftRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } - public TemplateCreateEmbeddedDraftRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - 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.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } + public TemplateCreateEmbeddedDraftRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - - public TemplateCreateEmbeddedDraftRequest mergeFields(List mergeFields) { - this.mergeFields = mergeFields; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); - } - this.mergeFields.add(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 - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } - public List getMergeFields() { - return mergeFields; - } - - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(List mergeFields) { - this.mergeFields = mergeFields; - } - - - public TemplateCreateEmbeddedDraftRequest message(String message) { - this.message = message; - return this; - } - - /** - * The default template email message. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public TemplateCreateEmbeddedDraftRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public TemplateCreateEmbeddedDraftRequest showPreview(Boolean showPreview) { - this.showPreview = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowPreview() { - return showPreview; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(Boolean showPreview) { - this.showPreview = showPreview; - } - - - public TemplateCreateEmbeddedDraftRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public TemplateCreateEmbeddedDraftRequest signerRoles(List signerRoles) { - this.signerRoles = signerRoles; - return this; - } - - public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); + public TemplateCreateEmbeddedDraftRequest ccRoles(List ccRoles) { + this.ccRoles = ccRoles; + return this; } - 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.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignerRoles() { - return signerRoles; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRoles(List signerRoles) { - this.signerRoles = signerRoles; - } - - - public TemplateCreateEmbeddedDraftRequest skipMeNow(Boolean skipMeNow) { - this.skipMeNow = 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 - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getSkipMeNow() { - return skipMeNow; - } - - - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - } - - - public TemplateCreateEmbeddedDraftRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The template title (alias). - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public TemplateCreateEmbeddedDraftRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public TemplateCreateEmbeddedDraftRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public TemplateCreateEmbeddedDraftRequest usePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = 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 - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUsePreexistingFields() { - return usePreexistingFields; - } - - - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - } - - - /** - * Return true if this TemplateCreateEmbeddedDraftRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest = (TemplateCreateEmbeddedDraftRequest) o; - return Objects.equals(this.clientId, templateCreateEmbeddedDraftRequest.clientId) && - Objects.equals(this.files, templateCreateEmbeddedDraftRequest.files) && - Objects.equals(this.fileUrls, templateCreateEmbeddedDraftRequest.fileUrls) && - Objects.equals(this.allowCcs, templateCreateEmbeddedDraftRequest.allowCcs) && - Objects.equals(this.allowReassign, templateCreateEmbeddedDraftRequest.allowReassign) && - Objects.equals(this.attachments, templateCreateEmbeddedDraftRequest.attachments) && - Objects.equals(this.ccRoles, templateCreateEmbeddedDraftRequest.ccRoles) && - Objects.equals(this.editorOptions, templateCreateEmbeddedDraftRequest.editorOptions) && - Objects.equals(this.fieldOptions, templateCreateEmbeddedDraftRequest.fieldOptions) && - Objects.equals(this.forceSignerRoles, templateCreateEmbeddedDraftRequest.forceSignerRoles) && - Objects.equals(this.forceSubjectMessage, templateCreateEmbeddedDraftRequest.forceSubjectMessage) && - Objects.equals(this.formFieldGroups, templateCreateEmbeddedDraftRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, templateCreateEmbeddedDraftRequest.formFieldRules) && - Objects.equals(this.formFieldsPerDocument, templateCreateEmbeddedDraftRequest.formFieldsPerDocument) && - Objects.equals(this.mergeFields, templateCreateEmbeddedDraftRequest.mergeFields) && - Objects.equals(this.message, templateCreateEmbeddedDraftRequest.message) && - Objects.equals(this.metadata, templateCreateEmbeddedDraftRequest.metadata) && - Objects.equals(this.showPreview, templateCreateEmbeddedDraftRequest.showPreview) && - Objects.equals(this.showProgressStepper, templateCreateEmbeddedDraftRequest.showProgressStepper) && - Objects.equals(this.signerRoles, templateCreateEmbeddedDraftRequest.signerRoles) && - Objects.equals(this.skipMeNow, templateCreateEmbeddedDraftRequest.skipMeNow) && - Objects.equals(this.subject, templateCreateEmbeddedDraftRequest.subject) && - Objects.equals(this.testMode, templateCreateEmbeddedDraftRequest.testMode) && - Objects.equals(this.title, templateCreateEmbeddedDraftRequest.title) && - Objects.equals(this.usePreexistingFields, templateCreateEmbeddedDraftRequest.usePreexistingFields); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, files, fileUrls, allowCcs, allowReassign, attachments, ccRoles, editorOptions, fieldOptions, forceSignerRoles, forceSubjectMessage, formFieldGroups, formFieldRules, formFieldsPerDocument, mergeFields, message, metadata, showPreview, showProgressStepper, signerRoles, skipMeNow, subject, testMode, title, usePreexistingFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; + public TemplateCreateEmbeddedDraftRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } + this.ccRoles.add(ccRolesItem); + return this; + } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + /** + * The CC roles that must be assigned when using the template to send a signature request + * + * @return ccRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcRoles() { + return ccRoles; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(List ccRoles) { + this.ccRoles = ccRoles; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + public TemplateCreateEmbeddedDraftRequest editorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - if (allowCcs.getClass().equals(java.io.File.class) || - allowCcs.getClass().equals(Integer.class) || - allowCcs.getClass().equals(String.class) || - allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for(int i = 0; i< getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } - else { - map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); - } + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorOptions getEditorOptions() { + return editorOptions; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + public TemplateCreateEmbeddedDraftRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - if (ccRoles.getClass().equals(java.io.File.class) || - ccRoles.getClass().equals(Integer.class) || - ccRoles.getClass().equals(String.class) || - ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for(int i = 0; i< getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } - else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - if (editorOptions.getClass().equals(java.io.File.class) || - editorOptions.getClass().equals(Integer.class) || - editorOptions.getClass().equals(String.class) || - editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for(int i = 0; i< getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } - else { - map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + public TemplateCreateEmbeddedDraftRequest forceSignerRoles(Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - if (forceSignerRoles.getClass().equals(java.io.File.class) || - forceSignerRoles.getClass().equals(Integer.class) || - forceSignerRoles.getClass().equals(String.class) || - forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for(int i = 0; i< getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } - else { - map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } + /** + * Provide users the ability to review/edit the template signer roles. + * + * @return forceSignerRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSignerRoles() { + return forceSignerRoles; } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - if (forceSubjectMessage.getClass().equals(java.io.File.class) || - forceSubjectMessage.getClass().equals(Integer.class) || - forceSubjectMessage.getClass().equals(String.class) || - forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for(int i = 0; i< getListSize(forceSubjectMessage); i++) { - map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); - } - } - else { - map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + public TemplateCreateEmbeddedDraftRequest forceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } + /** + * Provide users the ability to review/edit the template subject and message. + * + * @return forceSubjectMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - if (mergeFields.getClass().equals(java.io.File.class) || - mergeFields.getClass().equals(Integer.class) || - mergeFields.getClass().equals(String.class) || - mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for(int i = 0; i< getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } - else { - map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } + public TemplateCreateEmbeddedDraftRequest formFieldGroups( + List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + public TemplateCreateEmbeddedDraftRequest addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - if (showPreview.getClass().equals(java.io.File.class) || - showPreview.getClass().equals(Integer.class) || - showPreview.getClass().equals(String.class) || - showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for(int i = 0; i< getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } - else { - map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } + public TemplateCreateEmbeddedDraftRequest formFieldRules( + List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - if (signerRoles.getClass().equals(java.io.File.class) || - signerRoles.getClass().equals(Integer.class) || - signerRoles.getClass().equals(String.class) || - signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for(int i = 0; i< getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } - else { - map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); + public TemplateCreateEmbeddedDraftRequest addFormFieldRulesItem( + SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - if (skipMeNow.getClass().equals(java.io.File.class) || - skipMeNow.getClass().equals(Integer.class) || - skipMeNow.getClass().equals(String.class) || - skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for(int i = 0; i< getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } - else { - map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + public TemplateCreateEmbeddedDraftRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + public TemplateCreateEmbeddedDraftRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); } + 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.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + + public TemplateCreateEmbeddedDraftRequest mergeFields(List mergeFields) { + this.mergeFields = mergeFields; + return this; } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; + + public TemplateCreateEmbeddedDraftRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); } + this.mergeFields.add(mergeFieldsItem); + return this; + } - if (usePreexistingFields.getClass().equals(java.io.File.class) || - usePreexistingFields.getClass().equals(Integer.class) || - usePreexistingFields.getClass().equals(String.class) || - usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for(int i = 0; i< getListSize(usePreexistingFields); i++) { - map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMergeFields() { + return mergeFields; + } + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(List mergeFields) { + this.mergeFields = mergeFields; + } + + public TemplateCreateEmbeddedDraftRequest message(String message) { + this.message = message; + return this; + } + + /** + * The default template email message. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public TemplateCreateEmbeddedDraftRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public TemplateCreateEmbeddedDraftRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } - else { - map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public TemplateCreateEmbeddedDraftRequest showPreview(Boolean showPreview) { + this.showPreview = 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 @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowPreview() { + return showPreview; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(Boolean showPreview) { + this.showPreview = showPreview; + } + + public TemplateCreateEmbeddedDraftRequest showProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public TemplateCreateEmbeddedDraftRequest signerRoles(List signerRoles) { + this.signerRoles = signerRoles; + return this; + } + + public TemplateCreateEmbeddedDraftRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); } + this.signerRoles.add(signerRolesItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * An array of the designated signer roles that must be specified when sending a + * SignatureRequest using this Template. + * + * @return signerRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignerRoles() { + return signerRoles; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRoles(List signerRoles) { + this.signerRoles = signerRoles; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public TemplateCreateEmbeddedDraftRequest skipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipMeNow() { + return skipMeNow; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public TemplateCreateEmbeddedDraftRequest subject(String subject) { + this.subject = subject; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * The template title (alias). + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; } - return o.toString().replace("\n", "\n "); - } -} + public TemplateCreateEmbeddedDraftRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public TemplateCreateEmbeddedDraftRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public TemplateCreateEmbeddedDraftRequest usePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = 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 @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + /** Return true if this TemplateCreateEmbeddedDraftRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest = + (TemplateCreateEmbeddedDraftRequest) o; + return Objects.equals(this.clientId, templateCreateEmbeddedDraftRequest.clientId) + && Objects.equals(this.files, templateCreateEmbeddedDraftRequest.files) + && Objects.equals(this.fileUrls, templateCreateEmbeddedDraftRequest.fileUrls) + && Objects.equals(this.allowCcs, templateCreateEmbeddedDraftRequest.allowCcs) + && Objects.equals( + this.allowReassign, templateCreateEmbeddedDraftRequest.allowReassign) + && Objects.equals(this.attachments, templateCreateEmbeddedDraftRequest.attachments) + && Objects.equals(this.ccRoles, templateCreateEmbeddedDraftRequest.ccRoles) + && Objects.equals( + this.editorOptions, templateCreateEmbeddedDraftRequest.editorOptions) + && Objects.equals( + this.fieldOptions, templateCreateEmbeddedDraftRequest.fieldOptions) + && Objects.equals( + this.forceSignerRoles, templateCreateEmbeddedDraftRequest.forceSignerRoles) + && Objects.equals( + this.forceSubjectMessage, + templateCreateEmbeddedDraftRequest.forceSubjectMessage) + && Objects.equals( + this.formFieldGroups, templateCreateEmbeddedDraftRequest.formFieldGroups) + && Objects.equals( + this.formFieldRules, templateCreateEmbeddedDraftRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + templateCreateEmbeddedDraftRequest.formFieldsPerDocument) + && Objects.equals(this.mergeFields, templateCreateEmbeddedDraftRequest.mergeFields) + && Objects.equals(this.message, templateCreateEmbeddedDraftRequest.message) + && Objects.equals(this.metadata, templateCreateEmbeddedDraftRequest.metadata) + && Objects.equals(this.showPreview, templateCreateEmbeddedDraftRequest.showPreview) + && Objects.equals( + this.showProgressStepper, + templateCreateEmbeddedDraftRequest.showProgressStepper) + && Objects.equals(this.signerRoles, templateCreateEmbeddedDraftRequest.signerRoles) + && Objects.equals(this.skipMeNow, templateCreateEmbeddedDraftRequest.skipMeNow) + && Objects.equals(this.subject, templateCreateEmbeddedDraftRequest.subject) + && Objects.equals(this.testMode, templateCreateEmbeddedDraftRequest.testMode) + && Objects.equals(this.title, templateCreateEmbeddedDraftRequest.title) + && Objects.equals( + this.usePreexistingFields, + templateCreateEmbeddedDraftRequest.usePreexistingFields); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + files, + fileUrls, + allowCcs, + allowReassign, + attachments, + ccRoles, + editorOptions, + fieldOptions, + forceSignerRoles, + forceSubjectMessage, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + mergeFields, + message, + metadata, + showPreview, + showProgressStepper, + signerRoles, + skipMeNow, + subject, + testMode, + title, + usePreexistingFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ") + .append(toIndentedString(forceSubjectMessage)) + .append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" usePreexistingFields: ") + .append(toIndentedString(usePreexistingFields)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } + + if (allowCcs.getClass().equals(java.io.File.class) + || allowCcs.getClass().equals(Integer.class) + || allowCcs.getClass().equals(String.class) + || allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for (int i = 0; i < getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } else { + map.put( + "allow_ccs", + JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) + || ccRoles.getClass().equals(Integer.class) + || ccRoles.getClass().equals(String.class) + || ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for (int i = 0; i < getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } + + if (forceSignerRoles.getClass().equals(java.io.File.class) + || forceSignerRoles.getClass().equals(Integer.class) + || forceSignerRoles.getClass().equals(String.class) + || forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for (int i = 0; i < getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } else { + map.put( + "force_signer_roles", + JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } + } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } + + if (forceSubjectMessage.getClass().equals(java.io.File.class) + || forceSubjectMessage.getClass().equals(Integer.class) + || forceSubjectMessage.getClass().equals(String.class) + || forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for (int i = 0; i < getListSize(forceSubjectMessage); i++) { + map.put( + "force_subject_message[" + i + "]", + getFromList(forceSubjectMessage, i)); + } + } else { + map.put( + "force_subject_message", + JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } + + if (mergeFields.getClass().equals(java.io.File.class) + || mergeFields.getClass().equals(Integer.class) + || mergeFields.getClass().equals(String.class) + || mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for (int i = 0; i < getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } else { + map.put( + "merge_fields", + JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } + + if (showPreview.getClass().equals(java.io.File.class) + || showPreview.getClass().equals(Integer.class) + || showPreview.getClass().equals(String.class) + || showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for (int i = 0; i < getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } else { + map.put( + "show_preview", + JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; + } + + if (signerRoles.getClass().equals(java.io.File.class) + || signerRoles.getClass().equals(Integer.class) + || signerRoles.getClass().equals(String.class) + || signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for (int i = 0; i < getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } + } else { + map.put( + "signer_roles", + JSON.getDefault().getMapper().writeValueAsString(signerRoles)); + } + } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } + + if (skipMeNow.getClass().equals(java.io.File.class) + || skipMeNow.getClass().equals(Integer.class) + || skipMeNow.getClass().equals(String.class) + || skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for (int i = 0; i < getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } else { + map.put( + "skip_me_now", + JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } + + if (usePreexistingFields.getClass().equals(java.io.File.class) + || usePreexistingFields.getClass().equals(Integer.class) + || usePreexistingFields.getClass().equals(String.class) + || usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for (int i = 0; i < getListSize(usePreexistingFields); i++) { + map.put( + "use_preexisting_fields[" + i + "]", + getFromList(usePreexistingFields, i)); + } + } else { + map.put( + "use_preexisting_fields", + JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } + } + } 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/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java index a0f7bba..21f1d7d 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponse.java @@ -10,231 +10,219 @@ * 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.TemplateCreateEmbeddedDraftResponseTemplate; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateCreateEmbeddedDraftResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public TemplateCreateEmbeddedDraftResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateEmbeddedDraftResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponse.class); - } - - static public TemplateCreateEmbeddedDraftResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftResponse.class - ); - } - - public TemplateCreateEmbeddedDraftResponse template(TemplateCreateEmbeddedDraftResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { - return template; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(TemplateCreateEmbeddedDraftResponseTemplate template) { - this.template = template; - } - - - public TemplateCreateEmbeddedDraftResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateCreateEmbeddedDraftResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraftResponse = (TemplateCreateEmbeddedDraftResponse) o; - return Objects.equals(this.template, templateCreateEmbeddedDraftResponse.template) && - Objects.equals(this.warnings, templateCreateEmbeddedDraftResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(template, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).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 (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private TemplateCreateEmbeddedDraftResponseTemplate template; - if (template.getClass().equals(java.io.File.class) || - template.getClass().equals(Integer.class) || - template.getClass().equals(String.class) || - template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for(int i = 0; i< getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } - else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TemplateCreateEmbeddedDraftResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateEmbeddedDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponse.class); + } + + public static TemplateCreateEmbeddedDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftResponse.class); + } + + public TemplateCreateEmbeddedDraftResponse template( + TemplateCreateEmbeddedDraftResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TemplateCreateEmbeddedDraftResponseTemplate getTemplate() { + return template; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(TemplateCreateEmbeddedDraftResponseTemplate template) { + this.template = template; + } + + public TemplateCreateEmbeddedDraftResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TemplateCreateEmbeddedDraftResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateCreateEmbeddedDraftResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateEmbeddedDraftResponse templateCreateEmbeddedDraftResponse = + (TemplateCreateEmbeddedDraftResponse) o; + return Objects.equals(this.template, templateCreateEmbeddedDraftResponse.template) + && Objects.equals(this.warnings, templateCreateEmbeddedDraftResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(template, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) + || template.getClass().equals(Integer.class) + || template.getClass().equals(String.class) + || template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for (int i = 0; i < getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java index 819f1d3..7e2fc0b 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateEmbeddedDraftResponseTemplate.java @@ -10,335 +10,326 @@ * 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.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; /** - * Template object with parameters: `template_id`, `edit_url`, `expires_at`. + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateCreateEmbeddedDraftResponseTemplate { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - private String templateId; - - public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; - private String editUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public static final String JSON_PROPERTY_WARNINGS = "warnings"; - @Deprecated - private List warnings = null; - - public TemplateCreateEmbeddedDraftResponseTemplate() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateEmbeddedDraftResponseTemplate init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateEmbeddedDraftResponseTemplate.class); - } - - static public TemplateCreateEmbeddedDraftResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateEmbeddedDraftResponseTemplate.class - ); - } - - public TemplateCreateEmbeddedDraftResponseTemplate templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * @return templateId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTemplateId() { - return templateId; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - public TemplateCreateEmbeddedDraftResponseTemplate editUrl(String editUrl) { - this.editUrl = editUrl; - return this; - } - - /** - * Link to edit the template. - * @return editUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEditUrl() { - return editUrl; - } - - - @JsonProperty(JSON_PROPERTY_EDIT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditUrl(String editUrl) { - this.editUrl = editUrl; - } - - - public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * When the link expires. - * @return expiresAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - @Deprecated - public TemplateCreateEmbeddedDraftResponseTemplate warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; + + public static final String JSON_PROPERTY_EDIT_URL = "edit_url"; + private String editUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated private List warnings = null; + + public TemplateCreateEmbeddedDraftResponseTemplate() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateEmbeddedDraftResponseTemplate init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateCreateEmbeddedDraftResponseTemplate.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateCreateEmbeddedDraftResponseTemplate object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static TemplateCreateEmbeddedDraftResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateEmbeddedDraftResponseTemplate.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public TemplateCreateEmbeddedDraftResponseTemplate templateId(String templateId) { + this.templateId = templateId; + return this; } - TemplateCreateEmbeddedDraftResponseTemplate templateCreateEmbeddedDraftResponseTemplate = (TemplateCreateEmbeddedDraftResponseTemplate) o; - return Objects.equals(this.templateId, templateCreateEmbeddedDraftResponseTemplate.templateId) && - Objects.equals(this.editUrl, templateCreateEmbeddedDraftResponseTemplate.editUrl) && - Objects.equals(this.expiresAt, templateCreateEmbeddedDraftResponseTemplate.expiresAt) && - Objects.equals(this.warnings, templateCreateEmbeddedDraftResponseTemplate.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(templateId, editUrl, expiresAt, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateEmbeddedDraftResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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 (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); - } + /** + * The id of the Template. + * + * @return templateId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTemplateId() { + return templateId; } - if (editUrl != null) { - if (isFileTypeOrListOfFiles(editUrl)) { - fileTypeFound = true; - } - if (editUrl.getClass().equals(java.io.File.class) || - editUrl.getClass().equals(Integer.class) || - editUrl.getClass().equals(String.class) || - editUrl.getClass().isEnum()) { - map.put("edit_url", editUrl); - } else if (isListOfFile(editUrl)) { - for(int i = 0; i< getListSize(editUrl); i++) { - map.put("edit_url[" + i + "]", getFromList(editUrl, i)); - } - } - else { - map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); - } + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(String templateId) { + this.templateId = templateId; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } + public TemplateCreateEmbeddedDraftResponseTemplate editUrl(String editUrl) { + this.editUrl = editUrl; + return this; + } + + /** + * Link to edit the template. + * + * @return editUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEditUrl() { + return editUrl; + } + + @JsonProperty(JSON_PROPERTY_EDIT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditUrl(String editUrl) { + this.editUrl = editUrl; + } + + public TemplateCreateEmbeddedDraftResponseTemplate expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + @Deprecated + public TemplateCreateEmbeddedDraftResponseTemplate warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateCreateEmbeddedDraftResponseTemplate addWarningsItem( + WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateCreateEmbeddedDraftResponseTemplate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateEmbeddedDraftResponseTemplate templateCreateEmbeddedDraftResponseTemplate = + (TemplateCreateEmbeddedDraftResponseTemplate) o; + return Objects.equals( + this.templateId, templateCreateEmbeddedDraftResponseTemplate.templateId) + && Objects.equals(this.editUrl, templateCreateEmbeddedDraftResponseTemplate.editUrl) + && Objects.equals( + this.expiresAt, templateCreateEmbeddedDraftResponseTemplate.expiresAt) + && Objects.equals( + this.warnings, templateCreateEmbeddedDraftResponseTemplate.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(templateId, editUrl, expiresAt, warnings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateEmbeddedDraftResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) + || templateId.getClass().equals(Integer.class) + || templateId.getClass().equals(String.class) + || templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for (int i = 0; i < getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } else { + map.put( + "template_id", + JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + if (editUrl != null) { + if (isFileTypeOrListOfFiles(editUrl)) { + fileTypeFound = true; + } + + if (editUrl.getClass().equals(java.io.File.class) + || editUrl.getClass().equals(Integer.class) + || editUrl.getClass().equals(String.class) + || editUrl.getClass().isEnum()) { + map.put("edit_url", editUrl); + } else if (isListOfFile(editUrl)) { + for (int i = 0; i < getListSize(editUrl); i++) { + map.put("edit_url[" + i + "]", getFromList(editUrl, i)); + } + } else { + map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + 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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java b/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java index 54f9e49..9a554ed 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateRequest.java @@ -10,1111 +10,1116 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubMergeField; -import com.dropbox.sign.model.SubTemplateRole; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * TemplateCreateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateCreateRequest { - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = new ArrayList<>(); + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = new ArrayList<>(); - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles = new ArrayList<>(); + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + private List signerRoles = new ArrayList<>(); - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + 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 = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles = null; + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + private List ccRoles = null; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + 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 = null; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; - private List mergeFields = null; + public static final String JSON_PROPERTY_MERGE_FIELDS = "merge_fields"; + private List mergeFields = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - private Boolean usePreexistingFields = false; + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + private Boolean usePreexistingFields = false; - public TemplateCreateRequest() { - } + public TemplateCreateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateRequest.class); + } - static public TemplateCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateRequest.class - ); - } + public static TemplateCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TemplateCreateRequest.class); + } - public TemplateCreateRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } + public TemplateCreateRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; + } - public TemplateCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); + public TemplateCreateRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); + } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; } - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; + } - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + } + public TemplateCreateRequest signerRoles(List signerRoles) { + this.signerRoles = signerRoles; + return this; + } - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } + 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 + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSignerRoles() { + return signerRoles; + } - public TemplateCreateRequest signerRoles(List signerRoles) { - this.signerRoles = signerRoles; - return this; - } + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignerRoles(List signerRoles) { + this.signerRoles = signerRoles; + } - public TemplateCreateRequest addSignerRolesItem(SubTemplateRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); + public TemplateCreateRequest files(List files) { + this.files = files; + return this; } - 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 - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getSignerRoles() { - return signerRoles; - } + public TemplateCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSignerRoles(List signerRoles) { - this.signerRoles = signerRoles; - } - - - public TemplateCreateRequest files(List files) { - this.files = files; - return this; - } - - public TemplateCreateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public TemplateCreateRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public TemplateCreateRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public TemplateCreateRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public TemplateCreateRequest ccRoles(List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); - } - this.ccRoles.add(ccRolesItem); - return this; - } - - /** - * The CC roles that must be assigned when using the template to send a signature request - * @return ccRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcRoles() { - return ccRoles; - } - - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(List ccRoles) { - this.ccRoles = ccRoles; - } - - - public TemplateCreateRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + public TemplateCreateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } - public TemplateCreateRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public TemplateCreateRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } + public TemplateCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } - public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public TemplateCreateRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } - public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); - } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - - public TemplateCreateRequest mergeFields(List mergeFields) { - this.mergeFields = mergeFields; - return this; - } - - public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { - if (this.mergeFields == null) { - this.mergeFields = new ArrayList<>(); - } - this.mergeFields.add(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 - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getMergeFields() { - return mergeFields; - } - - - @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMergeFields(List mergeFields) { - this.mergeFields = mergeFields; - } - - - public TemplateCreateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The default template email message. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public TemplateCreateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + public TemplateCreateRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - public TemplateCreateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The template title (alias). - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public TemplateCreateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public TemplateCreateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public TemplateCreateRequest usePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = 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 - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUsePreexistingFields() { - return usePreexistingFields; - } - - - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - } - - - /** - * Return true if this TemplateCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateCreateRequest templateCreateRequest = (TemplateCreateRequest) o; - return Objects.equals(this.formFieldsPerDocument, templateCreateRequest.formFieldsPerDocument) && - Objects.equals(this.signerRoles, templateCreateRequest.signerRoles) && - Objects.equals(this.files, templateCreateRequest.files) && - Objects.equals(this.fileUrls, templateCreateRequest.fileUrls) && - Objects.equals(this.allowReassign, templateCreateRequest.allowReassign) && - Objects.equals(this.attachments, templateCreateRequest.attachments) && - Objects.equals(this.ccRoles, templateCreateRequest.ccRoles) && - Objects.equals(this.clientId, templateCreateRequest.clientId) && - Objects.equals(this.fieldOptions, templateCreateRequest.fieldOptions) && - Objects.equals(this.formFieldGroups, templateCreateRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, templateCreateRequest.formFieldRules) && - Objects.equals(this.mergeFields, templateCreateRequest.mergeFields) && - Objects.equals(this.message, templateCreateRequest.message) && - Objects.equals(this.metadata, templateCreateRequest.metadata) && - Objects.equals(this.subject, templateCreateRequest.subject) && - Objects.equals(this.testMode, templateCreateRequest.testMode) && - Objects.equals(this.title, templateCreateRequest.title) && - Objects.equals(this.usePreexistingFields, templateCreateRequest.usePreexistingFields); - } - - @Override - public int hashCode() { - return Objects.hash(formFieldsPerDocument, signerRoles, files, fileUrls, allowReassign, attachments, ccRoles, clientId, fieldOptions, formFieldGroups, formFieldRules, mergeFields, message, metadata, subject, testMode, title, usePreexistingFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateRequest {\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); - } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - if (signerRoles.getClass().equals(java.io.File.class) || - signerRoles.getClass().equals(Integer.class) || - signerRoles.getClass().equals(String.class) || - signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for(int i = 0; i< getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } - else { - map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); - } + public TemplateCreateRequest attachments(List attachments) { + this.attachments = attachments; + return this; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + public TemplateCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } + this.attachments.add(attachmentsItem); + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); - } + public TemplateCreateRequest ccRoles(List ccRoles) { + this.ccRoles = ccRoles; + return this; } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - if (ccRoles.getClass().equals(java.io.File.class) || - ccRoles.getClass().equals(Integer.class) || - ccRoles.getClass().equals(String.class) || - ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for(int i = 0; i< getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } - else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + public TemplateCreateRequest addCcRolesItem(String ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } + this.ccRoles.add(ccRolesItem); + return this; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + /** + * The CC roles that must be assigned when using the template to send a signature request + * + * @return ccRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcRoles() { + return ccRoles; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(List ccRoles) { + this.ccRoles = ccRoles; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + public TemplateCreateRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (mergeFields != null) { - if (isFileTypeOrListOfFiles(mergeFields)) { - fileTypeFound = true; - } - if (mergeFields.getClass().equals(java.io.File.class) || - mergeFields.getClass().equals(Integer.class) || - mergeFields.getClass().equals(String.class) || - mergeFields.getClass().isEnum()) { - map.put("merge_fields", mergeFields); - } else if (isListOfFile(mergeFields)) { - for(int i = 0; i< getListSize(mergeFields); i++) { - map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); - } - } - else { - map.put("merge_fields", JSON.getDefault().getMapper().writeValueAsString(mergeFields)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + public TemplateCreateRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + public TemplateCreateRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; + + public TemplateCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; + } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + } + + public TemplateCreateRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; + } + + public TemplateCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + this.formFieldRules.add(formFieldRulesItem); + return this; + } + + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + } + + public TemplateCreateRequest mergeFields(List mergeFields) { + this.mergeFields = mergeFields; + return this; + } + + public TemplateCreateRequest addMergeFieldsItem(SubMergeField mergeFieldsItem) { + if (this.mergeFields == null) { + this.mergeFields = new ArrayList<>(); } + this.mergeFields.add(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 @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getMergeFields() { + return mergeFields; } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_MERGE_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMergeFields(List mergeFields) { + this.mergeFields = mergeFields; + } + + public TemplateCreateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The default template email message. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public TemplateCreateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public TemplateCreateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; + } - if (usePreexistingFields.getClass().equals(java.io.File.class) || - usePreexistingFields.getClass().equals(Integer.class) || - usePreexistingFields.getClass().equals(String.class) || - usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for(int i = 0; i< getListSize(usePreexistingFields); i++) { - map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public TemplateCreateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The template title (alias). + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public TemplateCreateRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public TemplateCreateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public TemplateCreateRequest usePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = 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 @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + /** Return true if this TemplateCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateRequest templateCreateRequest = (TemplateCreateRequest) o; + return Objects.equals( + this.formFieldsPerDocument, templateCreateRequest.formFieldsPerDocument) + && Objects.equals(this.signerRoles, templateCreateRequest.signerRoles) + && Objects.equals(this.files, templateCreateRequest.files) + && Objects.equals(this.fileUrls, templateCreateRequest.fileUrls) + && Objects.equals(this.allowReassign, templateCreateRequest.allowReassign) + && Objects.equals(this.attachments, templateCreateRequest.attachments) + && Objects.equals(this.ccRoles, templateCreateRequest.ccRoles) + && Objects.equals(this.clientId, templateCreateRequest.clientId) + && Objects.equals(this.fieldOptions, templateCreateRequest.fieldOptions) + && Objects.equals(this.formFieldGroups, templateCreateRequest.formFieldGroups) + && Objects.equals(this.formFieldRules, templateCreateRequest.formFieldRules) + && Objects.equals(this.mergeFields, templateCreateRequest.mergeFields) + && Objects.equals(this.message, templateCreateRequest.message) + && Objects.equals(this.metadata, templateCreateRequest.metadata) + && Objects.equals(this.subject, templateCreateRequest.subject) + && Objects.equals(this.testMode, templateCreateRequest.testMode) + && Objects.equals(this.title, templateCreateRequest.title) + && Objects.equals( + this.usePreexistingFields, templateCreateRequest.usePreexistingFields); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + formFieldsPerDocument, + signerRoles, + files, + fileUrls, + allowReassign, + attachments, + ccRoles, + clientId, + fieldOptions, + formFieldGroups, + formFieldRules, + mergeFields, + message, + metadata, + subject, + testMode, + title, + usePreexistingFields); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateRequest {\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" mergeFields: ").append(toIndentedString(mergeFields)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" usePreexistingFields: ") + .append(toIndentedString(usePreexistingFields)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; + } + + if (signerRoles.getClass().equals(java.io.File.class) + || signerRoles.getClass().equals(Integer.class) + || signerRoles.getClass().equals(String.class) + || signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for (int i = 0; i < getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } + } else { + map.put( + "signer_roles", + JSON.getDefault().getMapper().writeValueAsString(signerRoles)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) + || ccRoles.getClass().equals(Integer.class) + || ccRoles.getClass().equals(String.class) + || ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for (int i = 0; i < getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (mergeFields != null) { + if (isFileTypeOrListOfFiles(mergeFields)) { + fileTypeFound = true; + } + + if (mergeFields.getClass().equals(java.io.File.class) + || mergeFields.getClass().equals(Integer.class) + || mergeFields.getClass().equals(String.class) + || mergeFields.getClass().isEnum()) { + map.put("merge_fields", mergeFields); + } else if (isListOfFile(mergeFields)) { + for (int i = 0; i < getListSize(mergeFields); i++) { + map.put("merge_fields[" + i + "]", getFromList(mergeFields, i)); + } + } else { + map.put( + "merge_fields", + JSON.getDefault().getMapper().writeValueAsString(mergeFields)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } + + if (usePreexistingFields.getClass().equals(java.io.File.class) + || usePreexistingFields.getClass().equals(Integer.class) + || usePreexistingFields.getClass().equals(String.class) + || usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for (int i = 0; i < getListSize(usePreexistingFields); i++) { + map.put( + "use_preexisting_fields[" + i + "]", + getFromList(usePreexistingFields, i)); + } + } else { + map.put( + "use_preexisting_fields", + JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java b/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java index 5c51487..3c228e8 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateResponse.java @@ -10,231 +10,216 @@ * 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.TemplateCreateResponseTemplate; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateCreateResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public TemplateCreateResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateResponse.class); - } - - static public TemplateCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateResponse.class - ); - } - - public TemplateCreateResponse template(TemplateCreateResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TemplateCreateResponseTemplate getTemplate() { - return template; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(TemplateCreateResponseTemplate template) { - this.template = template; - } - - - public TemplateCreateResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateCreateResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateCreateResponse templateCreateResponse = (TemplateCreateResponse) o; - return Objects.equals(this.template, templateCreateResponse.template) && - Objects.equals(this.warnings, templateCreateResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(template, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).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 (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private TemplateCreateResponseTemplate template; - if (template.getClass().equals(java.io.File.class) || - template.getClass().equals(Integer.class) || - template.getClass().equals(String.class) || - template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for(int i = 0; i< getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } - else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TemplateCreateResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateResponse.class); + } + + public static TemplateCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TemplateCreateResponse.class); + } + + public TemplateCreateResponse template(TemplateCreateResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TemplateCreateResponseTemplate getTemplate() { + return template; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(TemplateCreateResponseTemplate template) { + this.template = template; + } + + public TemplateCreateResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TemplateCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateResponse templateCreateResponse = (TemplateCreateResponse) o; + return Objects.equals(this.template, templateCreateResponse.template) + && Objects.equals(this.warnings, templateCreateResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(template, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) + || template.getClass().equals(Integer.class) + || template.getClass().equals(String.class) + || template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for (int i = 0; i < getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java index 7f8e5a5..017ed6e 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateCreateResponseTemplate.java @@ -10,169 +10,161 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Template object with parameters: `template_id`. - */ -@JsonPropertyOrder({ - TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** Template object with parameters: `template_id`. */ +@JsonPropertyOrder({TemplateCreateResponseTemplate.JSON_PROPERTY_TEMPLATE_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateCreateResponseTemplate { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - private String templateId; - - public TemplateCreateResponseTemplate() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateCreateResponseTemplate init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateCreateResponseTemplate.class); - } - - static public TemplateCreateResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateCreateResponseTemplate.class - ); - } - - public TemplateCreateResponseTemplate templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * @return templateId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTemplateId() { - return templateId; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - /** - * Return true if this TemplateCreateResponseTemplate object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; + + public TemplateCreateResponseTemplate() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateCreateResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateCreateResponseTemplate.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateCreateResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateCreateResponseTemplate.class); } - TemplateCreateResponseTemplate templateCreateResponseTemplate = (TemplateCreateResponseTemplate) o; - return Objects.equals(this.templateId, templateCreateResponseTemplate.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateCreateResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } + public TemplateCreateResponseTemplate templateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * + * @return templateId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTemplateId() { + return templateId; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + /** Return true if this TemplateCreateResponseTemplate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateCreateResponseTemplate templateCreateResponseTemplate = + (TemplateCreateResponseTemplate) o; + return Objects.equals(this.templateId, templateCreateResponseTemplate.templateId); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateCreateResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) + || templateId.getClass().equals(Integer.class) + || templateId.getClass().equals(String.class) + || templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for (int i = 0; i < getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } else { + map.put( + "template_id", + JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java b/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java index 6924483..65be6fd 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateEditResponse.java @@ -10,169 +10,159 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateEditResponse - */ -@JsonPropertyOrder({ - TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** TemplateEditResponse */ +@JsonPropertyOrder({TemplateEditResponse.JSON_PROPERTY_TEMPLATE_ID}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateEditResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - private String templateId; - - public TemplateEditResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateEditResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); - } - - static public TemplateEditResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateEditResponse.class - ); - } - - public TemplateEditResponse templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * @return templateId - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTemplateId() { - return templateId; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - /** - * Return true if this TemplateEditResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; + + public TemplateEditResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateEditResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateEditResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateEditResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TemplateEditResponse.class); } - TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; - return Objects.equals(this.templateId, templateEditResponse.templateId); - } - - @Override - public int hashCode() { - return Objects.hash(templateId); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateEditResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } + public TemplateEditResponse templateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * + * @return templateId + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTemplateId() { + return templateId; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + /** Return true if this TemplateEditResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateEditResponse templateEditResponse = (TemplateEditResponse) o; + return Objects.equals(this.templateId, templateEditResponse.templateId); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(templateId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateEditResponse {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) + || templateId.getClass().equals(Integer.class) + || templateId.getClass().equals(String.class) + || templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for (int i = 0; i < getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } else { + map.put( + "template_id", + JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java b/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java index a5d3467..1c4f53d 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateGetResponse.java @@ -10,231 +10,215 @@ * 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.TemplateResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateGetResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public TemplateGetResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateGetResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateGetResponse.class); - } - - static public TemplateGetResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateGetResponse.class - ); - } - - public TemplateGetResponse template(TemplateResponse template) { - this.template = template; - return this; - } - - /** - * Get template - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TemplateResponse getTemplate() { - return template; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(TemplateResponse template) { - this.template = template; - } - - - public TemplateGetResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateGetResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateGetResponse templateGetResponse = (TemplateGetResponse) o; - return Objects.equals(this.template, templateGetResponse.template) && - Objects.equals(this.warnings, templateGetResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(template, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateGetResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).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 (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private TemplateResponse template; - if (template.getClass().equals(java.io.File.class) || - template.getClass().equals(Integer.class) || - template.getClass().equals(String.class) || - template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for(int i = 0; i< getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } - } - else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public TemplateGetResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateGetResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateGetResponse.class); + } + + public static TemplateGetResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TemplateGetResponse.class); + } + + public TemplateGetResponse template(TemplateResponse template) { + this.template = template; + return this; + } + + /** + * Get template + * + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TemplateResponse getTemplate() { + return template; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(TemplateResponse template) { + this.template = template; + } + + public TemplateGetResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TemplateGetResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateGetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateGetResponse templateGetResponse = (TemplateGetResponse) o; + return Objects.equals(this.template, templateGetResponse.template) + && Objects.equals(this.warnings, templateGetResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(template, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateGetResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) + || template.getClass().equals(Integer.class) + || template.getClass().equals(String.class) + || template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for (int i = 0; i < getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateListResponse.java b/src/main/java/com/dropbox/sign/model/TemplateListResponse.java index 3af113e..70385b0 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateListResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateListResponse.java @@ -10,290 +10,274 @@ * 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.ListInfoResponse; -import com.dropbox.sign.model.TemplateResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateListResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateListResponse { - public static final String JSON_PROPERTY_TEMPLATES = "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 = null; - - public TemplateListResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateListResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateListResponse.class); - } - - static public TemplateListResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateListResponse.class - ); - } - - public TemplateListResponse templates(List templates) { - this.templates = templates; - return this; - } - - public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { - if (this.templates == null) { - this.templates = new ArrayList<>(); - } - this.templates.add(templatesItem); - return this; - } - - /** - * List of templates that the API caller has access to. - * @return templates - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getTemplates() { - return templates; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplates(List templates) { - this.templates = templates; - } - - - public TemplateListResponse 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 TemplateListResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATES = "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 = null; + + public TemplateListResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateListResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateListResponse.class); } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateListResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + + public static TemplateListResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TemplateListResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public TemplateListResponse templates(List templates) { + this.templates = templates; + return this; } - TemplateListResponse templateListResponse = (TemplateListResponse) o; - return Objects.equals(this.templates, templateListResponse.templates) && - Objects.equals(this.listInfo, templateListResponse.listInfo) && - Objects.equals(this.warnings, templateListResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(templates, listInfo, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateListResponse {\n"); - sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); - sb.append(" listInfo: ").append(toIndentedString(listInfo)).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 (templates != null) { - if (isFileTypeOrListOfFiles(templates)) { - fileTypeFound = true; - } - if (templates.getClass().equals(java.io.File.class) || - templates.getClass().equals(Integer.class) || - templates.getClass().equals(String.class) || - templates.getClass().isEnum()) { - map.put("templates", templates); - } else if (isListOfFile(templates)) { - for(int i = 0; i< getListSize(templates); i++) { - map.put("templates[" + i + "]", getFromList(templates, i)); - } - } - else { - map.put("templates", JSON.getDefault().getMapper().writeValueAsString(templates)); + public TemplateListResponse addTemplatesItem(TemplateResponse templatesItem) { + if (this.templates == null) { + this.templates = new ArrayList<>(); } + this.templates.add(templatesItem); + return this; } - 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)); - } + /** + * List of templates that the API caller has access to. + * + * @return templates + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplates() { + return templates; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_TEMPLATES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplates(List templates) { + this.templates = templates; + } + + public TemplateListResponse 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 TemplateListResponse warnings(List warnings) { + this.warnings = warnings; + return this; + } + + public TemplateListResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateListResponse templateListResponse = (TemplateListResponse) o; + return Objects.equals(this.templates, templateListResponse.templates) + && Objects.equals(this.listInfo, templateListResponse.listInfo) + && Objects.equals(this.warnings, templateListResponse.warnings); + } + + @Override + public int hashCode() { + return Objects.hash(templates, listInfo, warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateListResponse {\n"); + sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); + sb.append(" listInfo: ").append(toIndentedString(listInfo)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templates != null) { + if (isFileTypeOrListOfFiles(templates)) { + fileTypeFound = true; + } + + if (templates.getClass().equals(java.io.File.class) + || templates.getClass().equals(Integer.class) + || templates.getClass().equals(String.class) + || templates.getClass().isEnum()) { + map.put("templates", templates); + } else if (isListOfFile(templates)) { + for (int i = 0; i < getListSize(templates); i++) { + map.put("templates[" + i + "]", getFromList(templates, i)); + } + } else { + map.put( + "templates", + JSON.getDefault().getMapper().writeValueAsString(templates)); + } + } + 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 (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); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java b/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java index 76894ef..28d04e0 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateRemoveUserRequest.java @@ -10,219 +10,212 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateRemoveUserRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateRemoveUserRequest { - 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 TemplateRemoveUserRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateRemoveUserRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateRemoveUserRequest.class); - } - - static public TemplateRemoveUserRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateRemoveUserRequest.class - ); - } - - public TemplateRemoveUserRequest accountId(String accountId) { - this.accountId = 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 - @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 TemplateRemoveUserRequest emailAddress(String emailAddress) { - this.emailAddress = 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 - @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 TemplateRemoveUserRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateRemoveUserRequest templateRemoveUserRequest = (TemplateRemoveUserRequest) o; - return Objects.equals(this.accountId, templateRemoveUserRequest.accountId) && - Objects.equals(this.emailAddress, templateRemoveUserRequest.emailAddress); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateRemoveUserRequest {\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 (accountId != null) { - if (isFileTypeOrListOfFiles(accountId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; - 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)); - } + public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address"; + private String emailAddress; + + public TemplateRemoveUserRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateRemoveUserRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateRemoveUserRequest.class); } - 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)); - } + public static TemplateRemoveUserRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateRemoveUserRequest.class); + } + + public TemplateRemoveUserRequest accountId(String accountId) { + this.accountId = 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 @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 TemplateRemoveUserRequest emailAddress(String emailAddress) { + this.emailAddress = 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 @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 TemplateRemoveUserRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateRemoveUserRequest templateRemoveUserRequest = (TemplateRemoveUserRequest) o; + return Objects.equals(this.accountId, templateRemoveUserRequest.accountId) + && Objects.equals(this.emailAddress, templateRemoveUserRequest.emailAddress); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateRemoveUserRequest {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponse.java b/src/main/java/com/dropbox/sign/model/TemplateResponse.java index 5a89f48..3a0e14a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponse.java @@ -10,935 +10,912 @@ * 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.TemplateResponseAccount; -import com.dropbox.sign.model.TemplateResponseCCRole; -import com.dropbox.sign.model.TemplateResponseDocument; -import com.dropbox.sign.model.TemplateResponseDocumentCustomFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseSignerRole; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains information about the templates you and your team have created. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponse { - public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; - private String templateId; + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; - private Integer updatedAt; + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Integer updatedAt; - public static final String JSON_PROPERTY_IS_EMBEDDED = "is_embedded"; - private Boolean isEmbedded; + public static final String JSON_PROPERTY_IS_EMBEDDED = "is_embedded"; + private Boolean isEmbedded; - public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; - private Boolean isCreator; + public static final String JSON_PROPERTY_IS_CREATOR = "is_creator"; + private Boolean isCreator; - public static final String JSON_PROPERTY_CAN_EDIT = "can_edit"; - private Boolean canEdit; + public static final String JSON_PROPERTY_CAN_EDIT = "can_edit"; + private Boolean canEdit; - public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - private Boolean isLocked; + public static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + private Boolean isLocked; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Object metadata; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Object metadata; - public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; - private List signerRoles = null; + public static final String JSON_PROPERTY_SIGNER_ROLES = "signer_roles"; + private List signerRoles = null; - public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; - private List ccRoles = null; + public static final String JSON_PROPERTY_CC_ROLES = "cc_roles"; + private List ccRoles = null; - public static final String JSON_PROPERTY_DOCUMENTS = "documents"; - private List documents = null; + public static final String JSON_PROPERTY_DOCUMENTS = "documents"; + 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_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_NAMED_FORM_FIELDS = "named_form_fields"; + @Deprecated private List namedFormFields = null; - public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; - private List accounts = null; + public static final String JSON_PROPERTY_ACCOUNTS = "accounts"; + private List accounts = null; - public TemplateResponse() { - } + public TemplateResponse() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponse.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponse.class); + } - static public TemplateResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponse.class - ); - } + public static TemplateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), TemplateResponse.class); + } - public TemplateResponse templateId(String templateId) { - this.templateId = templateId; - return this; - } + public TemplateResponse templateId(String templateId) { + this.templateId = templateId; + return this; + } - /** - * The id of the Template. - * @return templateId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * The id of the Template. + * + * @return templateId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTemplateId() { + return templateId; + } - public String getTemplateId() { - return templateId; - } + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + public TemplateResponse title(String title) { + this.title = title; + return this; + } - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(String templateId) { - this.templateId = templateId; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } - public TemplateResponse title(String title) { - this.title = title; - return this; - } + public TemplateResponse message(String message) { + this.message = message; + 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 - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - + public TemplateResponse updatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + return this; + } - public TemplateResponse message(String message) { - this.message = 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 - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public TemplateResponse updatedAt(Integer updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Time the template was last updated. - * @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 TemplateResponse isEmbedded(Boolean isEmbedded) { - this.isEmbedded = 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 - @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsEmbedded() { - return isEmbedded; - } - - - @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsEmbedded(Boolean isEmbedded) { - this.isEmbedded = isEmbedded; - } - - - public TemplateResponse isCreator(Boolean isCreator) { - this.isCreator = 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 - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Time the template was last updated. + * + * @return updatedAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUpdatedAt() { + return updatedAt; + } - public Boolean getIsCreator() { - return isCreator; - } - - - @JsonProperty(JSON_PROPERTY_IS_CREATOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsCreator(Boolean isCreator) { - this.isCreator = isCreator; - } - - - public TemplateResponse canEdit(Boolean canEdit) { - this.canEdit = 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 - @JsonProperty(JSON_PROPERTY_CAN_EDIT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Integer updatedAt) { + this.updatedAt = updatedAt; + } - public Boolean getCanEdit() { - return canEdit; - } + public TemplateResponse isEmbedded(Boolean isEmbedded) { + this.isEmbedded = 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 @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsEmbedded() { + return isEmbedded; + } - @JsonProperty(JSON_PROPERTY_CAN_EDIT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCanEdit(Boolean canEdit) { - this.canEdit = canEdit; - } - - - public TemplateResponse isLocked(Boolean isLocked) { - this.isLocked = 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 - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsLocked() { - return isLocked; - } - - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(Boolean isLocked) { - this.isLocked = isLocked; - } - - - public TemplateResponse metadata(Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * The metadata attached to the template. - * @return metadata - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getMetadata() { - return metadata; - } + @JsonProperty(JSON_PROPERTY_IS_EMBEDDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsEmbedded(Boolean isEmbedded) { + this.isEmbedded = isEmbedded; + } + public TemplateResponse isCreator(Boolean isCreator) { + this.isCreator = isCreator; + return this; + } - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Object metadata) { - this.metadata = metadata; - } - - - public TemplateResponse signerRoles(List signerRoles) { - this.signerRoles = signerRoles; - return this; - } - - public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRolesItem) { - if (this.signerRoles == null) { - this.signerRoles = new ArrayList<>(); - } - this.signerRoles.add(signerRolesItem); - 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 @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsCreator() { + return isCreator; + } - /** - * An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. - * @return signerRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSignerRoles() { - return signerRoles; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignerRoles(List signerRoles) { - this.signerRoles = signerRoles; - } - - - public TemplateResponse ccRoles(List ccRoles) { - this.ccRoles = ccRoles; - return this; - } - - public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { - if (this.ccRoles == null) { - this.ccRoles = new ArrayList<>(); - } - this.ccRoles.add(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 - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcRoles() { - return ccRoles; - } - - - @JsonProperty(JSON_PROPERTY_CC_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcRoles(List ccRoles) { - this.ccRoles = ccRoles; - } - - - public TemplateResponse documents(List documents) { - this.documents = documents; - return this; - } - - public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) { - if (this.documents == null) { - this.documents = new ArrayList<>(); - } - this.documents.add(documentsItem); - return this; - } - - /** - * An array describing each document associated with this Template. Includes form field data for each document. - * @return documents - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getDocuments() { - return documents; - } - - - @JsonProperty(JSON_PROPERTY_DOCUMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocuments(List documents) { - this.documents = documents; - } - - - @Deprecated - public TemplateResponse customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public TemplateResponse addCustomFieldsItem(TemplateResponseDocumentCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - @Deprecated - public TemplateResponse namedFormFields(List namedFormFields) { - this.namedFormFields = namedFormFields; - return this; - } - - public TemplateResponse addNamedFormFieldsItem(TemplateResponseDocumentFormFieldBase namedFormFieldsItem) { - if (this.namedFormFields == null) { - this.namedFormFields = new ArrayList<>(); - } - this.namedFormFields.add(namedFormFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNamedFormFields() { - return namedFormFields; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamedFormFields(List namedFormFields) { - this.namedFormFields = namedFormFields; - } - - - public TemplateResponse accounts(List accounts) { - this.accounts = accounts; - return this; - } - - public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { - if (this.accounts == null) { - this.accounts = new ArrayList<>(); - } - this.accounts.add(accountsItem); - return this; - } - - /** - * An array of the Accounts that can use this Template. - * @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 TemplateResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponse templateResponse = (TemplateResponse) o; - return Objects.equals(this.templateId, templateResponse.templateId) && - Objects.equals(this.title, templateResponse.title) && - Objects.equals(this.message, templateResponse.message) && - Objects.equals(this.updatedAt, templateResponse.updatedAt) && - Objects.equals(this.isEmbedded, templateResponse.isEmbedded) && - Objects.equals(this.isCreator, templateResponse.isCreator) && - Objects.equals(this.canEdit, templateResponse.canEdit) && - Objects.equals(this.isLocked, templateResponse.isLocked) && - Objects.equals(this.metadata, templateResponse.metadata) && - Objects.equals(this.signerRoles, templateResponse.signerRoles) && - Objects.equals(this.ccRoles, templateResponse.ccRoles) && - Objects.equals(this.documents, templateResponse.documents) && - Objects.equals(this.customFields, templateResponse.customFields) && - Objects.equals(this.namedFormFields, templateResponse.namedFormFields) && - Objects.equals(this.accounts, templateResponse.accounts); - } - - @Override - public int hashCode() { - return Objects.hash(templateId, title, message, updatedAt, isEmbedded, isCreator, canEdit, isLocked, metadata, signerRoles, ccRoles, documents, customFields, namedFormFields, accounts); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponse {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" isEmbedded: ").append(toIndentedString(isEmbedded)).append("\n"); - sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); - sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); - sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); - sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" namedFormFields: ").append(toIndentedString(namedFormFields)).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 (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } + @JsonProperty(JSON_PROPERTY_IS_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsCreator(Boolean isCreator) { + this.isCreator = isCreator; + } - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); - } + public TemplateResponse canEdit(Boolean canEdit) { + this.canEdit = canEdit; + return this; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + /** + * Indicates whether edit rights have been granted to you by the owner (always `true` + * if that's you). + * + * @return canEdit + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCanEdit() { + return canEdit; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + @JsonProperty(JSON_PROPERTY_CAN_EDIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCanEdit(Boolean canEdit) { + this.canEdit = canEdit; } - 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)); - } + public TemplateResponse isLocked(Boolean isLocked) { + this.isLocked = isLocked; + return this; } - if (isEmbedded != null) { - if (isFileTypeOrListOfFiles(isEmbedded)) { - fileTypeFound = true; - } - if (isEmbedded.getClass().equals(java.io.File.class) || - isEmbedded.getClass().equals(Integer.class) || - isEmbedded.getClass().equals(String.class) || - isEmbedded.getClass().isEnum()) { - map.put("is_embedded", isEmbedded); - } else if (isListOfFile(isEmbedded)) { - for(int i = 0; i< getListSize(isEmbedded); i++) { - map.put("is_embedded[" + i + "]", getFromList(isEmbedded, i)); - } - } - else { - map.put("is_embedded", JSON.getDefault().getMapper().writeValueAsString(isEmbedded)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLocked() { + return isLocked; } - if (isCreator != null) { - if (isFileTypeOrListOfFiles(isCreator)) { - fileTypeFound = true; - } - if (isCreator.getClass().equals(java.io.File.class) || - isCreator.getClass().equals(Integer.class) || - isCreator.getClass().equals(String.class) || - isCreator.getClass().isEnum()) { - map.put("is_creator", isCreator); - } else if (isListOfFile(isCreator)) { - for(int i = 0; i< getListSize(isCreator); i++) { - map.put("is_creator[" + i + "]", getFromList(isCreator, i)); - } - } - else { - map.put("is_creator", JSON.getDefault().getMapper().writeValueAsString(isCreator)); - } + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(Boolean isLocked) { + this.isLocked = isLocked; } - if (canEdit != null) { - if (isFileTypeOrListOfFiles(canEdit)) { - fileTypeFound = true; - } - if (canEdit.getClass().equals(java.io.File.class) || - canEdit.getClass().equals(Integer.class) || - canEdit.getClass().equals(String.class) || - canEdit.getClass().isEnum()) { - map.put("can_edit", canEdit); - } else if (isListOfFile(canEdit)) { - for(int i = 0; i< getListSize(canEdit); i++) { - map.put("can_edit[" + i + "]", getFromList(canEdit, i)); - } - } - else { - map.put("can_edit", JSON.getDefault().getMapper().writeValueAsString(canEdit)); - } + public TemplateResponse metadata(Object metadata) { + this.metadata = metadata; + return this; } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - if (isLocked.getClass().equals(java.io.File.class) || - isLocked.getClass().equals(Integer.class) || - isLocked.getClass().equals(String.class) || - isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for(int i = 0; i< getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } - else { - map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } + /** + * The metadata attached to the template. + * + * @return metadata + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMetadata() { + return metadata; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Object metadata) { + this.metadata = metadata; } - if (signerRoles != null) { - if (isFileTypeOrListOfFiles(signerRoles)) { - fileTypeFound = true; - } - if (signerRoles.getClass().equals(java.io.File.class) || - signerRoles.getClass().equals(Integer.class) || - signerRoles.getClass().equals(String.class) || - signerRoles.getClass().isEnum()) { - map.put("signer_roles", signerRoles); - } else if (isListOfFile(signerRoles)) { - for(int i = 0; i< getListSize(signerRoles); i++) { - map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); - } - } - else { - map.put("signer_roles", JSON.getDefault().getMapper().writeValueAsString(signerRoles)); - } + public TemplateResponse signerRoles(List signerRoles) { + this.signerRoles = signerRoles; + return this; } - if (ccRoles != null) { - if (isFileTypeOrListOfFiles(ccRoles)) { - fileTypeFound = true; - } - if (ccRoles.getClass().equals(java.io.File.class) || - ccRoles.getClass().equals(Integer.class) || - ccRoles.getClass().equals(String.class) || - ccRoles.getClass().isEnum()) { - map.put("cc_roles", ccRoles); - } else if (isListOfFile(ccRoles)) { - for(int i = 0; i< getListSize(ccRoles); i++) { - map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); - } - } - else { - map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + public TemplateResponse addSignerRolesItem(TemplateResponseSignerRole signerRolesItem) { + if (this.signerRoles == null) { + this.signerRoles = new ArrayList<>(); } + this.signerRoles.add(signerRolesItem); + return this; } - if (documents != null) { - if (isFileTypeOrListOfFiles(documents)) { - fileTypeFound = true; - } - if (documents.getClass().equals(java.io.File.class) || - documents.getClass().equals(Integer.class) || - documents.getClass().equals(String.class) || - documents.getClass().isEnum()) { - map.put("documents", documents); - } else if (isListOfFile(documents)) { - for(int i = 0; i< getListSize(documents); i++) { - map.put("documents[" + i + "]", getFromList(documents, i)); - } - } - else { - map.put("documents", JSON.getDefault().getMapper().writeValueAsString(documents)); - } + /** + * An array of the designated signer roles that must be specified when sending a + * SignatureRequest using this Template. + * + * @return signerRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignerRoles() { + return signerRoles; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + @JsonProperty(JSON_PROPERTY_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignerRoles(List signerRoles) { + this.signerRoles = signerRoles; } - if (namedFormFields != null) { - if (isFileTypeOrListOfFiles(namedFormFields)) { - fileTypeFound = true; - } - if (namedFormFields.getClass().equals(java.io.File.class) || - namedFormFields.getClass().equals(Integer.class) || - namedFormFields.getClass().equals(String.class) || - namedFormFields.getClass().isEnum()) { - map.put("named_form_fields", namedFormFields); - } else if (isListOfFile(namedFormFields)) { - for(int i = 0; i< getListSize(namedFormFields); i++) { - map.put("named_form_fields[" + i + "]", getFromList(namedFormFields, i)); - } + public TemplateResponse ccRoles(List ccRoles) { + this.ccRoles = ccRoles; + return this; + } + + public TemplateResponse addCcRolesItem(TemplateResponseCCRole ccRolesItem) { + if (this.ccRoles == null) { + this.ccRoles = new ArrayList<>(); } - else { - map.put("named_form_fields", JSON.getDefault().getMapper().writeValueAsString(namedFormFields)); + this.ccRoles.add(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 @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcRoles() { + return ccRoles; + } + + @JsonProperty(JSON_PROPERTY_CC_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcRoles(List ccRoles) { + this.ccRoles = ccRoles; + } + + public TemplateResponse documents(List documents) { + this.documents = documents; + return this; + } + + public TemplateResponse addDocumentsItem(TemplateResponseDocument documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); } + this.documents.add(documentsItem); + return this; + } + + /** + * An array describing each document associated with this Template. Includes form field data for + * each document. + * + * @return documents + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDocuments() { + return documents; } - if (accounts != null) { - if (isFileTypeOrListOfFiles(accounts)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_DOCUMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocuments(List documents) { + this.documents = documents; + } + + @Deprecated + public TemplateResponse customFields( + List customFields) { + this.customFields = customFields; + return this; + } + + public TemplateResponse addCustomFieldsItem( + TemplateResponseDocumentCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } - 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)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + @Deprecated + public TemplateResponse namedFormFields( + List namedFormFields) { + this.namedFormFields = namedFormFields; + return this; + } + + public TemplateResponse addNamedFormFieldsItem( + TemplateResponseDocumentFormFieldBase namedFormFieldsItem) { + if (this.namedFormFields == null) { + this.namedFormFields = new ArrayList<>(); } - else { - map.put("accounts", JSON.getDefault().getMapper().writeValueAsString(accounts)); + this.namedFormFields.add(namedFormFieldsItem); + 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 @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamedFormFields() { + return namedFormFields; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_NAMED_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamedFormFields(List namedFormFields) { + this.namedFormFields = namedFormFields; + } + + public TemplateResponse accounts(List accounts) { + this.accounts = accounts; + return this; + } + + public TemplateResponse addAccountsItem(TemplateResponseAccount accountsItem) { + if (this.accounts == null) { + this.accounts = new ArrayList<>(); } + this.accounts.add(accountsItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * An array of the Accounts that can use this Template. + * + * @return accounts + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAccounts() { + return accounts; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_ACCOUNTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccounts(List accounts) { + this.accounts = accounts; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + /** Return true if this TemplateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TemplateResponse templateResponse = (TemplateResponse) o; + return Objects.equals(this.templateId, templateResponse.templateId) + && Objects.equals(this.title, templateResponse.title) + && Objects.equals(this.message, templateResponse.message) + && Objects.equals(this.updatedAt, templateResponse.updatedAt) + && Objects.equals(this.isEmbedded, templateResponse.isEmbedded) + && Objects.equals(this.isCreator, templateResponse.isCreator) + && Objects.equals(this.canEdit, templateResponse.canEdit) + && Objects.equals(this.isLocked, templateResponse.isLocked) + && Objects.equals(this.metadata, templateResponse.metadata) + && Objects.equals(this.signerRoles, templateResponse.signerRoles) + && Objects.equals(this.ccRoles, templateResponse.ccRoles) + && Objects.equals(this.documents, templateResponse.documents) + && Objects.equals(this.customFields, templateResponse.customFields) + && Objects.equals(this.namedFormFields, templateResponse.namedFormFields) + && Objects.equals(this.accounts, templateResponse.accounts); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + @Override + public int hashCode() { + return Objects.hash( + templateId, + title, + message, + updatedAt, + isEmbedded, + isCreator, + canEdit, + isLocked, + metadata, + signerRoles, + ccRoles, + documents, + customFields, + namedFormFields, + accounts); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponse {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" isEmbedded: ").append(toIndentedString(isEmbedded)).append("\n"); + sb.append(" isCreator: ").append(toIndentedString(isCreator)).append("\n"); + sb.append(" canEdit: ").append(toIndentedString(canEdit)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" signerRoles: ").append(toIndentedString(signerRoles)).append("\n"); + sb.append(" ccRoles: ").append(toIndentedString(ccRoles)).append("\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" namedFormFields: ").append(toIndentedString(namedFormFields)).append("\n"); + sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) + || templateId.getClass().equals(Integer.class) + || templateId.getClass().equals(String.class) + || templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for (int i = 0; i < getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } else { + map.put( + "template_id", + JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (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 (isEmbedded != null) { + if (isFileTypeOrListOfFiles(isEmbedded)) { + fileTypeFound = true; + } + + if (isEmbedded.getClass().equals(java.io.File.class) + || isEmbedded.getClass().equals(Integer.class) + || isEmbedded.getClass().equals(String.class) + || isEmbedded.getClass().isEnum()) { + map.put("is_embedded", isEmbedded); + } else if (isListOfFile(isEmbedded)) { + for (int i = 0; i < getListSize(isEmbedded); i++) { + map.put("is_embedded[" + i + "]", getFromList(isEmbedded, i)); + } + } else { + map.put( + "is_embedded", + JSON.getDefault().getMapper().writeValueAsString(isEmbedded)); + } + } + if (isCreator != null) { + if (isFileTypeOrListOfFiles(isCreator)) { + fileTypeFound = true; + } + + if (isCreator.getClass().equals(java.io.File.class) + || isCreator.getClass().equals(Integer.class) + || isCreator.getClass().equals(String.class) + || isCreator.getClass().isEnum()) { + map.put("is_creator", isCreator); + } else if (isListOfFile(isCreator)) { + for (int i = 0; i < getListSize(isCreator); i++) { + map.put("is_creator[" + i + "]", getFromList(isCreator, i)); + } + } else { + map.put( + "is_creator", + JSON.getDefault().getMapper().writeValueAsString(isCreator)); + } + } + if (canEdit != null) { + if (isFileTypeOrListOfFiles(canEdit)) { + fileTypeFound = true; + } + + if (canEdit.getClass().equals(java.io.File.class) + || canEdit.getClass().equals(Integer.class) + || canEdit.getClass().equals(String.class) + || canEdit.getClass().isEnum()) { + map.put("can_edit", canEdit); + } else if (isListOfFile(canEdit)) { + for (int i = 0; i < getListSize(canEdit); i++) { + map.put("can_edit[" + i + "]", getFromList(canEdit, i)); + } + } else { + map.put("can_edit", JSON.getDefault().getMapper().writeValueAsString(canEdit)); + } + } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } + + if (isLocked.getClass().equals(java.io.File.class) + || isLocked.getClass().equals(Integer.class) + || isLocked.getClass().equals(String.class) + || isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for (int i = 0; i < getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } else { + map.put( + "is_locked", + JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (signerRoles != null) { + if (isFileTypeOrListOfFiles(signerRoles)) { + fileTypeFound = true; + } + + if (signerRoles.getClass().equals(java.io.File.class) + || signerRoles.getClass().equals(Integer.class) + || signerRoles.getClass().equals(String.class) + || signerRoles.getClass().isEnum()) { + map.put("signer_roles", signerRoles); + } else if (isListOfFile(signerRoles)) { + for (int i = 0; i < getListSize(signerRoles); i++) { + map.put("signer_roles[" + i + "]", getFromList(signerRoles, i)); + } + } else { + map.put( + "signer_roles", + JSON.getDefault().getMapper().writeValueAsString(signerRoles)); + } + } + if (ccRoles != null) { + if (isFileTypeOrListOfFiles(ccRoles)) { + fileTypeFound = true; + } + + if (ccRoles.getClass().equals(java.io.File.class) + || ccRoles.getClass().equals(Integer.class) + || ccRoles.getClass().equals(String.class) + || ccRoles.getClass().isEnum()) { + map.put("cc_roles", ccRoles); + } else if (isListOfFile(ccRoles)) { + for (int i = 0; i < getListSize(ccRoles); i++) { + map.put("cc_roles[" + i + "]", getFromList(ccRoles, i)); + } + } else { + map.put("cc_roles", JSON.getDefault().getMapper().writeValueAsString(ccRoles)); + } + } + if (documents != null) { + if (isFileTypeOrListOfFiles(documents)) { + fileTypeFound = true; + } + + if (documents.getClass().equals(java.io.File.class) + || documents.getClass().equals(Integer.class) + || documents.getClass().equals(String.class) + || documents.getClass().isEnum()) { + map.put("documents", documents); + } else if (isListOfFile(documents)) { + for (int i = 0; i < getListSize(documents); i++) { + map.put("documents[" + i + "]", getFromList(documents, i)); + } + } else { + map.put( + "documents", + JSON.getDefault().getMapper().writeValueAsString(documents)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (namedFormFields != null) { + if (isFileTypeOrListOfFiles(namedFormFields)) { + fileTypeFound = true; + } + + if (namedFormFields.getClass().equals(java.io.File.class) + || namedFormFields.getClass().equals(Integer.class) + || namedFormFields.getClass().equals(String.class) + || namedFormFields.getClass().isEnum()) { + map.put("named_form_fields", namedFormFields); + } else if (isListOfFile(namedFormFields)) { + for (int i = 0; i < getListSize(namedFormFields); i++) { + map.put("named_form_fields[" + i + "]", getFromList(namedFormFields, i)); + } + } else { + map.put( + "named_form_fields", + JSON.getDefault().getMapper().writeValueAsString(namedFormFields)); + } + } + 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); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - /** - * 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"; + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java b/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java index ec5f7a9..901e4be 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseAccount.java @@ -10,420 +10,399 @@ * 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.TemplateResponseAccountQuota; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateResponseAccount - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseAccount { - 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 static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; - private Boolean isLocked; - - public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; - private Boolean isPaidHs; - - public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; - private Boolean isPaidHf; - - public static final String JSON_PROPERTY_QUOTAS = "quotas"; - private TemplateResponseAccountQuota quotas; - - public TemplateResponseAccount() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseAccount init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseAccount.class); - } - - static public TemplateResponseAccount init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseAccount.class - ); - } - - public TemplateResponseAccount accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * The id of the Account. - * @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 TemplateResponseAccount emailAddress(String emailAddress) { - this.emailAddress = emailAddress; - return this; - } - - /** - * The email address associated with the Account. - * @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; - } - - - public TemplateResponseAccount isLocked(Boolean isLocked) { - this.isLocked = isLocked; - return this; - } - - /** - * Returns `true` if the user has been locked out of their account by a team admin. - * @return isLocked - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsLocked() { - return isLocked; - } - - - @JsonProperty(JSON_PROPERTY_IS_LOCKED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsLocked(Boolean isLocked) { - this.isLocked = isLocked; - } - - - public TemplateResponseAccount isPaidHs(Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - return this; - } - - /** - * Returns `true` if the user has a paid Dropbox Sign account. - * @return isPaidHs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsPaidHs() { - return isPaidHs; - } - - - @JsonProperty(JSON_PROPERTY_IS_PAID_HS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHs(Boolean isPaidHs) { - this.isPaidHs = isPaidHs; - } - - - public TemplateResponseAccount isPaidHf(Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - return this; - } - - /** - * Returns `true` if the user has a paid HelloFax account. - * @return isPaidHf - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsPaidHf() { - return isPaidHf; - } - - - @JsonProperty(JSON_PROPERTY_IS_PAID_HF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsPaidHf(Boolean isPaidHf) { - this.isPaidHf = isPaidHf; - } - - - public TemplateResponseAccount quotas(TemplateResponseAccountQuota quotas) { - this.quotas = quotas; - return this; - } - - /** - * Get quotas - * @return quotas - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponseAccountQuota getQuotas() { - return quotas; - } - - - @JsonProperty(JSON_PROPERTY_QUOTAS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuotas(TemplateResponseAccountQuota quotas) { - this.quotas = quotas; - } - - - /** - * Return true if this TemplateResponseAccount object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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 static final String JSON_PROPERTY_IS_LOCKED = "is_locked"; + private Boolean isLocked; + + public static final String JSON_PROPERTY_IS_PAID_HS = "is_paid_hs"; + private Boolean isPaidHs; + + public static final String JSON_PROPERTY_IS_PAID_HF = "is_paid_hf"; + private Boolean isPaidHf; + + public static final String JSON_PROPERTY_QUOTAS = "quotas"; + private TemplateResponseAccountQuota quotas; + + public TemplateResponseAccount() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseAccount init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseAccount.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateResponseAccount init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TemplateResponseAccount.class); } - TemplateResponseAccount templateResponseAccount = (TemplateResponseAccount) o; - return Objects.equals(this.accountId, templateResponseAccount.accountId) && - Objects.equals(this.emailAddress, templateResponseAccount.emailAddress) && - Objects.equals(this.isLocked, templateResponseAccount.isLocked) && - Objects.equals(this.isPaidHs, templateResponseAccount.isPaidHs) && - Objects.equals(this.isPaidHf, templateResponseAccount.isPaidHf) && - Objects.equals(this.quotas, templateResponseAccount.quotas); - } - - @Override - public int hashCode() { - return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseAccount {\n"); - sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); - sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); - sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); - sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); - sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); - sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - 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)); - } + public TemplateResponseAccount accountId(String accountId) { + this.accountId = accountId; + return this; } - 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)); - } + /** + * The id of the Account. + * + * @return accountId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; } - if (isLocked != null) { - if (isFileTypeOrListOfFiles(isLocked)) { - fileTypeFound = true; - } - if (isLocked.getClass().equals(java.io.File.class) || - isLocked.getClass().equals(Integer.class) || - isLocked.getClass().equals(String.class) || - isLocked.getClass().isEnum()) { - map.put("is_locked", isLocked); - } else if (isListOfFile(isLocked)) { - for(int i = 0; i< getListSize(isLocked); i++) { - map.put("is_locked[" + i + "]", getFromList(isLocked, i)); - } - } - else { - map.put("is_locked", JSON.getDefault().getMapper().writeValueAsString(isLocked)); - } + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountId(String accountId) { + this.accountId = accountId; } - if (isPaidHs != null) { - if (isFileTypeOrListOfFiles(isPaidHs)) { - fileTypeFound = true; - } - if (isPaidHs.getClass().equals(java.io.File.class) || - isPaidHs.getClass().equals(Integer.class) || - isPaidHs.getClass().equals(String.class) || - isPaidHs.getClass().isEnum()) { - map.put("is_paid_hs", isPaidHs); - } else if (isListOfFile(isPaidHs)) { - for(int i = 0; i< getListSize(isPaidHs); i++) { - map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); - } - } - else { - map.put("is_paid_hs", JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); - } + public TemplateResponseAccount emailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; } - if (isPaidHf != null) { - if (isFileTypeOrListOfFiles(isPaidHf)) { - fileTypeFound = true; - } - if (isPaidHf.getClass().equals(java.io.File.class) || - isPaidHf.getClass().equals(Integer.class) || - isPaidHf.getClass().equals(String.class) || - isPaidHf.getClass().isEnum()) { - map.put("is_paid_hf", isPaidHf); - } else if (isListOfFile(isPaidHf)) { - for(int i = 0; i< getListSize(isPaidHf); i++) { - map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); - } - } - else { - map.put("is_paid_hf", JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); - } + /** + * The email address associated with the Account. + * + * @return emailAddress + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmailAddress() { + return emailAddress; } - if (quotas != null) { - if (isFileTypeOrListOfFiles(quotas)) { - fileTypeFound = true; - } - if (quotas.getClass().equals(java.io.File.class) || - quotas.getClass().equals(Integer.class) || - quotas.getClass().equals(String.class) || - quotas.getClass().isEnum()) { - map.put("quotas", quotas); - } else if (isListOfFile(quotas)) { - for(int i = 0; i< getListSize(quotas); i++) { - map.put("quotas[" + i + "]", getFromList(quotas, i)); - } + @JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public TemplateResponseAccount isLocked(Boolean isLocked) { + this.isLocked = isLocked; + return this; + } + + /** + * Returns `true` if the user has been locked out of their account by a team admin. + * + * @return isLocked + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsLocked() { + return isLocked; + } + + @JsonProperty(JSON_PROPERTY_IS_LOCKED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsLocked(Boolean isLocked) { + this.isLocked = isLocked; + } + + public TemplateResponseAccount isPaidHs(Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + return this; + } + + /** + * Returns `true` if the user has a paid Dropbox Sign account. + * + * @return isPaidHs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaidHs() { + return isPaidHs; + } + + @JsonProperty(JSON_PROPERTY_IS_PAID_HS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHs(Boolean isPaidHs) { + this.isPaidHs = isPaidHs; + } + + public TemplateResponseAccount isPaidHf(Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + return this; + } + + /** + * Returns `true` if the user has a paid HelloFax account. + * + * @return isPaidHf + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPaidHf() { + return isPaidHf; + } + + @JsonProperty(JSON_PROPERTY_IS_PAID_HF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsPaidHf(Boolean isPaidHf) { + this.isPaidHf = isPaidHf; + } + + public TemplateResponseAccount quotas(TemplateResponseAccountQuota quotas) { + this.quotas = quotas; + return this; + } + + /** + * Get quotas + * + * @return quotas + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponseAccountQuota getQuotas() { + return quotas; + } + + @JsonProperty(JSON_PROPERTY_QUOTAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotas(TemplateResponseAccountQuota quotas) { + this.quotas = quotas; + } + + /** Return true if this TemplateResponseAccount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseAccount templateResponseAccount = (TemplateResponseAccount) o; + return Objects.equals(this.accountId, templateResponseAccount.accountId) + && Objects.equals(this.emailAddress, templateResponseAccount.emailAddress) + && Objects.equals(this.isLocked, templateResponseAccount.isLocked) + && Objects.equals(this.isPaidHs, templateResponseAccount.isPaidHs) + && Objects.equals(this.isPaidHf, templateResponseAccount.isPaidHf) + && Objects.equals(this.quotas, templateResponseAccount.quotas); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(accountId, emailAddress, isLocked, isPaidHs, isPaidHf, quotas); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseAccount {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" isLocked: ").append(toIndentedString(isLocked)).append("\n"); + sb.append(" isPaidHs: ").append(toIndentedString(isPaidHs)).append("\n"); + sb.append(" isPaidHf: ").append(toIndentedString(isPaidHf)).append("\n"); + sb.append(" quotas: ").append(toIndentedString(quotas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + 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)); + } + } + if (isLocked != null) { + if (isFileTypeOrListOfFiles(isLocked)) { + fileTypeFound = true; + } + + if (isLocked.getClass().equals(java.io.File.class) + || isLocked.getClass().equals(Integer.class) + || isLocked.getClass().equals(String.class) + || isLocked.getClass().isEnum()) { + map.put("is_locked", isLocked); + } else if (isListOfFile(isLocked)) { + for (int i = 0; i < getListSize(isLocked); i++) { + map.put("is_locked[" + i + "]", getFromList(isLocked, i)); + } + } else { + map.put( + "is_locked", + JSON.getDefault().getMapper().writeValueAsString(isLocked)); + } + } + if (isPaidHs != null) { + if (isFileTypeOrListOfFiles(isPaidHs)) { + fileTypeFound = true; + } + + if (isPaidHs.getClass().equals(java.io.File.class) + || isPaidHs.getClass().equals(Integer.class) + || isPaidHs.getClass().equals(String.class) + || isPaidHs.getClass().isEnum()) { + map.put("is_paid_hs", isPaidHs); + } else if (isListOfFile(isPaidHs)) { + for (int i = 0; i < getListSize(isPaidHs); i++) { + map.put("is_paid_hs[" + i + "]", getFromList(isPaidHs, i)); + } + } else { + map.put( + "is_paid_hs", + JSON.getDefault().getMapper().writeValueAsString(isPaidHs)); + } + } + if (isPaidHf != null) { + if (isFileTypeOrListOfFiles(isPaidHf)) { + fileTypeFound = true; + } + + if (isPaidHf.getClass().equals(java.io.File.class) + || isPaidHf.getClass().equals(Integer.class) + || isPaidHf.getClass().equals(String.class) + || isPaidHf.getClass().isEnum()) { + map.put("is_paid_hf", isPaidHf); + } else if (isListOfFile(isPaidHf)) { + for (int i = 0; i < getListSize(isPaidHf); i++) { + map.put("is_paid_hf[" + i + "]", getFromList(isPaidHf, i)); + } + } else { + map.put( + "is_paid_hf", + JSON.getDefault().getMapper().writeValueAsString(isPaidHf)); + } + } + if (quotas != null) { + if (isFileTypeOrListOfFiles(quotas)) { + fileTypeFound = true; + } + + if (quotas.getClass().equals(java.io.File.class) + || quotas.getClass().equals(Integer.class) + || quotas.getClass().equals(String.class) + || quotas.getClass().isEnum()) { + map.put("quotas", quotas); + } else if (isListOfFile(quotas)) { + for (int i = 0; i < getListSize(quotas); i++) { + map.put("quotas[" + i + "]", getFromList(quotas, i)); + } + } else { + map.put("quotas", JSON.getDefault().getMapper().writeValueAsString(quotas)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java b/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java index 95b805c..0ebdbe2 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseAccountQuota.java @@ -10,319 +10,326 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; /** - * 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. */ @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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseAccountQuota { - public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; - private Integer templatesLeft; - - public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = "api_signature_requests_left"; - private Integer apiSignatureRequestsLeft; - - public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; - private Integer documentsLeft; - - public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; - private Integer smsVerificationsLeft; - - public TemplateResponseAccountQuota() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseAccountQuota init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseAccountQuota.class); - } - - static public TemplateResponseAccountQuota init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseAccountQuota.class - ); - } - - public TemplateResponseAccountQuota templatesLeft(Integer templatesLeft) { - this.templatesLeft = templatesLeft; - return this; - } - - /** - * API templates remaining. - * @return templatesLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getTemplatesLeft() { - return templatesLeft; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplatesLeft(Integer templatesLeft) { - this.templatesLeft = templatesLeft; - } - - - public TemplateResponseAccountQuota apiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - return this; - } - - /** - * API signature requests remaining. - * @return apiSignatureRequestsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getApiSignatureRequestsLeft() { - return apiSignatureRequestsLeft; - } - - - @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { - this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; - } - - - public TemplateResponseAccountQuota documentsLeft(Integer documentsLeft) { - this.documentsLeft = documentsLeft; - return this; - } - - /** - * Signature requests remaining. - * @return documentsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getDocumentsLeft() { - return documentsLeft; - } - - - @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDocumentsLeft(Integer documentsLeft) { - this.documentsLeft = documentsLeft; - } - - - public TemplateResponseAccountQuota smsVerificationsLeft(Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - return this; - } - - /** - * SMS verifications remaining. - * @return smsVerificationsLeft - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getSmsVerificationsLeft() { - return smsVerificationsLeft; - } - - - @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmsVerificationsLeft(Integer smsVerificationsLeft) { - this.smsVerificationsLeft = smsVerificationsLeft; - } - - - /** - * Return true if this TemplateResponseAccountQuota object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TEMPLATES_LEFT = "templates_left"; + private Integer templatesLeft; + + public static final String JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT = + "api_signature_requests_left"; + private Integer apiSignatureRequestsLeft; + + public static final String JSON_PROPERTY_DOCUMENTS_LEFT = "documents_left"; + private Integer documentsLeft; + + public static final String JSON_PROPERTY_SMS_VERIFICATIONS_LEFT = "sms_verifications_left"; + private Integer smsVerificationsLeft; + + public TemplateResponseAccountQuota() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseAccountQuota init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseAccountQuota.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateResponseAccountQuota init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseAccountQuota.class); } - TemplateResponseAccountQuota templateResponseAccountQuota = (TemplateResponseAccountQuota) o; - return Objects.equals(this.templatesLeft, templateResponseAccountQuota.templatesLeft) && - Objects.equals(this.apiSignatureRequestsLeft, templateResponseAccountQuota.apiSignatureRequestsLeft) && - Objects.equals(this.documentsLeft, templateResponseAccountQuota.documentsLeft) && - Objects.equals(this.smsVerificationsLeft, templateResponseAccountQuota.smsVerificationsLeft); - } - - @Override - public int hashCode() { - return Objects.hash(templatesLeft, apiSignatureRequestsLeft, documentsLeft, smsVerificationsLeft); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseAccountQuota {\n"); - sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); - sb.append(" apiSignatureRequestsLeft: ").append(toIndentedString(apiSignatureRequestsLeft)).append("\n"); - sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); - sb.append(" smsVerificationsLeft: ").append(toIndentedString(smsVerificationsLeft)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (templatesLeft != null) { - if (isFileTypeOrListOfFiles(templatesLeft)) { - fileTypeFound = true; - } - if (templatesLeft.getClass().equals(java.io.File.class) || - templatesLeft.getClass().equals(Integer.class) || - templatesLeft.getClass().equals(String.class) || - templatesLeft.getClass().isEnum()) { - map.put("templates_left", templatesLeft); - } else if (isListOfFile(templatesLeft)) { - for(int i = 0; i< getListSize(templatesLeft); i++) { - map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); - } - } - else { - map.put("templates_left", JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); - } + public TemplateResponseAccountQuota templatesLeft(Integer templatesLeft) { + this.templatesLeft = templatesLeft; + return this; } - if (apiSignatureRequestsLeft != null) { - if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { - fileTypeFound = true; - } - if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) || - apiSignatureRequestsLeft.getClass().equals(Integer.class) || - apiSignatureRequestsLeft.getClass().equals(String.class) || - apiSignatureRequestsLeft.getClass().isEnum()) { - map.put("api_signature_requests_left", apiSignatureRequestsLeft); - } else if (isListOfFile(apiSignatureRequestsLeft)) { - for(int i = 0; i< getListSize(apiSignatureRequestsLeft); i++) { - map.put("api_signature_requests_left[" + i + "]", getFromList(apiSignatureRequestsLeft, i)); - } - } - else { - map.put("api_signature_requests_left", JSON.getDefault().getMapper().writeValueAsString(apiSignatureRequestsLeft)); - } + /** + * API templates remaining. + * + * @return templatesLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getTemplatesLeft() { + return templatesLeft; } - if (documentsLeft != null) { - if (isFileTypeOrListOfFiles(documentsLeft)) { - fileTypeFound = true; - } - if (documentsLeft.getClass().equals(java.io.File.class) || - documentsLeft.getClass().equals(Integer.class) || - documentsLeft.getClass().equals(String.class) || - documentsLeft.getClass().isEnum()) { - map.put("documents_left", documentsLeft); - } else if (isListOfFile(documentsLeft)) { - for(int i = 0; i< getListSize(documentsLeft); i++) { - map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); - } - } - else { - map.put("documents_left", JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); - } + @JsonProperty(JSON_PROPERTY_TEMPLATES_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplatesLeft(Integer templatesLeft) { + this.templatesLeft = templatesLeft; } - if (smsVerificationsLeft != null) { - if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { - fileTypeFound = true; - } - if (smsVerificationsLeft.getClass().equals(java.io.File.class) || - smsVerificationsLeft.getClass().equals(Integer.class) || - smsVerificationsLeft.getClass().equals(String.class) || - smsVerificationsLeft.getClass().isEnum()) { - map.put("sms_verifications_left", smsVerificationsLeft); - } else if (isListOfFile(smsVerificationsLeft)) { - for(int i = 0; i< getListSize(smsVerificationsLeft); i++) { - map.put("sms_verifications_left[" + i + "]", getFromList(smsVerificationsLeft, i)); - } + public TemplateResponseAccountQuota apiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + return this; + } + + /** + * API signature requests remaining. + * + * @return apiSignatureRequestsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getApiSignatureRequestsLeft() { + return apiSignatureRequestsLeft; + } + + @JsonProperty(JSON_PROPERTY_API_SIGNATURE_REQUESTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiSignatureRequestsLeft(Integer apiSignatureRequestsLeft) { + this.apiSignatureRequestsLeft = apiSignatureRequestsLeft; + } + + public TemplateResponseAccountQuota documentsLeft(Integer documentsLeft) { + this.documentsLeft = documentsLeft; + return this; + } + + /** + * Signature requests remaining. + * + * @return documentsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getDocumentsLeft() { + return documentsLeft; + } + + @JsonProperty(JSON_PROPERTY_DOCUMENTS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDocumentsLeft(Integer documentsLeft) { + this.documentsLeft = documentsLeft; + } + + public TemplateResponseAccountQuota smsVerificationsLeft(Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + return this; + } + + /** + * SMS verifications remaining. + * + * @return smsVerificationsLeft + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSmsVerificationsLeft() { + return smsVerificationsLeft; + } + + @JsonProperty(JSON_PROPERTY_SMS_VERIFICATIONS_LEFT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmsVerificationsLeft(Integer smsVerificationsLeft) { + this.smsVerificationsLeft = smsVerificationsLeft; + } + + /** Return true if this TemplateResponseAccountQuota object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("sms_verifications_left", JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseAccountQuota templateResponseAccountQuota = + (TemplateResponseAccountQuota) o; + return Objects.equals(this.templatesLeft, templateResponseAccountQuota.templatesLeft) + && Objects.equals( + this.apiSignatureRequestsLeft, + templateResponseAccountQuota.apiSignatureRequestsLeft) + && Objects.equals(this.documentsLeft, templateResponseAccountQuota.documentsLeft) + && Objects.equals( + this.smsVerificationsLeft, + templateResponseAccountQuota.smsVerificationsLeft); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + templatesLeft, apiSignatureRequestsLeft, documentsLeft, smsVerificationsLeft); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseAccountQuota {\n"); + sb.append(" templatesLeft: ").append(toIndentedString(templatesLeft)).append("\n"); + sb.append(" apiSignatureRequestsLeft: ") + .append(toIndentedString(apiSignatureRequestsLeft)) + .append("\n"); + sb.append(" documentsLeft: ").append(toIndentedString(documentsLeft)).append("\n"); + sb.append(" smsVerificationsLeft: ") + .append(toIndentedString(smsVerificationsLeft)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templatesLeft != null) { + if (isFileTypeOrListOfFiles(templatesLeft)) { + fileTypeFound = true; + } + + if (templatesLeft.getClass().equals(java.io.File.class) + || templatesLeft.getClass().equals(Integer.class) + || templatesLeft.getClass().equals(String.class) + || templatesLeft.getClass().isEnum()) { + map.put("templates_left", templatesLeft); + } else if (isListOfFile(templatesLeft)) { + for (int i = 0; i < getListSize(templatesLeft); i++) { + map.put("templates_left[" + i + "]", getFromList(templatesLeft, i)); + } + } else { + map.put( + "templates_left", + JSON.getDefault().getMapper().writeValueAsString(templatesLeft)); + } + } + if (apiSignatureRequestsLeft != null) { + if (isFileTypeOrListOfFiles(apiSignatureRequestsLeft)) { + fileTypeFound = true; + } + + if (apiSignatureRequestsLeft.getClass().equals(java.io.File.class) + || apiSignatureRequestsLeft.getClass().equals(Integer.class) + || apiSignatureRequestsLeft.getClass().equals(String.class) + || apiSignatureRequestsLeft.getClass().isEnum()) { + map.put("api_signature_requests_left", apiSignatureRequestsLeft); + } else if (isListOfFile(apiSignatureRequestsLeft)) { + for (int i = 0; i < getListSize(apiSignatureRequestsLeft); i++) { + map.put( + "api_signature_requests_left[" + i + "]", + getFromList(apiSignatureRequestsLeft, i)); + } + } else { + map.put( + "api_signature_requests_left", + JSON.getDefault() + .getMapper() + .writeValueAsString(apiSignatureRequestsLeft)); + } + } + if (documentsLeft != null) { + if (isFileTypeOrListOfFiles(documentsLeft)) { + fileTypeFound = true; + } + + if (documentsLeft.getClass().equals(java.io.File.class) + || documentsLeft.getClass().equals(Integer.class) + || documentsLeft.getClass().equals(String.class) + || documentsLeft.getClass().isEnum()) { + map.put("documents_left", documentsLeft); + } else if (isListOfFile(documentsLeft)) { + for (int i = 0; i < getListSize(documentsLeft); i++) { + map.put("documents_left[" + i + "]", getFromList(documentsLeft, i)); + } + } else { + map.put( + "documents_left", + JSON.getDefault().getMapper().writeValueAsString(documentsLeft)); + } + } + if (smsVerificationsLeft != null) { + if (isFileTypeOrListOfFiles(smsVerificationsLeft)) { + fileTypeFound = true; + } + + if (smsVerificationsLeft.getClass().equals(java.io.File.class) + || smsVerificationsLeft.getClass().equals(Integer.class) + || smsVerificationsLeft.getClass().equals(String.class) + || smsVerificationsLeft.getClass().isEnum()) { + map.put("sms_verifications_left", smsVerificationsLeft); + } else if (isListOfFile(smsVerificationsLeft)) { + for (int i = 0; i < getListSize(smsVerificationsLeft); i++) { + map.put( + "sms_verifications_left[" + i + "]", + getFromList(smsVerificationsLeft, i)); + } + } else { + map.put( + "sms_verifications_left", + JSON.getDefault().getMapper().writeValueAsString(smsVerificationsLeft)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } -} + 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/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java b/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java index 0c70b11..e4a7d73 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseCCRole.java @@ -10,169 +10,157 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateResponseCCRole - */ -@JsonPropertyOrder({ - TemplateResponseCCRole.JSON_PROPERTY_NAME -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** TemplateResponseCCRole */ +@JsonPropertyOrder({TemplateResponseCCRole.JSON_PROPERTY_NAME}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseCCRole { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public TemplateResponseCCRole() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseCCRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseCCRole.class); - } - - static public TemplateResponseCCRole init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseCCRole.class - ); - } - - public TemplateResponseCCRole name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Role. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this TemplateResponseCCRole object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TemplateResponseCCRole() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseCCRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseCCRole.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateResponseCCRole init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), TemplateResponseCCRole.class); } - TemplateResponseCCRole templateResponseCCRole = (TemplateResponseCCRole) o; - return Objects.equals(this.name, templateResponseCCRole.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseCCRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } + public TemplateResponseCCRole name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Role. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this TemplateResponseCCRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseCCRole templateResponseCCRole = (TemplateResponseCCRole) o; + return Objects.equals(this.name, templateResponseCCRole.name); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseCCRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java index 74b232d..de32fb5 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocument.java @@ -10,457 +10,442 @@ * 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.TemplateResponseDocumentCustomFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentFieldGroup; -import com.dropbox.sign.model.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateResponseDocument - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseDocument { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_INDEX = "index"; - private Integer index; - - public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; - private List fieldGroups = null; - - public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; - private List formFields = null; - - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; - - public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; - private List staticFields = null; - - public TemplateResponseDocument() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocument init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocument.class); - } - - static public TemplateResponseDocument init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocument.class - ); - } - - public TemplateResponseDocument name(String name) { - this.name = name; - return this; - } - - /** - * Name of the associated file. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TemplateResponseDocument index(Integer index) { - this.index = index; - return this; - } - - /** - * Document ordering, the lowest index is displayed first and the highest last (0-based indexing). - * @return index - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INDEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getIndex() { - return index; - } - - - @JsonProperty(JSON_PROPERTY_INDEX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndex(Integer index) { - this.index = index; - } - - - public TemplateResponseDocument fieldGroups(List fieldGroups) { - this.fieldGroups = fieldGroups; - return this; - } - - public TemplateResponseDocument addFieldGroupsItem(TemplateResponseDocumentFieldGroup fieldGroupsItem) { - if (this.fieldGroups == null) { - this.fieldGroups = new ArrayList<>(); - } - this.fieldGroups.add(fieldGroupsItem); - return this; - } - - /** - * An array of Form Field Group objects. - * @return fieldGroups - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFieldGroups() { - return fieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldGroups(List fieldGroups) { - this.fieldGroups = fieldGroups; - } - - - public TemplateResponseDocument formFields(List formFields) { - this.formFields = formFields; - return this; - } - - public TemplateResponseDocument addFormFieldsItem(TemplateResponseDocumentFormFieldBase formFieldsItem) { - if (this.formFields == null) { - this.formFields = new ArrayList<>(); - } - this.formFields.add(formFieldsItem); - return this; - } - - /** - * An array of Form Field objects containing the name and type of each named field. - * @return formFields - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFields() { - return formFields; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFields(List formFields) { - this.formFields = formFields; - } - - - public TemplateResponseDocument customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public TemplateResponseDocument addCustomFieldsItem(TemplateResponseDocumentCustomFieldBase customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - return this; - } - - /** - * An array of Form Field objects containing the name and type of each named field. - * @return customFields - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public TemplateResponseDocument staticFields(List staticFields) { - this.staticFields = staticFields; - return this; - } - - public TemplateResponseDocument addStaticFieldsItem(TemplateResponseDocumentStaticFieldBase staticFieldsItem) { - if (this.staticFields == null) { - this.staticFields = new ArrayList<>(); - } - this.staticFields.add(staticFieldsItem); - return this; - } - - /** - * An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. - * @return staticFields - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getStaticFields() { - return staticFields; - } - - - @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStaticFields(List staticFields) { - this.staticFields = staticFields; - } - - - /** - * Return true if this TemplateResponseDocument object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocument templateResponseDocument = (TemplateResponseDocument) o; - return Objects.equals(this.name, templateResponseDocument.name) && - Objects.equals(this.index, templateResponseDocument.index) && - Objects.equals(this.fieldGroups, templateResponseDocument.fieldGroups) && - Objects.equals(this.formFields, templateResponseDocument.formFields) && - Objects.equals(this.customFields, templateResponseDocument.customFields) && - Objects.equals(this.staticFields, templateResponseDocument.staticFields); - } - - @Override - public int hashCode() { - return Objects.hash(name, index, fieldGroups, formFields, customFields, staticFields); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocument {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" index: ").append(toIndentedString(index)).append("\n"); - sb.append(" fieldGroups: ").append(toIndentedString(fieldGroups)).append("\n"); - sb.append(" formFields: ").append(toIndentedString(formFields)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" staticFields: ").append(toIndentedString(staticFields)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static final String JSON_PROPERTY_INDEX = "index"; + private Integer index; + + public static final String JSON_PROPERTY_FIELD_GROUPS = "field_groups"; + private List fieldGroups = null; + + public static final String JSON_PROPERTY_FORM_FIELDS = "form_fields"; + private List formFields = null; + + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; + + public static final String JSON_PROPERTY_STATIC_FIELDS = "static_fields"; + private List staticFields = null; + + public TemplateResponseDocument() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocument init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocument.class); } - if (index != null) { - if (isFileTypeOrListOfFiles(index)) { - fileTypeFound = true; - } - if (index.getClass().equals(java.io.File.class) || - index.getClass().equals(Integer.class) || - index.getClass().equals(String.class) || - index.getClass().isEnum()) { - map.put("index", index); - } else if (isListOfFile(index)) { - for(int i = 0; i< getListSize(index); i++) { - map.put("index[" + i + "]", getFromList(index, i)); - } - } - else { - map.put("index", JSON.getDefault().getMapper().writeValueAsString(index)); - } + public static TemplateResponseDocument init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocument.class); } - if (fieldGroups != null) { - if (isFileTypeOrListOfFiles(fieldGroups)) { - fileTypeFound = true; - } - if (fieldGroups.getClass().equals(java.io.File.class) || - fieldGroups.getClass().equals(Integer.class) || - fieldGroups.getClass().equals(String.class) || - fieldGroups.getClass().isEnum()) { - map.put("field_groups", fieldGroups); - } else if (isListOfFile(fieldGroups)) { - for(int i = 0; i< getListSize(fieldGroups); i++) { - map.put("field_groups[" + i + "]", getFromList(fieldGroups, i)); - } - } - else { - map.put("field_groups", JSON.getDefault().getMapper().writeValueAsString(fieldGroups)); - } + public TemplateResponseDocument name(String name) { + this.name = name; + return this; } - if (formFields != null) { - if (isFileTypeOrListOfFiles(formFields)) { - fileTypeFound = true; - } - if (formFields.getClass().equals(java.io.File.class) || - formFields.getClass().equals(Integer.class) || - formFields.getClass().equals(String.class) || - formFields.getClass().isEnum()) { - map.put("form_fields", formFields); - } else if (isListOfFile(formFields)) { - for(int i = 0; i< getListSize(formFields); i++) { - map.put("form_fields[" + i + "]", getFromList(formFields, i)); - } - } - else { - map.put("form_fields", JSON.getDefault().getMapper().writeValueAsString(formFields)); - } + /** + * Name of the associated file. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public TemplateResponseDocument index(Integer index) { + this.index = index; + return this; + } + + /** + * Document ordering, the lowest index is displayed first and the highest last (0-based + * indexing). + * + * @return index + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIndex() { + return index; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; + + @JsonProperty(JSON_PROPERTY_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndex(Integer index) { + this.index = index; + } + + public TemplateResponseDocument fieldGroups( + List fieldGroups) { + this.fieldGroups = fieldGroups; + return this; + } + + public TemplateResponseDocument addFieldGroupsItem( + TemplateResponseDocumentFieldGroup fieldGroupsItem) { + if (this.fieldGroups == null) { + this.fieldGroups = new ArrayList<>(); } + this.fieldGroups.add(fieldGroupsItem); + return this; + } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } + /** + * An array of Form Field Group objects. + * + * @return fieldGroups + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFieldGroups() { + return fieldGroups; + } + + @JsonProperty(JSON_PROPERTY_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldGroups(List fieldGroups) { + this.fieldGroups = fieldGroups; + } + + public TemplateResponseDocument formFields( + List formFields) { + this.formFields = formFields; + return this; + } + + public TemplateResponseDocument addFormFieldsItem( + TemplateResponseDocumentFormFieldBase formFieldsItem) { + if (this.formFields == null) { + this.formFields = new ArrayList<>(); } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); + this.formFields.add(formFieldsItem); + return this; + } + + /** + * An array of Form Field objects containing the name and type of each named field. + * + * @return formFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFields() { + return formFields; + } + + @JsonProperty(JSON_PROPERTY_FORM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFields(List formFields) { + this.formFields = formFields; + } + + public TemplateResponseDocument customFields( + List customFields) { + this.customFields = customFields; + return this; + } + + public TemplateResponseDocument addCustomFieldsItem( + TemplateResponseDocumentCustomFieldBase customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; + } + + /** + * An array of Form Field objects containing the name and type of each named field. + * + * @return customFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (staticFields != null) { - if (isFileTypeOrListOfFiles(staticFields)) { - fileTypeFound = true; + + public TemplateResponseDocument staticFields( + List staticFields) { + this.staticFields = staticFields; + return this; + } + + public TemplateResponseDocument addStaticFieldsItem( + TemplateResponseDocumentStaticFieldBase staticFieldsItem) { + if (this.staticFields == null) { + this.staticFields = new ArrayList<>(); } + this.staticFields.add(staticFieldsItem); + return this; + } - if (staticFields.getClass().equals(java.io.File.class) || - staticFields.getClass().equals(Integer.class) || - staticFields.getClass().equals(String.class) || - staticFields.getClass().isEnum()) { - map.put("static_fields", staticFields); - } else if (isListOfFile(staticFields)) { - for(int i = 0; i< getListSize(staticFields); i++) { - map.put("static_fields[" + i + "]", getFromList(staticFields, i)); - } + /** + * An array describing static overlay fields. **NOTE:** Only available for certain + * subscriptions. + * + * @return staticFields + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStaticFields() { + return staticFields; + } + + @JsonProperty(JSON_PROPERTY_STATIC_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStaticFields(List staticFields) { + this.staticFields = staticFields; + } + + /** Return true if this TemplateResponseDocument object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("static_fields", JSON.getDefault().getMapper().writeValueAsString(staticFields)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocument templateResponseDocument = (TemplateResponseDocument) o; + return Objects.equals(this.name, templateResponseDocument.name) + && Objects.equals(this.index, templateResponseDocument.index) + && Objects.equals(this.fieldGroups, templateResponseDocument.fieldGroups) + && Objects.equals(this.formFields, templateResponseDocument.formFields) + && Objects.equals(this.customFields, templateResponseDocument.customFields) + && Objects.equals(this.staticFields, templateResponseDocument.staticFields); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, index, fieldGroups, formFields, customFields, staticFields); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocument {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" fieldGroups: ").append(toIndentedString(fieldGroups)).append("\n"); + sb.append(" formFields: ").append(toIndentedString(formFields)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" staticFields: ").append(toIndentedString(staticFields)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (index != null) { + if (isFileTypeOrListOfFiles(index)) { + fileTypeFound = true; + } + + if (index.getClass().equals(java.io.File.class) + || index.getClass().equals(Integer.class) + || index.getClass().equals(String.class) + || index.getClass().isEnum()) { + map.put("index", index); + } else if (isListOfFile(index)) { + for (int i = 0; i < getListSize(index); i++) { + map.put("index[" + i + "]", getFromList(index, i)); + } + } else { + map.put("index", JSON.getDefault().getMapper().writeValueAsString(index)); + } + } + if (fieldGroups != null) { + if (isFileTypeOrListOfFiles(fieldGroups)) { + fileTypeFound = true; + } + + if (fieldGroups.getClass().equals(java.io.File.class) + || fieldGroups.getClass().equals(Integer.class) + || fieldGroups.getClass().equals(String.class) + || fieldGroups.getClass().isEnum()) { + map.put("field_groups", fieldGroups); + } else if (isListOfFile(fieldGroups)) { + for (int i = 0; i < getListSize(fieldGroups); i++) { + map.put("field_groups[" + i + "]", getFromList(fieldGroups, i)); + } + } else { + map.put( + "field_groups", + JSON.getDefault().getMapper().writeValueAsString(fieldGroups)); + } + } + if (formFields != null) { + if (isFileTypeOrListOfFiles(formFields)) { + fileTypeFound = true; + } + + if (formFields.getClass().equals(java.io.File.class) + || formFields.getClass().equals(Integer.class) + || formFields.getClass().equals(String.class) + || formFields.getClass().isEnum()) { + map.put("form_fields", formFields); + } else if (isListOfFile(formFields)) { + for (int i = 0; i < getListSize(formFields); i++) { + map.put("form_fields[" + i + "]", getFromList(formFields, i)); + } + } else { + map.put( + "form_fields", + JSON.getDefault().getMapper().writeValueAsString(formFields)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (staticFields != null) { + if (isFileTypeOrListOfFiles(staticFields)) { + fileTypeFound = true; + } + + if (staticFields.getClass().equals(java.io.File.class) + || staticFields.getClass().equals(Integer.class) + || staticFields.getClass().equals(String.class) + || staticFields.getClass().isEnum()) { + map.put("static_fields", staticFields); + } else if (isListOfFile(staticFields)) { + for (int i = 0; i < getListSize(staticFields); i++) { + map.put("static_fields[" + i + "]", getFromList(staticFields, i)); + } + } else { + map.put( + "static_fields", + JSON.getDefault().getMapper().writeValueAsString(staticFields)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java index b9300c5..d6c0d01 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldBase.java @@ -10,647 +10,614 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * 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. */ @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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @JsonSubTypes.Type( + value = TemplateResponseDocumentCustomFieldCheckbox.class, + name = "checkbox"), + @JsonSubTypes.Type(value = TemplateResponseDocumentCustomFieldText.class, name = "text"), }) - public class TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - private String signer; - - public static final String JSON_PROPERTY_X = "x"; - private Integer x; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_Y = "y"; - private Integer y; + public static final String JSON_PROPERTY_SIGNER = "signer"; + private String signer; - public static final String JSON_PROPERTY_WIDTH = "width"; - private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - private Integer height; + public static final String JSON_PROPERTY_X = "x"; + private Integer x; - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; + public static final String JSON_PROPERTY_Y = "y"; + private Integer y; - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; - - public TemplateResponseDocumentCustomFieldBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentCustomFieldBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldBase.class); - } - - static public TemplateResponseDocumentCustomFieldBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldBase.class - ); - } - - public TemplateResponseDocumentCustomFieldBase type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public TemplateResponseDocumentCustomFieldBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * The unique ID for this field. - * @return apiId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getApiId() { - return apiId; - } - - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - - - public TemplateResponseDocumentCustomFieldBase name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Custom Field. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - 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 - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigner() { - return signer; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getX() { - return x; - } - - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(Integer x) { - this.x = x; - } - - - public TemplateResponseDocumentCustomFieldBase y(Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this form field. - * @return y - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getY() { - return y; - } - - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(Integer y) { - this.y = y; - } - - - public TemplateResponseDocumentCustomFieldBase width(Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this form field. - * @return width - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getWidth() { - return width; - } - - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(Integer width) { - this.width = width; - } - - - public TemplateResponseDocumentCustomFieldBase height(Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this form field. - * @return height - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getHeight() { - return height; - } - - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(Integer height) { - this.height = height; - } - - - public TemplateResponseDocumentCustomFieldBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * Boolean showing whether or not this field is required. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public TemplateResponseDocumentCustomFieldBase group(String group) { - this.group = 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 - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(String group) { - this.group = group; - } - - - /** - * Return true if this TemplateResponseDocumentCustomFieldBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentCustomFieldBase templateResponseDocumentCustomFieldBase = (TemplateResponseDocumentCustomFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldBase.type) && - Objects.equals(this.apiId, templateResponseDocumentCustomFieldBase.apiId) && - Objects.equals(this.name, templateResponseDocumentCustomFieldBase.name) && - Objects.equals(this.signer, templateResponseDocumentCustomFieldBase.signer) && - Objects.equals(this.x, templateResponseDocumentCustomFieldBase.x) && - Objects.equals(this.y, templateResponseDocumentCustomFieldBase.y) && - Objects.equals(this.width, templateResponseDocumentCustomFieldBase.width) && - Objects.equals(this.height, templateResponseDocumentCustomFieldBase.height) && - Objects.equals(this.required, templateResponseDocumentCustomFieldBase.required) && - Objects.equals(this.group, templateResponseDocumentCustomFieldBase.group); - } - - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_WIDTH = "width"; + private Integer width; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public TemplateResponseDocumentCustomFieldBase() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentCustomFieldBase init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentCustomFieldBase.class); } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + public static TemplateResponseDocumentCustomFieldBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldBase.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public TemplateResponseDocumentCustomFieldBase type(String type) { + this.type = type; + return this; } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - if (signer.getClass().equals(java.io.File.class) || - signer.getClass().equals(Integer.class) || - signer.getClass().equals(String.class) || - signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for(int i = 0; i< getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } - else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - if (x.getClass().equals(java.io.File.class) || - x.getClass().equals(Integer.class) || - x.getClass().equals(String.class) || - x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for(int i = 0; i< getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } - else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - if (y.getClass().equals(java.io.File.class) || - y.getClass().equals(Integer.class) || - y.getClass().equals(String.class) || - y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for(int i = 0; i< getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } - else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + public TemplateResponseDocumentCustomFieldBase apiId(String apiId) { + this.apiId = apiId; + return this; } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - if (width.getClass().equals(java.io.File.class) || - width.getClass().equals(Integer.class) || - width.getClass().equals(String.class) || - width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for(int i = 0; i< getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } - else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } + /** + * The unique ID for this field. + * + * @return apiId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiId() { + return apiId; } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - if (height.getClass().equals(java.io.File.class) || - height.getClass().equals(Integer.class) || - height.getClass().equals(String.class) || - height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for(int i = 0; i< getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } - else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(String apiId) { + this.apiId = apiId; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } - } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); - } + public TemplateResponseDocumentCustomFieldBase name(String name) { + this.name = name; + return this; } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); - } + /** + * The name of the Custom Field. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + 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 @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigner() { + return signer; + } + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getX() { + return x; + } + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(Integer x) { + this.x = x; + } + + public TemplateResponseDocumentCustomFieldBase y(Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this form field. + * + * @return y + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getY() { + return y; + } + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(Integer y) { + this.y = y; + } + + public TemplateResponseDocumentCustomFieldBase width(Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this form field. + * + * @return width + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(Integer width) { + this.width = width; + } + + public TemplateResponseDocumentCustomFieldBase height(Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this form field. + * + * @return height + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(Integer height) { + this.height = height; + } + + public TemplateResponseDocumentCustomFieldBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public TemplateResponseDocumentCustomFieldBase group(String group) { + this.group = 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 @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroup() { + return group; + } + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(String group) { + this.group = group; + } + + /** Return true if this TemplateResponseDocumentCustomFieldBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentCustomFieldBase templateResponseDocumentCustomFieldBase = + (TemplateResponseDocumentCustomFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldBase.type) + && Objects.equals(this.apiId, templateResponseDocumentCustomFieldBase.apiId) + && Objects.equals(this.name, templateResponseDocumentCustomFieldBase.name) + && Objects.equals(this.signer, templateResponseDocumentCustomFieldBase.signer) + && Objects.equals(this.x, templateResponseDocumentCustomFieldBase.x) + && Objects.equals(this.y, templateResponseDocumentCustomFieldBase.y) + && Objects.equals(this.width, templateResponseDocumentCustomFieldBase.width) + && Objects.equals(this.height, templateResponseDocumentCustomFieldBase.height) + && Objects.equals(this.required, templateResponseDocumentCustomFieldBase.required) + && Objects.equals(this.group, templateResponseDocumentCustomFieldBase.group); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } + + if (signer.getClass().equals(java.io.File.class) + || signer.getClass().equals(Integer.class) + || signer.getClass().equals(String.class) + || signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for (int i = 0; i < getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } + } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } + + if (x.getClass().equals(java.io.File.class) + || x.getClass().equals(Integer.class) + || x.getClass().equals(String.class) + || x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for (int i = 0; i < getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } + } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } + + if (y.getClass().equals(java.io.File.class) + || y.getClass().equals(Integer.class) + || y.getClass().equals(String.class) + || y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for (int i = 0; i < getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } + } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } + + if (width.getClass().equals(java.io.File.class) + || width.getClass().equals(Integer.class) + || width.getClass().equals(String.class) + || width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for (int i = 0; i < getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } + } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } + + if (height.getClass().equals(java.io.File.class) + || height.getClass().equals(Integer.class) + || height.getClass().equals(String.class) + || height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for (int i = 0; i < getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + } 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 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 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 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); - } + 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"; + /** + * 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 "); } - 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("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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java index e61e8fb..b11eca5 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldCheckbox.java @@ -10,187 +10,186 @@ * 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.TemplateResponseDocumentCustomFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentCustomFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentCustomFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentCustomFieldCheckbox.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentCustomFieldCheckbox extends TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public TemplateResponseDocumentCustomFieldCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentCustomFieldCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldCheckbox.class); - } - - static public TemplateResponseDocumentCustomFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldCheckbox.class - ); - } - - public TemplateResponseDocumentCustomFieldCheckbox type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentCustomFieldCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentCustomFieldCheckbox templateResponseDocumentCustomFieldCheckbox = (TemplateResponseDocumentCustomFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldCheckbox.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public TemplateResponseDocumentCustomFieldCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentCustomFieldCheckbox init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentCustomFieldCheckbox.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentCustomFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldCheckbox.class); + } + + public TemplateResponseDocumentCustomFieldCheckbox type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentCustomFieldCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentCustomFieldCheckbox templateResponseDocumentCustomFieldCheckbox = + (TemplateResponseDocumentCustomFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldCheckbox.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentCustomFieldCheckbox", TemplateResponseDocumentCustomFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldCheckbox.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java index 74091e3..e915dc0 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentCustomFieldText.java @@ -10,388 +10,385 @@ * 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.TemplateResponseDocumentCustomFieldBase; -import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentCustomFieldBase` - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - -public class TemplateResponseDocumentCustomFieldText extends TemplateResponseDocumentCustomFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - private String fontFamily; - - public TemplateResponseDocumentCustomFieldText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentCustomFieldText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentCustomFieldText.class); - } - - static public TemplateResponseDocumentCustomFieldText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentCustomFieldText.class - ); - } - - public TemplateResponseDocumentCustomFieldText type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public TemplateResponseDocumentCustomFieldText avgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * @return avgTextLength - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - - public TemplateResponseDocumentCustomFieldText isMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * @return isMultiline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsMultiline() { - return isMultiline; - } - - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - - public TemplateResponseDocumentCustomFieldText originalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * @return originalFontSize - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOriginalFontSize() { - return originalFontSize; - } - - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - } - - - public TemplateResponseDocumentCustomFieldText fontFamily(String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(String fontFamily) { - this.fontFamily = fontFamily; - } - - - /** - * Return true if this TemplateResponseDocumentCustomFieldText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; + + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + private TemplateResponseFieldAvgTextLength avgTextLength; + + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + private Boolean isMultiline; + + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + private String fontFamily; + + public TemplateResponseDocumentCustomFieldText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentCustomFieldText init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentCustomFieldText.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateResponseDocumentCustomFieldText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentCustomFieldText.class); } - TemplateResponseDocumentCustomFieldText templateResponseDocumentCustomFieldText = (TemplateResponseDocumentCustomFieldText) o; - return Objects.equals(this.type, templateResponseDocumentCustomFieldText.type) && - Objects.equals(this.avgTextLength, templateResponseDocumentCustomFieldText.avgTextLength) && - Objects.equals(this.isMultiline, templateResponseDocumentCustomFieldText.isMultiline) && - Objects.equals(this.originalFontSize, templateResponseDocumentCustomFieldText.originalFontSize) && - Objects.equals(this.fontFamily, templateResponseDocumentCustomFieldText.fontFamily) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentCustomFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public TemplateResponseDocumentCustomFieldText type(String type) { + this.type = type; + return this; } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; - } - if (avgTextLength.getClass().equals(java.io.File.class) || - avgTextLength.getClass().equals(Integer.class) || - avgTextLength.getClass().equals(String.class) || - avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for(int i = 0; i< getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); - } - } - else { - map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); - } + /** + * The type of this Custom Field. Only `text` and `checkbox` are currently + * supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses + * `TemplateResponseDocumentCustomFieldCheckbox` + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - if (isMultiline.getClass().equals(java.io.File.class) || - isMultiline.getClass().equals(Integer.class) || - isMultiline.getClass().equals(String.class) || - isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for(int i = 0; i< getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } - else { - map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - if (originalFontSize.getClass().equals(java.io.File.class) || - originalFontSize.getClass().equals(Integer.class) || - originalFontSize.getClass().equals(String.class) || - originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for(int i = 0; i< getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } + public TemplateResponseDocumentCustomFieldText avgTextLength( + TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * + * @return avgTextLength + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + public TemplateResponseDocumentCustomFieldText isMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * + * @return isMultiline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMultiline() { + return isMultiline; + } + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + public TemplateResponseDocumentCustomFieldText originalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * + * @return originalFontSize + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOriginalFontSize() { + return originalFontSize; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + public TemplateResponseDocumentCustomFieldText fontFamily(String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(String fontFamily) { + this.fontFamily = fontFamily; + } + + /** Return true if this TemplateResponseDocumentCustomFieldText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentCustomFieldText templateResponseDocumentCustomFieldText = + (TemplateResponseDocumentCustomFieldText) o; + return Objects.equals(this.type, templateResponseDocumentCustomFieldText.type) + && Objects.equals( + this.avgTextLength, templateResponseDocumentCustomFieldText.avgTextLength) + && Objects.equals( + this.isMultiline, templateResponseDocumentCustomFieldText.isMultiline) + && Objects.equals( + this.originalFontSize, + templateResponseDocumentCustomFieldText.originalFontSize) + && Objects.equals( + this.fontFamily, templateResponseDocumentCustomFieldText.fontFamily) + && super.equals(o); } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + @Override + public int hashCode() { + return Objects.hash( + type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentCustomFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } + + if (avgTextLength.getClass().equals(java.io.File.class) + || avgTextLength.getClass().equals(Integer.class) + || avgTextLength.getClass().equals(String.class) + || avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for (int i = 0; i < getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } + } else { + map.put( + "avg_text_length", + JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + } + } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } + + if (isMultiline.getClass().equals(java.io.File.class) + || isMultiline.getClass().equals(Integer.class) + || isMultiline.getClass().equals(String.class) + || isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for (int i = 0; i < getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } + } else { + map.put( + "isMultiline", + JSON.getDefault().getMapper().writeValueAsString(isMultiline)); + } + } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } + + if (originalFontSize.getClass().equals(java.io.File.class) + || originalFontSize.getClass().equals(Integer.class) + || originalFontSize.getClass().equals(String.class) + || originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for (int i = 0; i < getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } else { + map.put( + "originalFontSize", + JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "fontFamily", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put( + "TemplateResponseDocumentCustomFieldText", + TemplateResponseDocumentCustomFieldText.class); + JSON.registerDiscriminator(TemplateResponseDocumentCustomFieldText.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java index 4f3c61f..27dd50e 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroup.java @@ -10,220 +10,207 @@ * 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.TemplateResponseDocumentFieldGroupRule; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateResponseDocumentFieldGroup - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseDocumentFieldGroup { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_RULE = "rule"; - private TemplateResponseDocumentFieldGroupRule rule; - - public TemplateResponseDocumentFieldGroup() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFieldGroup init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroup.class); - } - - static public TemplateResponseDocumentFieldGroup init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFieldGroup.class - ); - } - - public TemplateResponseDocumentFieldGroup name(String name) { - this.name = name; - return this; - } - - /** - * The name of the form field group. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TemplateResponseDocumentFieldGroup rule(TemplateResponseDocumentFieldGroupRule rule) { - this.rule = rule; - return this; - } - - /** - * Get rule - * @return rule - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponseDocumentFieldGroupRule getRule() { - return rule; - } - - - @JsonProperty(JSON_PROPERTY_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRule(TemplateResponseDocumentFieldGroupRule rule) { - this.rule = rule; - } - - - /** - * Return true if this TemplateResponseDocumentFieldGroup object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFieldGroup templateResponseDocumentFieldGroup = (TemplateResponseDocumentFieldGroup) o; - return Objects.equals(this.name, templateResponseDocumentFieldGroup.name) && - Objects.equals(this.rule, templateResponseDocumentFieldGroup.rule); - } - - @Override - public int hashCode() { - return Objects.hash(name, rule); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFieldGroup {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static final String JSON_PROPERTY_RULE = "rule"; + private TemplateResponseDocumentFieldGroupRule rule; + + public TemplateResponseDocumentFieldGroup() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFieldGroup init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroup.class); } - if (rule != null) { - if (isFileTypeOrListOfFiles(rule)) { - fileTypeFound = true; - } - if (rule.getClass().equals(java.io.File.class) || - rule.getClass().equals(Integer.class) || - rule.getClass().equals(String.class) || - rule.getClass().isEnum()) { - map.put("rule", rule); - } else if (isListOfFile(rule)) { - for(int i = 0; i< getListSize(rule); i++) { - map.put("rule[" + i + "]", getFromList(rule, i)); - } + public static TemplateResponseDocumentFieldGroup init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFieldGroup.class); + } + + public TemplateResponseDocumentFieldGroup name(String name) { + this.name = name; + return this; + } + + /** + * The name of the form field group. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public TemplateResponseDocumentFieldGroup rule(TemplateResponseDocumentFieldGroupRule rule) { + this.rule = rule; + return this; + } + + /** + * Get rule + * + * @return rule + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponseDocumentFieldGroupRule getRule() { + return rule; + } + + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRule(TemplateResponseDocumentFieldGroupRule rule) { + this.rule = rule; + } + + /** Return true if this TemplateResponseDocumentFieldGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("rule", JSON.getDefault().getMapper().writeValueAsString(rule)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFieldGroup templateResponseDocumentFieldGroup = + (TemplateResponseDocumentFieldGroup) o; + return Objects.equals(this.name, templateResponseDocumentFieldGroup.name) + && Objects.equals(this.rule, templateResponseDocumentFieldGroup.rule); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, rule); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFieldGroup {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (rule != null) { + if (isFileTypeOrListOfFiles(rule)) { + fileTypeFound = true; + } + + if (rule.getClass().equals(java.io.File.class) + || rule.getClass().equals(Integer.class) + || rule.getClass().equals(String.class) + || rule.getClass().isEnum()) { + map.put("rule", rule); + } else if (isListOfFile(rule)) { + for (int i = 0; i < getListSize(rule); i++) { + map.put("rule[" + i + "]", getFromList(rule, i)); + } + } else { + map.put("rule", JSON.getDefault().getMapper().writeValueAsString(rule)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java index 7fa0688..0fa796c 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFieldGroupRule.java @@ -10,219 +10,220 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -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). + * 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseDocumentFieldGroupRule { - public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; - private String requirement; - - public static final String JSON_PROPERTY_GROUP_LABEL = "groupLabel"; - private String groupLabel; - - public TemplateResponseDocumentFieldGroupRule() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFieldGroupRule init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroupRule.class); - } - - static public TemplateResponseDocumentFieldGroupRule init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFieldGroupRule.class - ); - } - - public TemplateResponseDocumentFieldGroupRule requirement(String requirement) { - this.requirement = 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 - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequirement() { - return requirement; - } - - - @JsonProperty(JSON_PROPERTY_REQUIREMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequirement(String requirement) { - this.requirement = requirement; - } - - - public TemplateResponseDocumentFieldGroupRule groupLabel(String groupLabel) { - this.groupLabel = groupLabel; - return this; - } - - /** - * Name of the group - * @return groupLabel - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroupLabel() { - return groupLabel; - } - - - @JsonProperty(JSON_PROPERTY_GROUP_LABEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroupLabel(String groupLabel) { - this.groupLabel = groupLabel; - } - - - /** - * Return true if this TemplateResponseDocumentFieldGroupRule object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFieldGroupRule templateResponseDocumentFieldGroupRule = (TemplateResponseDocumentFieldGroupRule) o; - return Objects.equals(this.requirement, templateResponseDocumentFieldGroupRule.requirement) && - Objects.equals(this.groupLabel, templateResponseDocumentFieldGroupRule.groupLabel); - } - - @Override - public int hashCode() { - return Objects.hash(requirement, groupLabel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFieldGroupRule {\n"); - sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); - sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (requirement != null) { - if (isFileTypeOrListOfFiles(requirement)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_REQUIREMENT = "requirement"; + private String requirement; - if (requirement.getClass().equals(java.io.File.class) || - requirement.getClass().equals(Integer.class) || - requirement.getClass().equals(String.class) || - requirement.getClass().isEnum()) { - map.put("requirement", requirement); - } else if (isListOfFile(requirement)) { - for(int i = 0; i< getListSize(requirement); i++) { - map.put("requirement[" + i + "]", getFromList(requirement, i)); - } - } - else { - map.put("requirement", JSON.getDefault().getMapper().writeValueAsString(requirement)); - } + public static final String JSON_PROPERTY_GROUP_LABEL = "groupLabel"; + private String groupLabel; + + public TemplateResponseDocumentFieldGroupRule() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFieldGroupRule init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFieldGroupRule.class); } - if (groupLabel != null) { - if (isFileTypeOrListOfFiles(groupLabel)) { - fileTypeFound = true; - } - if (groupLabel.getClass().equals(java.io.File.class) || - groupLabel.getClass().equals(Integer.class) || - groupLabel.getClass().equals(String.class) || - groupLabel.getClass().isEnum()) { - map.put("groupLabel", groupLabel); - } else if (isListOfFile(groupLabel)) { - for(int i = 0; i< getListSize(groupLabel); i++) { - map.put("groupLabel[" + i + "]", getFromList(groupLabel, i)); - } + public static TemplateResponseDocumentFieldGroupRule init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFieldGroupRule.class); + } + + public TemplateResponseDocumentFieldGroupRule requirement(String requirement) { + this.requirement = 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 @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequirement() { + return requirement; + } + + @JsonProperty(JSON_PROPERTY_REQUIREMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirement(String requirement) { + this.requirement = requirement; + } + + public TemplateResponseDocumentFieldGroupRule groupLabel(String groupLabel) { + this.groupLabel = groupLabel; + return this; + } + + /** + * Name of the group + * + * @return groupLabel + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupLabel() { + return groupLabel; + } + + @JsonProperty(JSON_PROPERTY_GROUP_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupLabel(String groupLabel) { + this.groupLabel = groupLabel; + } + + /** Return true if this TemplateResponseDocumentFieldGroupRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("groupLabel", JSON.getDefault().getMapper().writeValueAsString(groupLabel)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFieldGroupRule templateResponseDocumentFieldGroupRule = + (TemplateResponseDocumentFieldGroupRule) o; + return Objects.equals(this.requirement, templateResponseDocumentFieldGroupRule.requirement) + && Objects.equals( + this.groupLabel, templateResponseDocumentFieldGroupRule.groupLabel); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(requirement, groupLabel); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFieldGroupRule {\n"); + sb.append(" requirement: ").append(toIndentedString(requirement)).append("\n"); + sb.append(" groupLabel: ").append(toIndentedString(groupLabel)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (requirement != null) { + if (isFileTypeOrListOfFiles(requirement)) { + fileTypeFound = true; + } + + if (requirement.getClass().equals(java.io.File.class) + || requirement.getClass().equals(Integer.class) + || requirement.getClass().equals(String.class) + || requirement.getClass().isEnum()) { + map.put("requirement", requirement); + } else if (isListOfFile(requirement)) { + for (int i = 0; i < getListSize(requirement); i++) { + map.put("requirement[" + i + "]", getFromList(requirement, i)); + } + } else { + map.put( + "requirement", + JSON.getDefault().getMapper().writeValueAsString(requirement)); + } + } + if (groupLabel != null) { + if (isFileTypeOrListOfFiles(groupLabel)) { + fileTypeFound = true; + } + + if (groupLabel.getClass().equals(java.io.File.class) + || groupLabel.getClass().equals(Integer.class) + || groupLabel.getClass().equals(String.class) + || groupLabel.getClass().isEnum()) { + map.put("groupLabel", groupLabel); + } else if (isListOfFile(groupLabel)) { + for (int i = 0; i < getListSize(groupLabel); i++) { + map.put("groupLabel[" + i + "]", getFromList(groupLabel, i)); + } + } else { + map.put( + "groupLabel", + JSON.getDefault().getMapper().writeValueAsString(groupLabel)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java index 775126f..86b9974 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldBase.java @@ -10,659 +10,628 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * 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. */ @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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @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 TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - private String signer; - - public static final String JSON_PROPERTY_X = "x"; - private Integer x; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_Y = "y"; - private Integer y; + public static final String JSON_PROPERTY_SIGNER = "signer"; + private String signer; - public static final String JSON_PROPERTY_WIDTH = "width"; - private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - private Integer height; + public static final String JSON_PROPERTY_X = "x"; + private Integer x; - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; + public static final String JSON_PROPERTY_Y = "y"; + private Integer y; - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; - - public TemplateResponseDocumentFormFieldBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldBase.class); - } - - static public TemplateResponseDocumentFormFieldBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldBase.class - ); - } - - public TemplateResponseDocumentFormFieldBase type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public TemplateResponseDocumentFormFieldBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * A unique id for the form field. - * @return apiId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getApiId() { - return apiId; - } - - - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - - - public TemplateResponseDocumentFormFieldBase name(String name) { - this.name = name; - return this; - } - - /** - * The name of the form field. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - 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 - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigner() { - return signer; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - 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 - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getX() { - return x; - } - - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(Integer x) { - this.x = x; - } - - - public TemplateResponseDocumentFormFieldBase y(Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this form field. - * @return y - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getY() { - return y; - } - - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(Integer y) { - this.y = y; - } - - - public TemplateResponseDocumentFormFieldBase width(Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this form field. - * @return width - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getWidth() { - return width; - } - - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(Integer width) { - this.width = width; - } - - - public TemplateResponseDocumentFormFieldBase height(Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this form field. - * @return height - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getHeight() { - return height; - } - - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(Integer height) { - this.height = height; - } - - - public TemplateResponseDocumentFormFieldBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * Boolean showing whether or not this field is required. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public TemplateResponseDocumentFormFieldBase group(String group) { - this.group = 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 - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(String group) { - this.group = group; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldBase templateResponseDocumentFormFieldBase = (TemplateResponseDocumentFormFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldBase.type) && - Objects.equals(this.apiId, templateResponseDocumentFormFieldBase.apiId) && - Objects.equals(this.name, templateResponseDocumentFormFieldBase.name) && - Objects.equals(this.signer, templateResponseDocumentFormFieldBase.signer) && - Objects.equals(this.x, templateResponseDocumentFormFieldBase.x) && - Objects.equals(this.y, templateResponseDocumentFormFieldBase.y) && - Objects.equals(this.width, templateResponseDocumentFormFieldBase.width) && - Objects.equals(this.height, templateResponseDocumentFormFieldBase.height) && - Objects.equals(this.required, templateResponseDocumentFormFieldBase.required) && - Objects.equals(this.group, templateResponseDocumentFormFieldBase.group); - } - - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_WIDTH = "width"; + private Integer width; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Integer height; + + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; + + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + + public TemplateResponseDocumentFormFieldBase() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldBase init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldBase.class); } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + public static TemplateResponseDocumentFormFieldBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldBase.class); } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public TemplateResponseDocumentFormFieldBase type(String type) { + this.type = type; + return this; } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - if (signer.getClass().equals(java.io.File.class) || - signer.getClass().equals(Integer.class) || - signer.getClass().equals(String.class) || - signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for(int i = 0; i< getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } - else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - if (x.getClass().equals(java.io.File.class) || - x.getClass().equals(Integer.class) || - x.getClass().equals(String.class) || - x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for(int i = 0; i< getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } - else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - if (y.getClass().equals(java.io.File.class) || - y.getClass().equals(Integer.class) || - y.getClass().equals(String.class) || - y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for(int i = 0; i< getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } - else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + public TemplateResponseDocumentFormFieldBase apiId(String apiId) { + this.apiId = apiId; + return this; } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - if (width.getClass().equals(java.io.File.class) || - width.getClass().equals(Integer.class) || - width.getClass().equals(String.class) || - width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for(int i = 0; i< getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } - else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } + /** + * A unique id for the form field. + * + * @return apiId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiId() { + return apiId; } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - if (height.getClass().equals(java.io.File.class) || - height.getClass().equals(Integer.class) || - height.getClass().equals(String.class) || - height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for(int i = 0; i< getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } - else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(String apiId) { + this.apiId = apiId; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } + public TemplateResponseDocumentFormFieldBase name(String name) { + this.name = name; + return this; + } + + /** + * The name of the form field. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + 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 @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigner() { + return signer; + } + + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getX() { + return x; + } + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(Integer x) { + this.x = x; + } + + public TemplateResponseDocumentFormFieldBase y(Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this form field. + * + * @return y + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getY() { + return y; + } + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(Integer y) { + this.y = y; + } + + public TemplateResponseDocumentFormFieldBase width(Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this form field. + * + * @return width + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(Integer width) { + this.width = width; + } + + public TemplateResponseDocumentFormFieldBase height(Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this form field. + * + * @return height + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(Integer height) { + this.height = height; + } + + public TemplateResponseDocumentFormFieldBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public TemplateResponseDocumentFormFieldBase group(String group) { + this.group = 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 @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroup() { + return group; + } + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(String group) { + this.group = group; + } + + /** Return true if this TemplateResponseDocumentFormFieldBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldBase templateResponseDocumentFormFieldBase = + (TemplateResponseDocumentFormFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldBase.type) + && Objects.equals(this.apiId, templateResponseDocumentFormFieldBase.apiId) + && Objects.equals(this.name, templateResponseDocumentFormFieldBase.name) + && Objects.equals(this.signer, templateResponseDocumentFormFieldBase.signer) + && Objects.equals(this.x, templateResponseDocumentFormFieldBase.x) + && Objects.equals(this.y, templateResponseDocumentFormFieldBase.y) + && Objects.equals(this.width, templateResponseDocumentFormFieldBase.width) + && Objects.equals(this.height, templateResponseDocumentFormFieldBase.height) + && Objects.equals(this.required, templateResponseDocumentFormFieldBase.required) + && Objects.equals(this.group, templateResponseDocumentFormFieldBase.group); + } + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } + + if (signer.getClass().equals(java.io.File.class) + || signer.getClass().equals(Integer.class) + || signer.getClass().equals(String.class) + || signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for (int i = 0; i < getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } + } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } + + if (x.getClass().equals(java.io.File.class) + || x.getClass().equals(Integer.class) + || x.getClass().equals(String.class) + || x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for (int i = 0; i < getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } + } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } + + if (y.getClass().equals(java.io.File.class) + || y.getClass().equals(Integer.class) + || y.getClass().equals(String.class) + || y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for (int i = 0; i < getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } + } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } + + if (width.getClass().equals(java.io.File.class) + || width.getClass().equals(Integer.class) + || width.getClass().equals(String.class) + || width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for (int i = 0; i < getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } + } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } + + if (height.getClass().equals(java.io.File.class) + || height.getClass().equals(Integer.class) + || height.getClass().equals(String.class) + || height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for (int i = 0; i < getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + + 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 "); } - } 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 "); - } - - 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); - } -} + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java index dab3147..e7469c5 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldCheckbox.java @@ -10,187 +10,191 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldCheckbox.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentFormFieldCheckbox extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public TemplateResponseDocumentFormFieldCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldCheckbox.class); - } - - static public TemplateResponseDocumentFormFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldCheckbox.class - ); - } - - public TemplateResponseDocumentFormFieldCheckbox type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldCheckbox templateResponseDocumentFormFieldCheckbox = (TemplateResponseDocumentFormFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldCheckbox.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public TemplateResponseDocumentFormFieldCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldCheckbox init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldCheckbox.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldCheckbox.class); + } + + public TemplateResponseDocumentFormFieldCheckbox type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldCheckbox templateResponseDocumentFormFieldCheckbox = + (TemplateResponseDocumentFormFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldCheckbox.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldCheckbox", TemplateResponseDocumentFormFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldCheckbox.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java index 630282e..47a664a 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDateSigned.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldDateSigned.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentFormFieldDateSigned extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "date_signed"; - - public TemplateResponseDocumentFormFieldDateSigned() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldDateSigned init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldDateSigned.class); - } - - static public TemplateResponseDocumentFormFieldDateSigned init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldDateSigned.class - ); - } - - public TemplateResponseDocumentFormFieldDateSigned type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldDateSigned object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldDateSigned templateResponseDocumentFormFieldDateSigned = (TemplateResponseDocumentFormFieldDateSigned) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldDateSigned.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "date_signed"; + + public TemplateResponseDocumentFormFieldDateSigned() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldDateSigned init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldDateSigned.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldDateSigned init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldDateSigned.class); + } + + public TemplateResponseDocumentFormFieldDateSigned type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldDateSigned object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldDateSigned templateResponseDocumentFormFieldDateSigned = + (TemplateResponseDocumentFormFieldDateSigned) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldDateSigned.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldDateSigned", TemplateResponseDocumentFormFieldDateSigned.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDateSigned.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java index ffbf252..548aebe 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldDropdown.java @@ -10,187 +10,191 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldDropdown.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentFormFieldDropdown extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "dropdown"; - - public TemplateResponseDocumentFormFieldDropdown() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldDropdown init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldDropdown.class); - } - - static public TemplateResponseDocumentFormFieldDropdown init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldDropdown.class - ); - } - - public TemplateResponseDocumentFormFieldDropdown type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldDropdown object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldDropdown templateResponseDocumentFormFieldDropdown = (TemplateResponseDocumentFormFieldDropdown) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldDropdown.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "dropdown"; + + public TemplateResponseDocumentFormFieldDropdown() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldDropdown init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldDropdown.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldDropdown init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldDropdown.class); + } + + public TemplateResponseDocumentFormFieldDropdown type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldDropdown object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldDropdown templateResponseDocumentFormFieldDropdown = + (TemplateResponseDocumentFormFieldDropdown) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldDropdown.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldDropdown", TemplateResponseDocumentFormFieldDropdown.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldDropdown.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java index 72024c7..71ed8a6 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldHyperlink.java @@ -10,388 +10,394 @@ * 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.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - -public class TemplateResponseDocumentFormFieldHyperlink extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "hyperlink"; - - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - private String fontFamily; - - public TemplateResponseDocumentFormFieldHyperlink() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldHyperlink init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldHyperlink.class); - } - - static public TemplateResponseDocumentFormFieldHyperlink init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldHyperlink.class - ); - } - - public TemplateResponseDocumentFormFieldHyperlink type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public TemplateResponseDocumentFormFieldHyperlink avgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * @return avgTextLength - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - - public TemplateResponseDocumentFormFieldHyperlink isMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * @return isMultiline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsMultiline() { - return isMultiline; - } - - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - - public TemplateResponseDocumentFormFieldHyperlink originalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * @return originalFontSize - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOriginalFontSize() { - return originalFontSize; - } - - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - } - - - public TemplateResponseDocumentFormFieldHyperlink fontFamily(String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(String fontFamily) { - this.fontFamily = fontFamily; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldHyperlink object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "hyperlink"; + + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + private TemplateResponseFieldAvgTextLength avgTextLength; + + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + private Boolean isMultiline; + + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + private String fontFamily; + + public TemplateResponseDocumentFormFieldHyperlink() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldHyperlink init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldHyperlink.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateResponseDocumentFormFieldHyperlink init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldHyperlink.class); } - TemplateResponseDocumentFormFieldHyperlink templateResponseDocumentFormFieldHyperlink = (TemplateResponseDocumentFormFieldHyperlink) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldHyperlink.type) && - Objects.equals(this.avgTextLength, templateResponseDocumentFormFieldHyperlink.avgTextLength) && - Objects.equals(this.isMultiline, templateResponseDocumentFormFieldHyperlink.isMultiline) && - Objects.equals(this.originalFontSize, templateResponseDocumentFormFieldHyperlink.originalFontSize) && - Objects.equals(this.fontFamily, templateResponseDocumentFormFieldHyperlink.fontFamily) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public TemplateResponseDocumentFormFieldHyperlink type(String type) { + this.type = type; + return this; } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; - } - if (avgTextLength.getClass().equals(java.io.File.class) || - avgTextLength.getClass().equals(Integer.class) || - avgTextLength.getClass().equals(String.class) || - avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for(int i = 0; i< getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); - } - } - else { - map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - if (isMultiline.getClass().equals(java.io.File.class) || - isMultiline.getClass().equals(Integer.class) || - isMultiline.getClass().equals(String.class) || - isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for(int i = 0; i< getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } - else { - map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - if (originalFontSize.getClass().equals(java.io.File.class) || - originalFontSize.getClass().equals(Integer.class) || - originalFontSize.getClass().equals(String.class) || - originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for(int i = 0; i< getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } + public TemplateResponseDocumentFormFieldHyperlink avgTextLength( + TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * + * @return avgTextLength + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + public TemplateResponseDocumentFormFieldHyperlink isMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * + * @return isMultiline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMultiline() { + return isMultiline; + } + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + public TemplateResponseDocumentFormFieldHyperlink originalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * + * @return originalFontSize + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOriginalFontSize() { + return originalFontSize; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + public TemplateResponseDocumentFormFieldHyperlink fontFamily(String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(String fontFamily) { + this.fontFamily = fontFamily; + } + + /** Return true if this TemplateResponseDocumentFormFieldHyperlink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldHyperlink templateResponseDocumentFormFieldHyperlink = + (TemplateResponseDocumentFormFieldHyperlink) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldHyperlink.type) + && Objects.equals( + this.avgTextLength, + templateResponseDocumentFormFieldHyperlink.avgTextLength) + && Objects.equals( + this.isMultiline, templateResponseDocumentFormFieldHyperlink.isMultiline) + && Objects.equals( + this.originalFontSize, + templateResponseDocumentFormFieldHyperlink.originalFontSize) + && Objects.equals( + this.fontFamily, templateResponseDocumentFormFieldHyperlink.fontFamily) + && super.equals(o); } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + @Override + public int hashCode() { + return Objects.hash( + type, avgTextLength, isMultiline, originalFontSize, fontFamily, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } + + if (avgTextLength.getClass().equals(java.io.File.class) + || avgTextLength.getClass().equals(Integer.class) + || avgTextLength.getClass().equals(String.class) + || avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for (int i = 0; i < getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } + } else { + map.put( + "avg_text_length", + JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + } + } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } + + if (isMultiline.getClass().equals(java.io.File.class) + || isMultiline.getClass().equals(Integer.class) + || isMultiline.getClass().equals(String.class) + || isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for (int i = 0; i < getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } + } else { + map.put( + "isMultiline", + JSON.getDefault().getMapper().writeValueAsString(isMultiline)); + } + } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } + + if (originalFontSize.getClass().equals(java.io.File.class) + || originalFontSize.getClass().equals(Integer.class) + || originalFontSize.getClass().equals(String.class) + || originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for (int i = 0; i < getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } else { + map.put( + "originalFontSize", + JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "fontFamily", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } - } - } catch (Exception e) { - throw new ApiException(e); + + return fileTypeFound ? map : new HashMap<>(); } - return fileTypeFound ? map : new HashMap<>(); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - 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 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 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 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); + } - 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 "); + } - /** - * 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"; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap<>(); + mappings.put( + "TemplateResponseDocumentFormFieldHyperlink", + TemplateResponseDocumentFormFieldHyperlink.class); + JSON.registerDiscriminator( + TemplateResponseDocumentFormFieldHyperlink.class, "type", mappings); } - return o.toString().replace("\n", "\n "); - } - - 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java index 53bcf1b..b2a1c74 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldInitials.java @@ -10,187 +10,191 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldInitials.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentFormFieldInitials extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "initials"; - - public TemplateResponseDocumentFormFieldInitials() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldInitials init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldInitials.class); - } - - static public TemplateResponseDocumentFormFieldInitials init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldInitials.class - ); - } - - public TemplateResponseDocumentFormFieldInitials type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldInitials object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldInitials templateResponseDocumentFormFieldInitials = (TemplateResponseDocumentFormFieldInitials) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldInitials.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "initials"; + + public TemplateResponseDocumentFormFieldInitials() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldInitials init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldInitials.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldInitials init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldInitials.class); + } + + public TemplateResponseDocumentFormFieldInitials type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldInitials object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldInitials templateResponseDocumentFormFieldInitials = + (TemplateResponseDocumentFormFieldInitials) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldInitials.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldInitials", TemplateResponseDocumentFormFieldInitials.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldInitials.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java index 245c6d8..a9f1077 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldRadio.java @@ -10,187 +10,188 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldRadio.JSON_PROPERTY_TYPE}) +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "radio"; - - public TemplateResponseDocumentFormFieldRadio() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldRadio.class); - } - - static public TemplateResponseDocumentFormFieldRadio init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldRadio.class - ); - } - - public TemplateResponseDocumentFormFieldRadio type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldRadio object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldRadio templateResponseDocumentFormFieldRadio = (TemplateResponseDocumentFormFieldRadio) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldRadio.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "radio"; + + public TemplateResponseDocumentFormFieldRadio() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldRadio init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldRadio.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldRadio init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldRadio.class); + } + + public TemplateResponseDocumentFormFieldRadio type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldRadio object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldRadio templateResponseDocumentFormFieldRadio = + (TemplateResponseDocumentFormFieldRadio) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldRadio.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldRadio", TemplateResponseDocumentFormFieldRadio.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldRadio.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java index 8b3f3fd..4155ba4 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldSignature.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentFormFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentFormFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentFormFieldSignature.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentFormFieldSignature extends TemplateResponseDocumentFormFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "signature"; - - public TemplateResponseDocumentFormFieldSignature() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldSignature init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldSignature.class); - } - - static public TemplateResponseDocumentFormFieldSignature init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldSignature.class - ); - } - - public TemplateResponseDocumentFormFieldSignature type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldSignature object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldSignature templateResponseDocumentFormFieldSignature = (TemplateResponseDocumentFormFieldSignature) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldSignature.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "signature"; + + public TemplateResponseDocumentFormFieldSignature() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldSignature init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentFormFieldSignature.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentFormFieldSignature init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldSignature.class); + } + + public TemplateResponseDocumentFormFieldSignature type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentFormFieldSignature object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldSignature templateResponseDocumentFormFieldSignature = + (TemplateResponseDocumentFormFieldSignature) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldSignature.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentFormFieldSignature", TemplateResponseDocumentFormFieldSignature.class); - JSON.registerDiscriminator(TemplateResponseDocumentFormFieldSignature.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index b58e6f6..070454b 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -10,489 +10,500 @@ * 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.TemplateResponseDocumentFormFieldBase; -import com.dropbox.sign.model.TemplateResponseFieldAvgTextLength; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentFormFieldBase` - */ +/** 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) - + 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 { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; - private TemplateResponseFieldAvgTextLength avgTextLength; - - public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; - private Boolean isMultiline; - - public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; - private Integer originalFontSize; - - public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; - private String fontFamily; - - /** - * 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. - */ - public enum ValidationTypeEnum { - 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"); - - private String value; - - ValidationTypeEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String JSON_PROPERTY_AVG_TEXT_LENGTH = "avg_text_length"; + private TemplateResponseFieldAvgTextLength avgTextLength; - @JsonCreator - public static ValidationTypeEnum fromValue(String value) { - for (ValidationTypeEnum b : ValidationTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; - private ValidationTypeEnum validationType; - - public TemplateResponseDocumentFormFieldText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentFormFieldText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldText.class); - } - - static public TemplateResponseDocumentFormFieldText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentFormFieldText.class - ); - } - - public TemplateResponseDocumentFormFieldText type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - public TemplateResponseDocumentFormFieldText avgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - return this; - } - - /** - * Get avgTextLength - * @return avgTextLength - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TemplateResponseFieldAvgTextLength getAvgTextLength() { - return avgTextLength; - } - - - @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { - this.avgTextLength = avgTextLength; - } - - - public TemplateResponseDocumentFormFieldText isMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - return this; - } - - /** - * Whether this form field is multiline text. - * @return isMultiline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsMultiline() { - return isMultiline; - } - - - @JsonProperty(JSON_PROPERTY_IS_MULTILINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsMultiline(Boolean isMultiline) { - this.isMultiline = isMultiline; - } - - - public TemplateResponseDocumentFormFieldText originalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - return this; - } - - /** - * Original font size used in this form field's text. - * @return originalFontSize - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOriginalFontSize() { - return originalFontSize; - } - - - @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalFontSize(Integer originalFontSize) { - this.originalFontSize = originalFontSize; - } - - - public TemplateResponseDocumentFormFieldText fontFamily(String fontFamily) { - this.fontFamily = fontFamily; - return this; - } - - /** - * Font family used in this form field's text. - * @return fontFamily - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFontFamily() { - return fontFamily; - } - - - @JsonProperty(JSON_PROPERTY_FONT_FAMILY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFontFamily(String fontFamily) { - this.fontFamily = fontFamily; - } - - - public TemplateResponseDocumentFormFieldText validationType(ValidationTypeEnum validationType) { - this.validationType = validationType; - 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 - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ValidationTypeEnum getValidationType() { - return validationType; - } - - - @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setValidationType(ValidationTypeEnum validationType) { - this.validationType = validationType; - } - - - /** - * Return true if this TemplateResponseDocumentFormFieldText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentFormFieldText templateResponseDocumentFormFieldText = (TemplateResponseDocumentFormFieldText) o; - return Objects.equals(this.type, templateResponseDocumentFormFieldText.type) && - Objects.equals(this.avgTextLength, templateResponseDocumentFormFieldText.avgTextLength) && - Objects.equals(this.isMultiline, templateResponseDocumentFormFieldText.isMultiline) && - Objects.equals(this.originalFontSize, templateResponseDocumentFormFieldText.originalFontSize) && - Objects.equals(this.fontFamily, templateResponseDocumentFormFieldText.fontFamily) && - Objects.equals(this.validationType, templateResponseDocumentFormFieldText.validationType) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, avgTextLength, isMultiline, originalFontSize, fontFamily, validationType, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentFormFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); - sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); - sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); - sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); - sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_IS_MULTILINE = "isMultiline"; + private Boolean isMultiline; - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static final String JSON_PROPERTY_ORIGINAL_FONT_SIZE = "originalFontSize"; + private Integer originalFontSize; + + public static final String JSON_PROPERTY_FONT_FAMILY = "fontFamily"; + private String fontFamily; + + /** + * 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. + */ + public enum ValidationTypeEnum { + 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"); + + private String value; + + ValidationTypeEnum(String value) { + this.value = value; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + + @JsonValue + public String getValue() { + return value; } - } - if (avgTextLength != null) { - if (isFileTypeOrListOfFiles(avgTextLength)) { - fileTypeFound = true; + + @Override + public String toString() { + return String.valueOf(value); } - if (avgTextLength.getClass().equals(java.io.File.class) || - avgTextLength.getClass().equals(Integer.class) || - avgTextLength.getClass().equals(String.class) || - avgTextLength.getClass().isEnum()) { - map.put("avg_text_length", avgTextLength); - } else if (isListOfFile(avgTextLength)) { - for(int i = 0; i< getListSize(avgTextLength); i++) { - map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + @JsonCreator + public static ValidationTypeEnum fromValue(String value) { + for (ValidationTypeEnum b : ValidationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } } - } - else { - map.put("avg_text_length", JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + return null; } } - if (isMultiline != null) { - if (isFileTypeOrListOfFiles(isMultiline)) { - fileTypeFound = true; - } - if (isMultiline.getClass().equals(java.io.File.class) || - isMultiline.getClass().equals(Integer.class) || - isMultiline.getClass().equals(String.class) || - isMultiline.getClass().isEnum()) { - map.put("isMultiline", isMultiline); - } else if (isListOfFile(isMultiline)) { - for(int i = 0; i< getListSize(isMultiline); i++) { - map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); - } - } - else { - map.put("isMultiline", JSON.getDefault().getMapper().writeValueAsString(isMultiline)); - } + public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; + private ValidationTypeEnum validationType; + + public TemplateResponseDocumentFormFieldText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentFormFieldText init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentFormFieldText.class); } - if (originalFontSize != null) { - if (isFileTypeOrListOfFiles(originalFontSize)) { - fileTypeFound = true; - } - if (originalFontSize.getClass().equals(java.io.File.class) || - originalFontSize.getClass().equals(Integer.class) || - originalFontSize.getClass().equals(String.class) || - originalFontSize.getClass().isEnum()) { - map.put("originalFontSize", originalFontSize); - } else if (isListOfFile(originalFontSize)) { - for(int i = 0; i< getListSize(originalFontSize); i++) { - map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); - } - } - else { - map.put("originalFontSize", JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); - } + public static TemplateResponseDocumentFormFieldText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentFormFieldText.class); } - if (fontFamily != null) { - if (isFileTypeOrListOfFiles(fontFamily)) { - fileTypeFound = true; - } - if (fontFamily.getClass().equals(java.io.File.class) || - fontFamily.getClass().equals(Integer.class) || - fontFamily.getClass().equals(String.class) || - fontFamily.getClass().isEnum()) { - map.put("fontFamily", fontFamily); - } else if (isListOfFile(fontFamily)) { - for(int i = 0; i< getListSize(fontFamily); i++) { - map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); - } - } - else { - map.put("fontFamily", JSON.getDefault().getMapper().writeValueAsString(fontFamily)); - } + public TemplateResponseDocumentFormFieldText type(String type) { + this.type = type; + return this; } - if (validationType != null) { - if (isFileTypeOrListOfFiles(validationType)) { - fileTypeFound = true; - } - if (validationType.getClass().equals(java.io.File.class) || - validationType.getClass().equals(Integer.class) || - validationType.getClass().equals(String.class) || - validationType.getClass().isEnum()) { - map.put("validation_type", validationType); - } else if (isListOfFile(validationType)) { - for(int i = 0; i< getListSize(validationType); i++) { - map.put("validation_type[" + i + "]", getFromList(validationType, i)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + public TemplateResponseDocumentFormFieldText avgTextLength( + TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + return this; + } + + /** + * Get avgTextLength + * + * @return avgTextLength + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TemplateResponseFieldAvgTextLength getAvgTextLength() { + return avgTextLength; + } + + @JsonProperty(JSON_PROPERTY_AVG_TEXT_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAvgTextLength(TemplateResponseFieldAvgTextLength avgTextLength) { + this.avgTextLength = avgTextLength; + } + + public TemplateResponseDocumentFormFieldText isMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + return this; + } + + /** + * Whether this form field is multiline text. + * + * @return isMultiline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMultiline() { + return isMultiline; + } + + @JsonProperty(JSON_PROPERTY_IS_MULTILINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsMultiline(Boolean isMultiline) { + this.isMultiline = isMultiline; + } + + public TemplateResponseDocumentFormFieldText originalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + return this; + } + + /** + * Original font size used in this form field's text. + * + * @return originalFontSize + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOriginalFontSize() { + return originalFontSize; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_FONT_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOriginalFontSize(Integer originalFontSize) { + this.originalFontSize = originalFontSize; + } + + public TemplateResponseDocumentFormFieldText fontFamily(String fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + /** + * Font family used in this form field's text. + * + * @return fontFamily + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFontFamily() { + return fontFamily; + } + + @JsonProperty(JSON_PROPERTY_FONT_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFontFamily(String fontFamily) { + this.fontFamily = fontFamily; + } + + public TemplateResponseDocumentFormFieldText validationType(ValidationTypeEnum validationType) { + this.validationType = validationType; + 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 @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ValidationTypeEnum getValidationType() { + return validationType; + } + + @JsonProperty(JSON_PROPERTY_VALIDATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationType(ValidationTypeEnum validationType) { + this.validationType = validationType; + } + + /** Return true if this TemplateResponseDocumentFormFieldText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("validation_type", JSON.getDefault().getMapper().writeValueAsString(validationType)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentFormFieldText templateResponseDocumentFormFieldText = + (TemplateResponseDocumentFormFieldText) o; + return Objects.equals(this.type, templateResponseDocumentFormFieldText.type) + && Objects.equals( + this.avgTextLength, templateResponseDocumentFormFieldText.avgTextLength) + && Objects.equals( + this.isMultiline, templateResponseDocumentFormFieldText.isMultiline) + && Objects.equals( + this.originalFontSize, + templateResponseDocumentFormFieldText.originalFontSize) + && Objects.equals(this.fontFamily, templateResponseDocumentFormFieldText.fontFamily) + && Objects.equals( + this.validationType, templateResponseDocumentFormFieldText.validationType) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + type, + avgTextLength, + isMultiline, + originalFontSize, + fontFamily, + validationType, + super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentFormFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" avgTextLength: ").append(toIndentedString(avgTextLength)).append("\n"); + sb.append(" isMultiline: ").append(toIndentedString(isMultiline)).append("\n"); + sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); + sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); + sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (avgTextLength != null) { + if (isFileTypeOrListOfFiles(avgTextLength)) { + fileTypeFound = true; + } + + if (avgTextLength.getClass().equals(java.io.File.class) + || avgTextLength.getClass().equals(Integer.class) + || avgTextLength.getClass().equals(String.class) + || avgTextLength.getClass().isEnum()) { + map.put("avg_text_length", avgTextLength); + } else if (isListOfFile(avgTextLength)) { + for (int i = 0; i < getListSize(avgTextLength); i++) { + map.put("avg_text_length[" + i + "]", getFromList(avgTextLength, i)); + } + } else { + map.put( + "avg_text_length", + JSON.getDefault().getMapper().writeValueAsString(avgTextLength)); + } + } + if (isMultiline != null) { + if (isFileTypeOrListOfFiles(isMultiline)) { + fileTypeFound = true; + } + + if (isMultiline.getClass().equals(java.io.File.class) + || isMultiline.getClass().equals(Integer.class) + || isMultiline.getClass().equals(String.class) + || isMultiline.getClass().isEnum()) { + map.put("isMultiline", isMultiline); + } else if (isListOfFile(isMultiline)) { + for (int i = 0; i < getListSize(isMultiline); i++) { + map.put("isMultiline[" + i + "]", getFromList(isMultiline, i)); + } + } else { + map.put( + "isMultiline", + JSON.getDefault().getMapper().writeValueAsString(isMultiline)); + } + } + if (originalFontSize != null) { + if (isFileTypeOrListOfFiles(originalFontSize)) { + fileTypeFound = true; + } + + if (originalFontSize.getClass().equals(java.io.File.class) + || originalFontSize.getClass().equals(Integer.class) + || originalFontSize.getClass().equals(String.class) + || originalFontSize.getClass().isEnum()) { + map.put("originalFontSize", originalFontSize); + } else if (isListOfFile(originalFontSize)) { + for (int i = 0; i < getListSize(originalFontSize); i++) { + map.put("originalFontSize[" + i + "]", getFromList(originalFontSize, i)); + } + } else { + map.put( + "originalFontSize", + JSON.getDefault().getMapper().writeValueAsString(originalFontSize)); + } + } + if (fontFamily != null) { + if (isFileTypeOrListOfFiles(fontFamily)) { + fileTypeFound = true; + } + + if (fontFamily.getClass().equals(java.io.File.class) + || fontFamily.getClass().equals(Integer.class) + || fontFamily.getClass().equals(String.class) + || fontFamily.getClass().isEnum()) { + map.put("fontFamily", fontFamily); + } else if (isListOfFile(fontFamily)) { + for (int i = 0; i < getListSize(fontFamily); i++) { + map.put("fontFamily[" + i + "]", getFromList(fontFamily, i)); + } + } else { + map.put( + "fontFamily", + JSON.getDefault().getMapper().writeValueAsString(fontFamily)); + } + } + if (validationType != null) { + if (isFileTypeOrListOfFiles(validationType)) { + fileTypeFound = true; + } + + if (validationType.getClass().equals(java.io.File.class) + || validationType.getClass().equals(Integer.class) + || validationType.getClass().equals(String.class) + || validationType.getClass().isEnum()) { + map.put("validation_type", validationType); + } else if (isListOfFile(validationType)) { + for (int i = 0; i < getListSize(validationType); i++) { + map.put("validation_type[" + i + "]", getFromList(validationType, i)); + } + } else { + map.put( + "validation_type", + JSON.getDefault().getMapper().writeValueAsString(validationType)); + } + } + } 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 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 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 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); - } + 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"; + /** + * 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 "); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java index 323d7d2..164ee21 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldBase.java @@ -10,651 +10,628 @@ * 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.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; /** * 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 }) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +@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) + 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"), + @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 TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_API_ID = "api_id"; - private String apiId; + public static final String JSON_PROPERTY_API_ID = "api_id"; + private String apiId; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_SIGNER = "signer"; - private String signer = "me_now"; - - public static final String JSON_PROPERTY_X = "x"; - private Integer x; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_Y = "y"; - private Integer y; + public static final String JSON_PROPERTY_SIGNER = "signer"; + private String signer = "me_now"; - public static final String JSON_PROPERTY_WIDTH = "width"; - private Integer width; - - public static final String JSON_PROPERTY_HEIGHT = "height"; - private Integer height; + public static final String JSON_PROPERTY_X = "x"; + private Integer x; - public static final String JSON_PROPERTY_REQUIRED = "required"; - private Boolean required; + public static final String JSON_PROPERTY_Y = "y"; + private Integer y; - public static final String JSON_PROPERTY_GROUP = "group"; - private String group; + public static final String JSON_PROPERTY_WIDTH = "width"; + private Integer width; - public TemplateResponseDocumentStaticFieldBase() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldBase init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldBase.class); - } + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Integer height; - static public TemplateResponseDocumentStaticFieldBase init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldBase.class - ); - } + public static final String JSON_PROPERTY_REQUIRED = "required"; + private Boolean required; - public TemplateResponseDocumentStaticFieldBase type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } + public static final String JSON_PROPERTY_GROUP = "group"; + private String group; + public TemplateResponseDocumentStaticFieldBase() {} - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldBase init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldBase.class); + } - public TemplateResponseDocumentStaticFieldBase apiId(String apiId) { - this.apiId = apiId; - return this; - } - - /** - * A unique id for the static field. - * @return apiId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getApiId() { - return apiId; - } + public static TemplateResponseDocumentStaticFieldBase init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldBase.class); + } + public TemplateResponseDocumentStaticFieldBase type(String type) { + this.type = type; + return this; + } - @JsonProperty(JSON_PROPERTY_API_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiId(String apiId) { - this.apiId = apiId; - } - + /** + * Get type + * + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } - public TemplateResponseDocumentStaticFieldBase name(String name) { - this.name = name; - return this; - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } - /** - * The name of the static field. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TemplateResponseDocumentStaticFieldBase signer(String signer) { - this.signer = signer; - return this; - } - - /** - * The signer of the Static Field. - * @return signer - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigner() { - return signer; - } - - - @JsonProperty(JSON_PROPERTY_SIGNER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigner(String signer) { - this.signer = signer; - } - - - public TemplateResponseDocumentStaticFieldBase x(Integer x) { - this.x = x; - return this; - } - - /** - * The horizontal offset in pixels for this static field. - * @return x - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getX() { - return x; - } - - - @JsonProperty(JSON_PROPERTY_X) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setX(Integer x) { - this.x = x; - } - - - public TemplateResponseDocumentStaticFieldBase y(Integer y) { - this.y = y; - return this; - } - - /** - * The vertical offset in pixels for this static field. - * @return y - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getY() { - return y; - } - - - @JsonProperty(JSON_PROPERTY_Y) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setY(Integer y) { - this.y = y; - } - - - public TemplateResponseDocumentStaticFieldBase width(Integer width) { - this.width = width; - return this; - } - - /** - * The width in pixels of this static field. - * @return width - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getWidth() { - return width; - } - - - @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWidth(Integer width) { - this.width = width; - } - - - public TemplateResponseDocumentStaticFieldBase height(Integer height) { - this.height = height; - return this; - } - - /** - * The height in pixels of this static field. - * @return height - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getHeight() { - return height; - } - - - @JsonProperty(JSON_PROPERTY_HEIGHT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeight(Integer height) { - this.height = height; - } - - - public TemplateResponseDocumentStaticFieldBase required(Boolean required) { - this.required = required; - return this; - } - - /** - * Boolean showing whether or not this field is required. - * @return required - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getRequired() { - return required; - } - - - @JsonProperty(JSON_PROPERTY_REQUIRED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequired(Boolean required) { - this.required = required; - } - - - public TemplateResponseDocumentStaticFieldBase group(String group) { - this.group = 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 - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getGroup() { - return group; - } - - - @JsonProperty(JSON_PROPERTY_GROUP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGroup(String group) { - this.group = group; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldBase object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldBase templateResponseDocumentStaticFieldBase = (TemplateResponseDocumentStaticFieldBase) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldBase.type) && - Objects.equals(this.apiId, templateResponseDocumentStaticFieldBase.apiId) && - Objects.equals(this.name, templateResponseDocumentStaticFieldBase.name) && - Objects.equals(this.signer, templateResponseDocumentStaticFieldBase.signer) && - Objects.equals(this.x, templateResponseDocumentStaticFieldBase.x) && - Objects.equals(this.y, templateResponseDocumentStaticFieldBase.y) && - Objects.equals(this.width, templateResponseDocumentStaticFieldBase.width) && - Objects.equals(this.height, templateResponseDocumentStaticFieldBase.height) && - Objects.equals(this.required, templateResponseDocumentStaticFieldBase.required) && - Objects.equals(this.group, templateResponseDocumentStaticFieldBase.group); - } - - @Override - public int hashCode() { - return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldBase {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); - sb.append(" x: ").append(toIndentedString(x)).append("\n"); - sb.append(" y: ").append(toIndentedString(y)).append("\n"); - sb.append(" width: ").append(toIndentedString(width)).append("\n"); - sb.append(" height: ").append(toIndentedString(height)).append("\n"); - sb.append(" required: ").append(toIndentedString(required)).append("\n"); - sb.append(" group: ").append(toIndentedString(group)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + public TemplateResponseDocumentStaticFieldBase apiId(String apiId) { + this.apiId = apiId; + return this; + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + /** + * A unique id for the static field. + * + * @return apiId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getApiId() { + return apiId; } - if (apiId != null) { - if (isFileTypeOrListOfFiles(apiId)) { - fileTypeFound = true; - } - if (apiId.getClass().equals(java.io.File.class) || - apiId.getClass().equals(Integer.class) || - apiId.getClass().equals(String.class) || - apiId.getClass().isEnum()) { - map.put("api_id", apiId); - } else if (isListOfFile(apiId)) { - for(int i = 0; i< getListSize(apiId); i++) { - map.put("api_id[" + i + "]", getFromList(apiId, i)); - } - } - else { - map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); - } + @JsonProperty(JSON_PROPERTY_API_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiId(String apiId) { + this.apiId = apiId; } - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public TemplateResponseDocumentStaticFieldBase name(String name) { + this.name = name; + return this; } - if (signer != null) { - if (isFileTypeOrListOfFiles(signer)) { - fileTypeFound = true; - } - if (signer.getClass().equals(java.io.File.class) || - signer.getClass().equals(Integer.class) || - signer.getClass().equals(String.class) || - signer.getClass().isEnum()) { - map.put("signer", signer); - } else if (isListOfFile(signer)) { - for(int i = 0; i< getListSize(signer); i++) { - map.put("signer[" + i + "]", getFromList(signer, i)); - } - } - else { - map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); - } + /** + * The name of the static field. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - if (x != null) { - if (isFileTypeOrListOfFiles(x)) { - fileTypeFound = true; - } - if (x.getClass().equals(java.io.File.class) || - x.getClass().equals(Integer.class) || - x.getClass().equals(String.class) || - x.getClass().isEnum()) { - map.put("x", x); - } else if (isListOfFile(x)) { - for(int i = 0; i< getListSize(x); i++) { - map.put("x[" + i + "]", getFromList(x, i)); - } - } - else { - map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (y != null) { - if (isFileTypeOrListOfFiles(y)) { - fileTypeFound = true; - } - if (y.getClass().equals(java.io.File.class) || - y.getClass().equals(Integer.class) || - y.getClass().equals(String.class) || - y.getClass().isEnum()) { - map.put("y", y); - } else if (isListOfFile(y)) { - for(int i = 0; i< getListSize(y); i++) { - map.put("y[" + i + "]", getFromList(y, i)); - } - } - else { - map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); - } + public TemplateResponseDocumentStaticFieldBase signer(String signer) { + this.signer = signer; + return this; } - if (width != null) { - if (isFileTypeOrListOfFiles(width)) { - fileTypeFound = true; - } - if (width.getClass().equals(java.io.File.class) || - width.getClass().equals(Integer.class) || - width.getClass().equals(String.class) || - width.getClass().isEnum()) { - map.put("width", width); - } else if (isListOfFile(width)) { - for(int i = 0; i< getListSize(width); i++) { - map.put("width[" + i + "]", getFromList(width, i)); - } - } - else { - map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); - } + /** + * The signer of the Static Field. + * + * @return signer + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigner() { + return signer; } - if (height != null) { - if (isFileTypeOrListOfFiles(height)) { - fileTypeFound = true; - } - if (height.getClass().equals(java.io.File.class) || - height.getClass().equals(Integer.class) || - height.getClass().equals(String.class) || - height.getClass().isEnum()) { - map.put("height", height); - } else if (isListOfFile(height)) { - for(int i = 0; i< getListSize(height); i++) { - map.put("height[" + i + "]", getFromList(height, i)); - } - } - else { - map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); - } + @JsonProperty(JSON_PROPERTY_SIGNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigner(String signer) { + this.signer = signer; } - if (required != null) { - if (isFileTypeOrListOfFiles(required)) { - fileTypeFound = true; - } - if (required.getClass().equals(java.io.File.class) || - required.getClass().equals(Integer.class) || - required.getClass().equals(String.class) || - required.getClass().isEnum()) { - map.put("required", required); - } else if (isListOfFile(required)) { - for(int i = 0; i< getListSize(required); i++) { - map.put("required[" + i + "]", getFromList(required, i)); - } + public TemplateResponseDocumentStaticFieldBase x(Integer x) { + this.x = x; + return this; + } + + /** + * The horizontal offset in pixels for this static field. + * + * @return x + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getX() { + return x; + } + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(Integer x) { + this.x = x; + } + + public TemplateResponseDocumentStaticFieldBase y(Integer y) { + this.y = y; + return this; + } + + /** + * The vertical offset in pixels for this static field. + * + * @return y + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getY() { + return y; + } + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(Integer y) { + this.y = y; + } + + public TemplateResponseDocumentStaticFieldBase width(Integer width) { + this.width = width; + return this; + } + + /** + * The width in pixels of this static field. + * + * @return width + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getWidth() { + return width; + } + + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWidth(Integer width) { + this.width = width; + } + + public TemplateResponseDocumentStaticFieldBase height(Integer height) { + this.height = height; + return this; + } + + /** + * The height in pixels of this static field. + * + * @return height + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getHeight() { + return height; + } + + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(Integer height) { + this.height = height; + } + + public TemplateResponseDocumentStaticFieldBase required(Boolean required) { + this.required = required; + return this; + } + + /** + * Boolean showing whether or not this field is required. + * + * @return required + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequired() { + return required; + } + + @JsonProperty(JSON_PROPERTY_REQUIRED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequired(Boolean required) { + this.required = required; + } + + public TemplateResponseDocumentStaticFieldBase group(String group) { + this.group = 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 @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroup() { + return group; + } + + @JsonProperty(JSON_PROPERTY_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroup(String group) { + this.group = group; + } + + /** Return true if this TemplateResponseDocumentStaticFieldBase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldBase templateResponseDocumentStaticFieldBase = + (TemplateResponseDocumentStaticFieldBase) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldBase.type) + && Objects.equals(this.apiId, templateResponseDocumentStaticFieldBase.apiId) + && Objects.equals(this.name, templateResponseDocumentStaticFieldBase.name) + && Objects.equals(this.signer, templateResponseDocumentStaticFieldBase.signer) + && Objects.equals(this.x, templateResponseDocumentStaticFieldBase.x) + && Objects.equals(this.y, templateResponseDocumentStaticFieldBase.y) + && Objects.equals(this.width, templateResponseDocumentStaticFieldBase.width) + && Objects.equals(this.height, templateResponseDocumentStaticFieldBase.height) + && Objects.equals(this.required, templateResponseDocumentStaticFieldBase.required) + && Objects.equals(this.group, templateResponseDocumentStaticFieldBase.group); + } + + @Override + public int hashCode() { + return Objects.hash(type, apiId, name, signer, x, y, width, height, required, group); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldBase {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" signer: ").append(toIndentedString(signer)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append("}"); + return sb.toString(); } - if (group != null) { - if (isFileTypeOrListOfFiles(group)) { - fileTypeFound = true; - } - if (group.getClass().equals(java.io.File.class) || - group.getClass().equals(Integer.class) || - group.getClass().equals(String.class) || - group.getClass().isEnum()) { - map.put("group", group); - } else if (isListOfFile(group)) { - for(int i = 0; i< getListSize(group); i++) { - map.put("group[" + i + "]", getFromList(group, i)); + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (apiId != null) { + if (isFileTypeOrListOfFiles(apiId)) { + fileTypeFound = true; + } + + if (apiId.getClass().equals(java.io.File.class) + || apiId.getClass().equals(Integer.class) + || apiId.getClass().equals(String.class) + || apiId.getClass().isEnum()) { + map.put("api_id", apiId); + } else if (isListOfFile(apiId)) { + for (int i = 0; i < getListSize(apiId); i++) { + map.put("api_id[" + i + "]", getFromList(apiId, i)); + } + } else { + map.put("api_id", JSON.getDefault().getMapper().writeValueAsString(apiId)); + } + } + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (signer != null) { + if (isFileTypeOrListOfFiles(signer)) { + fileTypeFound = true; + } + + if (signer.getClass().equals(java.io.File.class) + || signer.getClass().equals(Integer.class) + || signer.getClass().equals(String.class) + || signer.getClass().isEnum()) { + map.put("signer", signer); + } else if (isListOfFile(signer)) { + for (int i = 0; i < getListSize(signer); i++) { + map.put("signer[" + i + "]", getFromList(signer, i)); + } + } else { + map.put("signer", JSON.getDefault().getMapper().writeValueAsString(signer)); + } } + if (x != null) { + if (isFileTypeOrListOfFiles(x)) { + fileTypeFound = true; + } + + if (x.getClass().equals(java.io.File.class) + || x.getClass().equals(Integer.class) + || x.getClass().equals(String.class) + || x.getClass().isEnum()) { + map.put("x", x); + } else if (isListOfFile(x)) { + for (int i = 0; i < getListSize(x); i++) { + map.put("x[" + i + "]", getFromList(x, i)); + } + } else { + map.put("x", JSON.getDefault().getMapper().writeValueAsString(x)); + } + } + if (y != null) { + if (isFileTypeOrListOfFiles(y)) { + fileTypeFound = true; + } + + if (y.getClass().equals(java.io.File.class) + || y.getClass().equals(Integer.class) + || y.getClass().equals(String.class) + || y.getClass().isEnum()) { + map.put("y", y); + } else if (isListOfFile(y)) { + for (int i = 0; i < getListSize(y); i++) { + map.put("y[" + i + "]", getFromList(y, i)); + } + } else { + map.put("y", JSON.getDefault().getMapper().writeValueAsString(y)); + } + } + if (width != null) { + if (isFileTypeOrListOfFiles(width)) { + fileTypeFound = true; + } + + if (width.getClass().equals(java.io.File.class) + || width.getClass().equals(Integer.class) + || width.getClass().equals(String.class) + || width.getClass().isEnum()) { + map.put("width", width); + } else if (isListOfFile(width)) { + for (int i = 0; i < getListSize(width); i++) { + map.put("width[" + i + "]", getFromList(width, i)); + } + } else { + map.put("width", JSON.getDefault().getMapper().writeValueAsString(width)); + } + } + if (height != null) { + if (isFileTypeOrListOfFiles(height)) { + fileTypeFound = true; + } + + if (height.getClass().equals(java.io.File.class) + || height.getClass().equals(Integer.class) + || height.getClass().equals(String.class) + || height.getClass().isEnum()) { + map.put("height", height); + } else if (isListOfFile(height)) { + for (int i = 0; i < getListSize(height); i++) { + map.put("height[" + i + "]", getFromList(height, i)); + } + } else { + map.put("height", JSON.getDefault().getMapper().writeValueAsString(height)); + } + } + if (required != null) { + if (isFileTypeOrListOfFiles(required)) { + fileTypeFound = true; + } + + if (required.getClass().equals(java.io.File.class) + || required.getClass().equals(Integer.class) + || required.getClass().equals(String.class) + || required.getClass().isEnum()) { + map.put("required", required); + } else if (isListOfFile(required)) { + for (int i = 0; i < getListSize(required); i++) { + map.put("required[" + i + "]", getFromList(required, i)); + } + } else { + map.put("required", JSON.getDefault().getMapper().writeValueAsString(required)); + } + } + if (group != null) { + if (isFileTypeOrListOfFiles(group)) { + fileTypeFound = true; + } + + if (group.getClass().equals(java.io.File.class) + || group.getClass().equals(Integer.class) + || group.getClass().equals(String.class) + || group.getClass().isEnum()) { + map.put("group", group); + } else if (isListOfFile(group)) { + for (int i = 0; i < getListSize(group); i++) { + map.put("group[" + i + "]", getFromList(group, i)); + } + } else { + map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + } + } + } catch (Exception e) { + throw new ApiException(e); } - else { - map.put("group", JSON.getDefault().getMapper().writeValueAsString(group)); + + 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 "); } - } 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 "); - } - - 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); - } -} + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java index 8af3ac8..774abc3 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldCheckbox.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldCheckbox.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldCheckbox extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "checkbox"; - - public TemplateResponseDocumentStaticFieldCheckbox() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldCheckbox init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldCheckbox.class); - } - - static public TemplateResponseDocumentStaticFieldCheckbox init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldCheckbox.class - ); - } - - public TemplateResponseDocumentStaticFieldCheckbox type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldCheckbox object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldCheckbox templateResponseDocumentStaticFieldCheckbox = (TemplateResponseDocumentStaticFieldCheckbox) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldCheckbox.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldCheckbox {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "checkbox"; + + public TemplateResponseDocumentStaticFieldCheckbox() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldCheckbox init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldCheckbox.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldCheckbox init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldCheckbox.class); + } + + public TemplateResponseDocumentStaticFieldCheckbox type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldCheckbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldCheckbox templateResponseDocumentStaticFieldCheckbox = + (TemplateResponseDocumentStaticFieldCheckbox) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldCheckbox.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldCheckbox {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldCheckbox", TemplateResponseDocumentStaticFieldCheckbox.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldCheckbox.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java index 33b76f5..d0674f8 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDateSigned.java @@ -10,187 +10,194 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldDateSigned.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldDateSigned extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "date_signed"; - - public TemplateResponseDocumentStaticFieldDateSigned() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldDateSigned init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldDateSigned.class); - } - - static public TemplateResponseDocumentStaticFieldDateSigned init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldDateSigned.class - ); - } - - public TemplateResponseDocumentStaticFieldDateSigned type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldDateSigned object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldDateSigned templateResponseDocumentStaticFieldDateSigned = (TemplateResponseDocumentStaticFieldDateSigned) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldDateSigned.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldDateSigned {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "date_signed"; + + public TemplateResponseDocumentStaticFieldDateSigned() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldDateSigned init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldDateSigned.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldDateSigned init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldDateSigned.class); + } + + public TemplateResponseDocumentStaticFieldDateSigned type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldDateSigned object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldDateSigned + templateResponseDocumentStaticFieldDateSigned = + (TemplateResponseDocumentStaticFieldDateSigned) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldDateSigned.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldDateSigned {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldDateSigned", TemplateResponseDocumentStaticFieldDateSigned.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDateSigned.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java index 42110fb..343de41 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldDropdown.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldDropdown.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldDropdown extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "dropdown"; - - public TemplateResponseDocumentStaticFieldDropdown() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldDropdown init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldDropdown.class); - } - - static public TemplateResponseDocumentStaticFieldDropdown init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldDropdown.class - ); - } - - public TemplateResponseDocumentStaticFieldDropdown type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldDropdown object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldDropdown templateResponseDocumentStaticFieldDropdown = (TemplateResponseDocumentStaticFieldDropdown) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldDropdown.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldDropdown {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "dropdown"; + + public TemplateResponseDocumentStaticFieldDropdown() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldDropdown init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldDropdown.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldDropdown init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldDropdown.class); + } + + public TemplateResponseDocumentStaticFieldDropdown type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldDropdown object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldDropdown templateResponseDocumentStaticFieldDropdown = + (TemplateResponseDocumentStaticFieldDropdown) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldDropdown.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldDropdown {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldDropdown", TemplateResponseDocumentStaticFieldDropdown.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldDropdown.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java index b3a7df6..1526790 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldHyperlink.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldHyperlink.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldHyperlink extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "hyperlink"; - - public TemplateResponseDocumentStaticFieldHyperlink() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldHyperlink init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldHyperlink.class); - } - - static public TemplateResponseDocumentStaticFieldHyperlink init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldHyperlink.class - ); - } - - public TemplateResponseDocumentStaticFieldHyperlink type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldHyperlink object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldHyperlink templateResponseDocumentStaticFieldHyperlink = (TemplateResponseDocumentStaticFieldHyperlink) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldHyperlink.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldHyperlink {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "hyperlink"; + + public TemplateResponseDocumentStaticFieldHyperlink() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldHyperlink init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldHyperlink.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldHyperlink init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldHyperlink.class); + } + + public TemplateResponseDocumentStaticFieldHyperlink type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldHyperlink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldHyperlink templateResponseDocumentStaticFieldHyperlink = + (TemplateResponseDocumentStaticFieldHyperlink) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldHyperlink.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldHyperlink {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldHyperlink", TemplateResponseDocumentStaticFieldHyperlink.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldHyperlink.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java index 9e87a2a..01f4202 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldInitials.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldInitials.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldInitials extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "initials"; - - public TemplateResponseDocumentStaticFieldInitials() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldInitials init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldInitials.class); - } - - static public TemplateResponseDocumentStaticFieldInitials init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldInitials.class - ); - } - - public TemplateResponseDocumentStaticFieldInitials type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldInitials object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldInitials templateResponseDocumentStaticFieldInitials = (TemplateResponseDocumentStaticFieldInitials) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldInitials.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldInitials {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "initials"; + + public TemplateResponseDocumentStaticFieldInitials() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldInitials init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldInitials.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldInitials init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldInitials.class); + } + + public TemplateResponseDocumentStaticFieldInitials type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldInitials object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldInitials templateResponseDocumentStaticFieldInitials = + (TemplateResponseDocumentStaticFieldInitials) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldInitials.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldInitials {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldInitials", TemplateResponseDocumentStaticFieldInitials.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldInitials.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java index 5160c6e..c1c658d 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldRadio.java @@ -10,187 +10,191 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldRadio.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldRadio extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "radio"; - - public TemplateResponseDocumentStaticFieldRadio() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldRadio init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldRadio.class); - } - - static public TemplateResponseDocumentStaticFieldRadio init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldRadio.class - ); - } - - public TemplateResponseDocumentStaticFieldRadio type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldRadio object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldRadio templateResponseDocumentStaticFieldRadio = (TemplateResponseDocumentStaticFieldRadio) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldRadio.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldRadio {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "radio"; + + public TemplateResponseDocumentStaticFieldRadio() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldRadio init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldRadio.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldRadio init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldRadio.class); + } + + public TemplateResponseDocumentStaticFieldRadio type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldRadio object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldRadio templateResponseDocumentStaticFieldRadio = + (TemplateResponseDocumentStaticFieldRadio) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldRadio.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldRadio {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldRadio", TemplateResponseDocumentStaticFieldRadio.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldRadio.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java index 55083a9..3fd6037 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldSignature.java @@ -10,187 +10,192 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldSignature.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldSignature extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "signature"; - - public TemplateResponseDocumentStaticFieldSignature() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldSignature init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldSignature.class); - } - - static public TemplateResponseDocumentStaticFieldSignature init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldSignature.class - ); - } - - public TemplateResponseDocumentStaticFieldSignature type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldSignature object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldSignature templateResponseDocumentStaticFieldSignature = (TemplateResponseDocumentStaticFieldSignature) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldSignature.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldSignature {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "signature"; + + public TemplateResponseDocumentStaticFieldSignature() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldSignature init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldSignature.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldSignature init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldSignature.class); + } + + public TemplateResponseDocumentStaticFieldSignature type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldSignature object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldSignature templateResponseDocumentStaticFieldSignature = + (TemplateResponseDocumentStaticFieldSignature) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldSignature.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldSignature {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldSignature", TemplateResponseDocumentStaticFieldSignature.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldSignature.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java index 096be22..e8f1797 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentStaticFieldText.java @@ -10,187 +10,190 @@ * 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.TemplateResponseDocumentStaticFieldBase; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -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.annotation.JsonTypeInfo; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * This class extends `TemplateResponseDocumentStaticFieldBase` - */ -@JsonPropertyOrder({ - TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") +/** This class extends `TemplateResponseDocumentStaticFieldBase` */ +@JsonPropertyOrder({TemplateResponseDocumentStaticFieldText.JSON_PROPERTY_TYPE}) +@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) - -public class TemplateResponseDocumentStaticFieldText extends TemplateResponseDocumentStaticFieldBase { - public static final String JSON_PROPERTY_TYPE = "type"; - private String type = "text"; - - public TemplateResponseDocumentStaticFieldText() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseDocumentStaticFieldText init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseDocumentStaticFieldText.class); - } - - static public TemplateResponseDocumentStaticFieldText init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseDocumentStaticFieldText.class - ); - } - - public TemplateResponseDocumentStaticFieldText type(String type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(String type) { - this.type = type; - } - - - /** - * Return true if this TemplateResponseDocumentStaticFieldText object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseDocumentStaticFieldText templateResponseDocumentStaticFieldText = (TemplateResponseDocumentStaticFieldText) o; - return Objects.equals(this.type, templateResponseDocumentStaticFieldText.type) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(type, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseDocumentStaticFieldText {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - map.putAll(super.createFormData()); - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + 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 { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "text"; + + public TemplateResponseDocumentStaticFieldText() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseDocumentStaticFieldText init(String jsonData) throws Exception { + return new ObjectMapper() + .readValue(jsonData, TemplateResponseDocumentStaticFieldText.class); + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } + public static TemplateResponseDocumentStaticFieldText init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseDocumentStaticFieldText.class); + } + + public TemplateResponseDocumentStaticFieldText type(String type) { + this.type = 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + /** Return true if this TemplateResponseDocumentStaticFieldText object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseDocumentStaticFieldText templateResponseDocumentStaticFieldText = + (TemplateResponseDocumentStaticFieldText) o; + return Objects.equals(this.type, templateResponseDocumentStaticFieldText.type) + && super.equals(o); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(type, super.hashCode()); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseDocumentStaticFieldText {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + map.putAll(super.createFormData()); + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(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 boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").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"; + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); } - return o.toString().replace("\n", "\n "); - } - static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap<>(); - mappings.put("TemplateResponseDocumentStaticFieldText", TemplateResponseDocumentStaticFieldText.class); - JSON.registerDiscriminator(TemplateResponseDocumentStaticFieldText.class, "type", mappings); - } -} + 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 "); + } + + 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/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java b/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java index 96d7f22..b5a9afb 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseFieldAvgTextLength.java @@ -10,219 +10,212 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Average text length in this field. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseFieldAvgTextLength { - public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; - private Integer numLines; - - public static final String JSON_PROPERTY_NUM_CHARS_PER_LINE = "num_chars_per_line"; - private Integer numCharsPerLine; - - public TemplateResponseFieldAvgTextLength() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseFieldAvgTextLength init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseFieldAvgTextLength.class); - } - - static public TemplateResponseFieldAvgTextLength init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseFieldAvgTextLength.class - ); - } - - public TemplateResponseFieldAvgTextLength numLines(Integer numLines) { - this.numLines = numLines; - return this; - } - - /** - * Number of lines. - * @return numLines - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_LINES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumLines() { - return numLines; - } - - - @JsonProperty(JSON_PROPERTY_NUM_LINES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumLines(Integer numLines) { - this.numLines = numLines; - } - - - public TemplateResponseFieldAvgTextLength numCharsPerLine(Integer numCharsPerLine) { - this.numCharsPerLine = numCharsPerLine; - return this; - } - - /** - * Number of characters per line. - * @return numCharsPerLine - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNumCharsPerLine() { - return numCharsPerLine; - } - - - @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNumCharsPerLine(Integer numCharsPerLine) { - this.numCharsPerLine = numCharsPerLine; - } - - - /** - * Return true if this TemplateResponseFieldAvgTextLength object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseFieldAvgTextLength templateResponseFieldAvgTextLength = (TemplateResponseFieldAvgTextLength) o; - return Objects.equals(this.numLines, templateResponseFieldAvgTextLength.numLines) && - Objects.equals(this.numCharsPerLine, templateResponseFieldAvgTextLength.numCharsPerLine); - } - - @Override - public int hashCode() { - return Objects.hash(numLines, numCharsPerLine); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseFieldAvgTextLength {\n"); - sb.append(" numLines: ").append(toIndentedString(numLines)).append("\n"); - sb.append(" numCharsPerLine: ").append(toIndentedString(numCharsPerLine)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (numLines != null) { - if (isFileTypeOrListOfFiles(numLines)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NUM_LINES = "num_lines"; + private Integer numLines; - if (numLines.getClass().equals(java.io.File.class) || - numLines.getClass().equals(Integer.class) || - numLines.getClass().equals(String.class) || - numLines.getClass().isEnum()) { - map.put("num_lines", numLines); - } else if (isListOfFile(numLines)) { - for(int i = 0; i< getListSize(numLines); i++) { - map.put("num_lines[" + i + "]", getFromList(numLines, i)); - } - } - else { - map.put("num_lines", JSON.getDefault().getMapper().writeValueAsString(numLines)); - } + public static final String JSON_PROPERTY_NUM_CHARS_PER_LINE = "num_chars_per_line"; + private Integer numCharsPerLine; + + public TemplateResponseFieldAvgTextLength() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseFieldAvgTextLength init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseFieldAvgTextLength.class); } - if (numCharsPerLine != null) { - if (isFileTypeOrListOfFiles(numCharsPerLine)) { - fileTypeFound = true; - } - if (numCharsPerLine.getClass().equals(java.io.File.class) || - numCharsPerLine.getClass().equals(Integer.class) || - numCharsPerLine.getClass().equals(String.class) || - numCharsPerLine.getClass().isEnum()) { - map.put("num_chars_per_line", numCharsPerLine); - } else if (isListOfFile(numCharsPerLine)) { - for(int i = 0; i< getListSize(numCharsPerLine); i++) { - map.put("num_chars_per_line[" + i + "]", getFromList(numCharsPerLine, i)); - } + public static TemplateResponseFieldAvgTextLength init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseFieldAvgTextLength.class); + } + + public TemplateResponseFieldAvgTextLength numLines(Integer numLines) { + this.numLines = numLines; + return this; + } + + /** + * Number of lines. + * + * @return numLines + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumLines() { + return numLines; + } + + @JsonProperty(JSON_PROPERTY_NUM_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumLines(Integer numLines) { + this.numLines = numLines; + } + + public TemplateResponseFieldAvgTextLength numCharsPerLine(Integer numCharsPerLine) { + this.numCharsPerLine = numCharsPerLine; + return this; + } + + /** + * Number of characters per line. + * + * @return numCharsPerLine + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNumCharsPerLine() { + return numCharsPerLine; + } + + @JsonProperty(JSON_PROPERTY_NUM_CHARS_PER_LINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumCharsPerLine(Integer numCharsPerLine) { + this.numCharsPerLine = numCharsPerLine; + } + + /** Return true if this TemplateResponseFieldAvgTextLength object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("num_chars_per_line", JSON.getDefault().getMapper().writeValueAsString(numCharsPerLine)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseFieldAvgTextLength templateResponseFieldAvgTextLength = + (TemplateResponseFieldAvgTextLength) o; + return Objects.equals(this.numLines, templateResponseFieldAvgTextLength.numLines) + && Objects.equals( + this.numCharsPerLine, templateResponseFieldAvgTextLength.numCharsPerLine); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(numLines, numCharsPerLine); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseFieldAvgTextLength {\n"); + sb.append(" numLines: ").append(toIndentedString(numLines)).append("\n"); + sb.append(" numCharsPerLine: ").append(toIndentedString(numCharsPerLine)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (numLines != null) { + if (isFileTypeOrListOfFiles(numLines)) { + fileTypeFound = true; + } + + if (numLines.getClass().equals(java.io.File.class) + || numLines.getClass().equals(Integer.class) + || numLines.getClass().equals(String.class) + || numLines.getClass().isEnum()) { + map.put("num_lines", numLines); + } else if (isListOfFile(numLines)) { + for (int i = 0; i < getListSize(numLines); i++) { + map.put("num_lines[" + i + "]", getFromList(numLines, i)); + } + } else { + map.put( + "num_lines", + JSON.getDefault().getMapper().writeValueAsString(numLines)); + } + } + if (numCharsPerLine != null) { + if (isFileTypeOrListOfFiles(numCharsPerLine)) { + fileTypeFound = true; + } + + if (numCharsPerLine.getClass().equals(java.io.File.class) + || numCharsPerLine.getClass().equals(Integer.class) + || numCharsPerLine.getClass().equals(String.class) + || numCharsPerLine.getClass().isEnum()) { + map.put("num_chars_per_line", numCharsPerLine); + } else if (isListOfFile(numCharsPerLine)) { + for (int i = 0; i < getListSize(numCharsPerLine); i++) { + map.put("num_chars_per_line[" + i + "]", getFromList(numCharsPerLine, i)); + } + } else { + map.put( + "num_chars_per_line", + JSON.getDefault().getMapper().writeValueAsString(numCharsPerLine)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java b/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java index 2db65f1..4724f47 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseSignerRole.java @@ -10,219 +10,206 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateResponseSignerRole - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateResponseSignerRole { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_ORDER = "order"; - private Integer order; - - public TemplateResponseSignerRole() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateResponseSignerRole init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateResponseSignerRole.class); - } - - static public TemplateResponseSignerRole init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateResponseSignerRole.class - ); - } - - public TemplateResponseSignerRole name(String name) { - this.name = name; - return this; - } - - /** - * The name of the Role. - * @return name - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public TemplateResponseSignerRole order(Integer order) { - this.order = order; - return this; - } - - /** - * If signer order is assigned this is the 0-based index for this role. - * @return order - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getOrder() { - return order; - } - - - @JsonProperty(JSON_PROPERTY_ORDER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrder(Integer order) { - this.order = order; - } - - - /** - * Return true if this TemplateResponseSignerRole object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateResponseSignerRole templateResponseSignerRole = (TemplateResponseSignerRole) o; - return Objects.equals(this.name, templateResponseSignerRole.name) && - Objects.equals(this.order, templateResponseSignerRole.order); - } - - @Override - public int hashCode() { - return Objects.hash(name, order); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateResponseSignerRole {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" order: ").append(toIndentedString(order)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (name != null) { - if (isFileTypeOrListOfFiles(name)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - if (name.getClass().equals(java.io.File.class) || - name.getClass().equals(Integer.class) || - name.getClass().equals(String.class) || - name.getClass().isEnum()) { - map.put("name", name); - } else if (isListOfFile(name)) { - for(int i = 0; i< getListSize(name); i++) { - map.put("name[" + i + "]", getFromList(name, i)); - } - } - else { - map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); - } + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; + + public TemplateResponseSignerRole() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateResponseSignerRole init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateResponseSignerRole.class); } - if (order != null) { - if (isFileTypeOrListOfFiles(order)) { - fileTypeFound = true; - } - if (order.getClass().equals(java.io.File.class) || - order.getClass().equals(Integer.class) || - order.getClass().equals(String.class) || - order.getClass().isEnum()) { - map.put("order", order); - } else if (isListOfFile(order)) { - for(int i = 0; i< getListSize(order); i++) { - map.put("order[" + i + "]", getFromList(order, i)); - } + public static TemplateResponseSignerRole init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateResponseSignerRole.class); + } + + public TemplateResponseSignerRole name(String name) { + this.name = name; + return this; + } + + /** + * The name of the Role. + * + * @return name + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public TemplateResponseSignerRole order(Integer order) { + this.order = order; + return this; + } + + /** + * If signer order is assigned this is the 0-based index for this role. + * + * @return order + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getOrder() { + return order; + } + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + /** Return true if this TemplateResponseSignerRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateResponseSignerRole templateResponseSignerRole = (TemplateResponseSignerRole) o; + return Objects.equals(this.name, templateResponseSignerRole.name) + && Objects.equals(this.order, templateResponseSignerRole.order); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(name, order); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateResponseSignerRole {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (name != null) { + if (isFileTypeOrListOfFiles(name)) { + fileTypeFound = true; + } + + if (name.getClass().equals(java.io.File.class) + || name.getClass().equals(Integer.class) + || name.getClass().equals(String.class) + || name.getClass().isEnum()) { + map.put("name", name); + } else if (isListOfFile(name)) { + for (int i = 0; i < getListSize(name); i++) { + map.put("name[" + i + "]", getFromList(name, i)); + } + } else { + map.put("name", JSON.getDefault().getMapper().writeValueAsString(name)); + } + } + if (order != null) { + if (isFileTypeOrListOfFiles(order)) { + fileTypeFound = true; + } + + if (order.getClass().equals(java.io.File.class) + || order.getClass().equals(Integer.class) + || order.getClass().equals(String.class) + || order.getClass().isEnum()) { + map.put("order", order); + } else if (isListOfFile(order)) { + for (int i = 0; i < getListSize(order); i++) { + map.put("order[" + i + "]", getFromList(order, i)); + } + } else { + map.put("order", JSON.getDefault().getMapper().writeValueAsString(order)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java index 9a98aa7..6404a95 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesRequest.java @@ -10,438 +10,418 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; 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 java.util.Map; +import java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * TemplateUpdateFilesRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateUpdateFilesRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; - - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; - - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; - - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; - - public TemplateUpdateFilesRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateUpdateFilesRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesRequest.class); - } - - static public TemplateUpdateFilesRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesRequest.class - ); - } - - public TemplateUpdateFilesRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Client id of the app you're using to update this template. - * @return clientId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public TemplateUpdateFilesRequest files(List files) { - this.files = files; - return this; - } - - public TemplateUpdateFilesRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public TemplateUpdateFilesRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public TemplateUpdateFilesRequest message(String message) { - this.message = message; - return this; - } - - /** - * The new default template email message. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public TemplateUpdateFilesRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The new default template email subject. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public TemplateUpdateFilesRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - /** - * Return true if this TemplateUpdateFilesRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateUpdateFilesRequest templateUpdateFilesRequest = (TemplateUpdateFilesRequest) o; - return Objects.equals(this.clientId, templateUpdateFilesRequest.clientId) && - Objects.equals(this.files, templateUpdateFilesRequest.files) && - Objects.equals(this.fileUrls, templateUpdateFilesRequest.fileUrls) && - Objects.equals(this.message, templateUpdateFilesRequest.message) && - Objects.equals(this.subject, templateUpdateFilesRequest.subject) && - Objects.equals(this.testMode, templateUpdateFilesRequest.testMode); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, files, fileUrls, message, subject, testMode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public TemplateUpdateFilesRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateUpdateFilesRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesRequest.class); } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + public static TemplateUpdateFilesRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesRequest.class); } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + public TemplateUpdateFilesRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + /** + * Client id of the app you're using to update this template. + * + * @return clientId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public TemplateUpdateFilesRequest files(List files) { + this.files = files; + return this; + } + + public TemplateUpdateFilesRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } + this.files.add(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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; + + public TemplateUpdateFilesRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + + public TemplateUpdateFilesRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } + this.fileUrls.add(fileUrlsItem); + return this; + } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } + + public TemplateUpdateFilesRequest message(String message) { + this.message = message; + return this; + } + + /** + * The new default template email message. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public TemplateUpdateFilesRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The new default template email subject. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public TemplateUpdateFilesRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + /** Return true if this TemplateUpdateFilesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateUpdateFilesRequest templateUpdateFilesRequest = (TemplateUpdateFilesRequest) o; + return Objects.equals(this.clientId, templateUpdateFilesRequest.clientId) + && Objects.equals(this.files, templateUpdateFilesRequest.files) + && Objects.equals(this.fileUrls, templateUpdateFilesRequest.fileUrls) + && Objects.equals(this.message, templateUpdateFilesRequest.message) + && Objects.equals(this.subject, templateUpdateFilesRequest.subject) + && Objects.equals(this.testMode, templateUpdateFilesRequest.testMode); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(clientId, files, fileUrls, message, subject, testMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java index a393590..396c754 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponse.java @@ -10,170 +10,159 @@ * 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.TemplateUpdateFilesResponseTemplate; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * TemplateUpdateFilesResponse - */ -@JsonPropertyOrder({ - TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE -}) -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") -@JsonIgnoreProperties(ignoreUnknown=true) +/** TemplateUpdateFilesResponse */ +@JsonPropertyOrder({TemplateUpdateFilesResponse.JSON_PROPERTY_TEMPLATE}) +@javax.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class TemplateUpdateFilesResponse { - public static final String JSON_PROPERTY_TEMPLATE = "template"; - private TemplateUpdateFilesResponseTemplate template; - - public TemplateUpdateFilesResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateUpdateFilesResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponse.class); - } - - static public TemplateUpdateFilesResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesResponse.class - ); - } - - public TemplateUpdateFilesResponse template(TemplateUpdateFilesResponseTemplate template) { - this.template = template; - return this; - } - - /** - * Get template - * @return template - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public TemplateUpdateFilesResponseTemplate getTemplate() { - return template; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplate(TemplateUpdateFilesResponseTemplate template) { - this.template = template; - } - - - /** - * Return true if this TemplateUpdateFilesResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_TEMPLATE = "template"; + private TemplateUpdateFilesResponseTemplate template; + + public TemplateUpdateFilesResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateUpdateFilesResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static TemplateUpdateFilesResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesResponse.class); } - TemplateUpdateFilesResponse templateUpdateFilesResponse = (TemplateUpdateFilesResponse) o; - return Objects.equals(this.template, templateUpdateFilesResponse.template); - } - - @Override - public int hashCode() { - return Objects.hash(template); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesResponse {\n"); - sb.append(" template: ").append(toIndentedString(template)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (template != null) { - if (isFileTypeOrListOfFiles(template)) { - fileTypeFound = true; - } - if (template.getClass().equals(java.io.File.class) || - template.getClass().equals(Integer.class) || - template.getClass().equals(String.class) || - template.getClass().isEnum()) { - map.put("template", template); - } else if (isListOfFile(template)) { - for(int i = 0; i< getListSize(template); i++) { - map.put("template[" + i + "]", getFromList(template, i)); - } + public TemplateUpdateFilesResponse template(TemplateUpdateFilesResponseTemplate template) { + this.template = template; + return this; + } + + /** + * Get template + * + * @return template + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TemplateUpdateFilesResponseTemplate getTemplate() { + return template; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplate(TemplateUpdateFilesResponseTemplate template) { + this.template = template; + } + + /** Return true if this TemplateUpdateFilesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateUpdateFilesResponse templateUpdateFilesResponse = (TemplateUpdateFilesResponse) o; + return Objects.equals(this.template, templateUpdateFilesResponse.template); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(template); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesResponse {\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append("}"); + return sb.toString(); } - return fileTypeFound ? map : new HashMap<>(); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (template != null) { + if (isFileTypeOrListOfFiles(template)) { + fileTypeFound = true; + } + + if (template.getClass().equals(java.io.File.class) + || template.getClass().equals(Integer.class) + || template.getClass().equals(String.class) + || template.getClass().isEnum()) { + map.put("template", template); + } else if (isListOfFile(template)) { + for (int i = 0; i < getListSize(template); i++) { + map.put("template[" + i + "]", getFromList(template, i)); + } + } else { + map.put("template", JSON.getDefault().getMapper().writeValueAsString(template)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java index 3a26fc0..08f0784 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java +++ b/src/main/java/com/dropbox/sign/model/TemplateUpdateFilesResponseTemplate.java @@ -10,235 +10,223 @@ * 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.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * Contains template id - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public TemplateUpdateFilesResponseTemplate init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponseTemplate.class); - } - - static public TemplateUpdateFilesResponseTemplate init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - TemplateUpdateFilesResponseTemplate.class - ); - } - - public TemplateUpdateFilesResponseTemplate templateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * The id of the Template. - * @return templateId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTemplateId() { - return templateId; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTemplateId(String templateId) { - this.templateId = templateId; - } - - - @Deprecated - public TemplateUpdateFilesResponseTemplate warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - * @deprecated - */ - @Deprecated - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @Deprecated - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this TemplateUpdateFilesResponseTemplate object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TemplateUpdateFilesResponseTemplate templateUpdateFilesResponseTemplate = (TemplateUpdateFilesResponseTemplate) o; - return Objects.equals(this.templateId, templateUpdateFilesResponseTemplate.templateId) && - Objects.equals(this.warnings, templateUpdateFilesResponseTemplate.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(templateId, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TemplateUpdateFilesResponseTemplate {\n"); - sb.append(" templateId: ").append(toIndentedString(templateId)).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 (templateId != null) { - if (isFileTypeOrListOfFiles(templateId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; - if (templateId.getClass().equals(java.io.File.class) || - templateId.getClass().equals(Integer.class) || - templateId.getClass().equals(String.class) || - templateId.getClass().isEnum()) { - map.put("template_id", templateId); - } else if (isListOfFile(templateId)) { - for(int i = 0; i< getListSize(templateId); i++) { - map.put("template_id[" + i + "]", getFromList(templateId, i)); - } - } - else { - map.put("template_id", JSON.getDefault().getMapper().writeValueAsString(templateId)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + @Deprecated private List warnings = null; + + public TemplateUpdateFilesResponseTemplate() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static TemplateUpdateFilesResponseTemplate init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, TemplateUpdateFilesResponseTemplate.class); + } + + public static TemplateUpdateFilesResponseTemplate init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + TemplateUpdateFilesResponseTemplate.class); + } + + public TemplateUpdateFilesResponseTemplate templateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * The id of the Template. + * + * @return templateId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTemplateId() { + return templateId; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + @Deprecated + public TemplateUpdateFilesResponseTemplate warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public TemplateUpdateFilesResponseTemplate addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this TemplateUpdateFilesResponseTemplate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + TemplateUpdateFilesResponseTemplate templateUpdateFilesResponseTemplate = + (TemplateUpdateFilesResponseTemplate) o; + return Objects.equals(this.templateId, templateUpdateFilesResponseTemplate.templateId) + && Objects.equals(this.warnings, templateUpdateFilesResponseTemplate.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(templateId, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TemplateUpdateFilesResponseTemplate {\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (templateId != null) { + if (isFileTypeOrListOfFiles(templateId)) { + fileTypeFound = true; + } + + if (templateId.getClass().equals(java.io.File.class) + || templateId.getClass().equals(Integer.class) + || templateId.getClass().equals(String.class) + || templateId.getClass().isEnum()) { + map.put("template_id", templateId); + } else if (isListOfFile(templateId)) { + for (int i = 0; i < getListSize(templateId); i++) { + map.put("template_id[" + i + "]", getFromList(templateId, i)); + } + } else { + map.put( + "template_id", + JSON.getDefault().getMapper().writeValueAsString(templateId)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java index 34a3441..17f7cca 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedRequest.java @@ -10,2048 +10,2148 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubEditorOptions; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubSigningOptions; -import com.dropbox.sign.model.SubUnclaimedDraftSigner; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * - */ +/** */ @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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class UnclaimedDraftCreateEmbeddedRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + private String requesterEmailAddress; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - private String requesterEmailAddress; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + private Boolean allowCcs = true; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - private Boolean allowCcs = true; + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; - 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 = null; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; - private List attachments = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + private SubEditorOptions editorOptions; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - private SubEditorOptions editorOptions; + public static final String JSON_PROPERTY_FORCE_SIGNER_PAGE = "force_signer_page"; + private Boolean forceSignerPage = false; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + private Boolean forceSubjectMessage = false; - public static final String JSON_PROPERTY_FORCE_SIGNER_PAGE = "force_signer_page"; - private Boolean forceSignerPage = false; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - private Boolean forceSubjectMessage = false; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; - private List formFieldGroups = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + private List formFieldsPerDocument = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; + private Boolean holdRequest = false; - public static final String JSON_PROPERTY_HIDE_TEXT_TAGS = "hide_text_tags"; - private Boolean hideTextTags = false; + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + private Boolean isForEmbeddedSigning = false; - public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; - private Boolean holdRequest = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - private Boolean isForEmbeddedSigning = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + private String requestingRedirectUrl; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + private Boolean showPreview; - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - private String requestingRedirectUrl; + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + private Boolean showProgressStepper = true; - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - private Boolean showPreview; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = null; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + private Boolean skipMeNow = false; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - private Boolean skipMeNow = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + /** + * 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. + */ + public enum TypeEnum { + SEND_DOCUMENT("send_document"), - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + REQUEST_SIGNATURE("request_signature"); - /** - * 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. - */ - public enum TypeEnum { - SEND_DOCUMENT("send_document"), - - REQUEST_SIGNATURE("request_signature"); + private String value; - private String value; + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } - TypeEnum(String value) { - this.value = value; + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type = TypeEnum.REQUEST_SIGNATURE; + + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + private Boolean usePreexistingFields = false; + + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; + + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public UnclaimedDraftCreateEmbeddedRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftCreateEmbeddedRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedRequest.class); } - @Override - public String toString() { - return String.valueOf(value); + public static UnclaimedDraftCreateEmbeddedRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateEmbeddedRequest.class); } - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + public UnclaimedDraftCreateEmbeddedRequest clientId(String clientId) { + this.clientId = 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } + + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + 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 + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + public UnclaimedDraftCreateEmbeddedRequest files(List files) { + this.files = files; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + this.files.add(filesItem); + return this; } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type = TypeEnum.REQUEST_SIGNATURE; - - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - private Boolean usePreexistingFields = false; - - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - private Boolean useTextTags = false; - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; - private Boolean populateAutoFillFields = false; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public UnclaimedDraftCreateEmbeddedRequest() { - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftCreateEmbeddedRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedRequest.class); - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } - static public UnclaimedDraftCreateEmbeddedRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateEmbeddedRequest.class - ); - } - - public UnclaimedDraftCreateEmbeddedRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClientId() { - return clientId; - } + public UnclaimedDraftCreateEmbeddedRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; + } + public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public UnclaimedDraftCreateEmbeddedRequest requesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - 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 - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - - public UnclaimedDraftCreateEmbeddedRequest files(List files) { - this.files = files; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public UnclaimedDraftCreateEmbeddedRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public UnclaimedDraftCreateEmbeddedRequest allowCcs(Boolean allowCcs) { - this.allowCcs = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowCcs() { - return allowCcs; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(Boolean allowCcs) { - this.allowCcs = allowCcs; - } - - - public UnclaimedDraftCreateEmbeddedRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public UnclaimedDraftCreateEmbeddedRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public UnclaimedDraftCreateEmbeddedRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public UnclaimedDraftCreateEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * @return ccEmailAddresses - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - - public UnclaimedDraftCreateEmbeddedRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - public UnclaimedDraftCreateEmbeddedRequest editorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * @return editorOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - - public UnclaimedDraftCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(Boolean forceSignerPage) { - this.forceSignerPage = forceSignerPage; - return this; - } - - /** - * Provide users the ability to review/edit the signers. - * @return forceSignerPage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSignerPage() { - return forceSignerPage; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerPage(Boolean forceSignerPage) { - this.forceSignerPage = forceSignerPage; - } - - - public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the subject and message. - * @return forceSubjectMessage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } + public UnclaimedDraftCreateEmbeddedRequest allowCcs(Boolean allowCcs) { + this.allowCcs = 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 @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowCcs() { + return allowCcs; + } - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - - public UnclaimedDraftCreateEmbeddedRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public UnclaimedDraftCreateEmbeddedRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(Boolean allowCcs) { + this.allowCcs = allowCcs; } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - - public UnclaimedDraftCreateEmbeddedRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - 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.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } + public UnclaimedDraftCreateEmbeddedRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } - public UnclaimedDraftCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { - this.hideTextTags = 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 - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHideTextTags() { - return hideTextTags; - } - - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - - public UnclaimedDraftCreateEmbeddedRequest holdRequest(Boolean holdRequest) { - this.holdRequest = 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 - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHoldRequest() { - return holdRequest; - } - - - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHoldRequest(Boolean holdRequest) { - this.holdRequest = holdRequest; - } - - - public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - 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 - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - - public UnclaimedDraftCreateEmbeddedRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public UnclaimedDraftCreateEmbeddedRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, metadataItem); - return this; - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } - /** - * 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - - public UnclaimedDraftCreateEmbeddedRequest showPreview(Boolean showPreview) { - this.showPreview = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowPreview() { - return showPreview; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(Boolean showPreview) { - this.showPreview = showPreview; - } - - - public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public UnclaimedDraftCreateEmbeddedRequest signers(List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - return this; - } + public UnclaimedDraftCreateEmbeddedRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; + } - /** - * Add Signers to your Unclaimed Draft Signature Request. - * @return signers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public UnclaimedDraftCreateEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; + } - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public UnclaimedDraftCreateEmbeddedRequest skipMeNow(Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - return this; - } + public UnclaimedDraftCreateEmbeddedRequest attachments(List attachments) { + this.attachments = attachments; + 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 - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getSkipMeNow() { - return skipMeNow; - } - - - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - } - - - public UnclaimedDraftCreateEmbeddedRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public UnclaimedDraftCreateEmbeddedRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public UnclaimedDraftCreateEmbeddedRequest type(TypeEnum type) { - this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TypeEnum getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(TypeEnum type) { - this.type = type; - } - - - public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - 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 - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUsePreexistingFields() { - return usePreexistingFields; - } - - - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - } - - - public UnclaimedDraftCreateEmbeddedRequest useTextTags(Boolean useTextTags) { - this.useTextTags = 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 - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUseTextTags() { - return useTextTags; - } - - - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(Boolean useTextTags) { - this.useTextTags = useTextTags; - } - - - public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = 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 - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; - } - - - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - } - - - public UnclaimedDraftCreateEmbeddedRequest expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this UnclaimedDraftCreateEmbeddedRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest = (UnclaimedDraftCreateEmbeddedRequest) o; - return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedRequest.clientId) && - Objects.equals(this.requesterEmailAddress, unclaimedDraftCreateEmbeddedRequest.requesterEmailAddress) && - Objects.equals(this.files, unclaimedDraftCreateEmbeddedRequest.files) && - Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedRequest.fileUrls) && - Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedRequest.allowCcs) && - Objects.equals(this.allowDecline, unclaimedDraftCreateEmbeddedRequest.allowDecline) && - Objects.equals(this.allowReassign, unclaimedDraftCreateEmbeddedRequest.allowReassign) && - Objects.equals(this.attachments, unclaimedDraftCreateEmbeddedRequest.attachments) && - Objects.equals(this.ccEmailAddresses, unclaimedDraftCreateEmbeddedRequest.ccEmailAddresses) && - Objects.equals(this.customFields, unclaimedDraftCreateEmbeddedRequest.customFields) && - Objects.equals(this.editorOptions, unclaimedDraftCreateEmbeddedRequest.editorOptions) && - Objects.equals(this.fieldOptions, unclaimedDraftCreateEmbeddedRequest.fieldOptions) && - Objects.equals(this.forceSignerPage, unclaimedDraftCreateEmbeddedRequest.forceSignerPage) && - Objects.equals(this.forceSubjectMessage, unclaimedDraftCreateEmbeddedRequest.forceSubjectMessage) && - Objects.equals(this.formFieldGroups, unclaimedDraftCreateEmbeddedRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, unclaimedDraftCreateEmbeddedRequest.formFieldRules) && - Objects.equals(this.formFieldsPerDocument, unclaimedDraftCreateEmbeddedRequest.formFieldsPerDocument) && - Objects.equals(this.hideTextTags, unclaimedDraftCreateEmbeddedRequest.hideTextTags) && - Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedRequest.holdRequest) && - Objects.equals(this.isForEmbeddedSigning, unclaimedDraftCreateEmbeddedRequest.isForEmbeddedSigning) && - Objects.equals(this.message, unclaimedDraftCreateEmbeddedRequest.message) && - Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedRequest.metadata) && - Objects.equals(this.requestingRedirectUrl, unclaimedDraftCreateEmbeddedRequest.requestingRedirectUrl) && - Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedRequest.showPreview) && - Objects.equals(this.showProgressStepper, unclaimedDraftCreateEmbeddedRequest.showProgressStepper) && - Objects.equals(this.signers, unclaimedDraftCreateEmbeddedRequest.signers) && - Objects.equals(this.signingOptions, unclaimedDraftCreateEmbeddedRequest.signingOptions) && - Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateEmbeddedRequest.signingRedirectUrl) && - Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedRequest.skipMeNow) && - Objects.equals(this.subject, unclaimedDraftCreateEmbeddedRequest.subject) && - Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedRequest.testMode) && - Objects.equals(this.type, unclaimedDraftCreateEmbeddedRequest.type) && - Objects.equals(this.usePreexistingFields, unclaimedDraftCreateEmbeddedRequest.usePreexistingFields) && - Objects.equals(this.useTextTags, unclaimedDraftCreateEmbeddedRequest.useTextTags) && - Objects.equals(this.populateAutoFillFields, unclaimedDraftCreateEmbeddedRequest.populateAutoFillFields) && - Objects.equals(this.expiresAt, unclaimedDraftCreateEmbeddedRequest.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, requesterEmailAddress, files, fileUrls, allowCcs, allowDecline, allowReassign, attachments, ccEmailAddresses, customFields, editorOptions, fieldOptions, forceSignerPage, forceSubjectMessage, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, holdRequest, isForEmbeddedSigning, message, metadata, requestingRedirectUrl, showPreview, showProgressStepper, signers, signingOptions, signingRedirectUrl, skipMeNow, subject, testMode, type, usePreexistingFields, useTextTags, populateAutoFillFields, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateEmbeddedRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" forceSignerPage: ").append(toIndentedString(forceSignerPage)).append("\n"); - sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); - sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; + public UnclaimedDraftCreateEmbeddedRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); } + this.attachments.add(attachmentsItem); + return this; + } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - if (requesterEmailAddress.getClass().equals(java.io.File.class) || - requesterEmailAddress.getClass().equals(Integer.class) || - requesterEmailAddress.getClass().equals(String.class) || - requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for(int i = 0; i< getListSize(requesterEmailAddress); i++) { - map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); - } - } - else { - map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); - } + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + public UnclaimedDraftCreateEmbeddedRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + public UnclaimedDraftCreateEmbeddedRequest addCcEmailAddressesItem( + String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - if (allowCcs.getClass().equals(java.io.File.class) || - allowCcs.getClass().equals(Integer.class) || - allowCcs.getClass().equals(String.class) || - allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for(int i = 0; i< getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } - else { - map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); - } + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + public UnclaimedDraftCreateEmbeddedRequest customFields(List customFields) { + this.customFields = customFields; + return this; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + public UnclaimedDraftCreateEmbeddedRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - if (editorOptions.getClass().equals(java.io.File.class) || - editorOptions.getClass().equals(Integer.class) || - editorOptions.getClass().equals(String.class) || - editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for(int i = 0; i< getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } - else { - map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } + public UnclaimedDraftCreateEmbeddedRequest editorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorOptions getEditorOptions() { + return editorOptions; } - if (forceSignerPage != null) { - if (isFileTypeOrListOfFiles(forceSignerPage)) { - fileTypeFound = true; - } - if (forceSignerPage.getClass().equals(java.io.File.class) || - forceSignerPage.getClass().equals(Integer.class) || - forceSignerPage.getClass().equals(String.class) || - forceSignerPage.getClass().isEnum()) { - map.put("force_signer_page", forceSignerPage); - } else if (isListOfFile(forceSignerPage)) { - for(int i = 0; i< getListSize(forceSignerPage); i++) { - map.put("force_signer_page[" + i + "]", getFromList(forceSignerPage, i)); - } - } - else { - map.put("force_signer_page", JSON.getDefault().getMapper().writeValueAsString(forceSignerPage)); - } + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - if (forceSubjectMessage.getClass().equals(java.io.File.class) || - forceSubjectMessage.getClass().equals(Integer.class) || - forceSubjectMessage.getClass().equals(String.class) || - forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for(int i = 0; i< getListSize(forceSubjectMessage); i++) { - map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); - } - } - else { - map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } + public UnclaimedDraftCreateEmbeddedRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); - } + public UnclaimedDraftCreateEmbeddedRequest forceSignerPage(Boolean forceSignerPage) { + this.forceSignerPage = forceSignerPage; + return this; } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - if (hideTextTags.getClass().equals(java.io.File.class) || - hideTextTags.getClass().equals(Integer.class) || - hideTextTags.getClass().equals(String.class) || - hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for(int i = 0; i< getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } - else { - map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } + /** + * Provide users the ability to review/edit the signers. + * + * @return forceSignerPage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSignerPage() { + return forceSignerPage; } - if (holdRequest != null) { - if (isFileTypeOrListOfFiles(holdRequest)) { - fileTypeFound = true; - } - if (holdRequest.getClass().equals(java.io.File.class) || - holdRequest.getClass().equals(Integer.class) || - holdRequest.getClass().equals(String.class) || - holdRequest.getClass().isEnum()) { - map.put("hold_request", holdRequest); - } else if (isListOfFile(holdRequest)) { - for(int i = 0; i< getListSize(holdRequest); i++) { - map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); - } - } - else { - map.put("hold_request", JSON.getDefault().getMapper().writeValueAsString(holdRequest)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerPage(Boolean forceSignerPage) { + this.forceSignerPage = forceSignerPage; } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || - isForEmbeddedSigning.getClass().equals(Integer.class) || - isForEmbeddedSigning.getClass().equals(String.class) || - isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { - map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); - } - } - else { - map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } + public UnclaimedDraftCreateEmbeddedRequest forceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + /** + * Provide users the ability to review/edit the subject and message. + * + * @return forceSubjectMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - if (requestingRedirectUrl.getClass().equals(java.io.File.class) || - requestingRedirectUrl.getClass().equals(Integer.class) || - requestingRedirectUrl.getClass().equals(String.class) || - requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { - map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); - } - } - else { - map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); - } + public UnclaimedDraftCreateEmbeddedRequest formFieldGroups( + List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - if (showPreview.getClass().equals(java.io.File.class) || - showPreview.getClass().equals(Integer.class) || - showPreview.getClass().equals(String.class) || - showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for(int i = 0; i< getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } - else { - map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); + public UnclaimedDraftCreateEmbeddedRequest addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + public UnclaimedDraftCreateEmbeddedRequest formFieldRules( + List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + public UnclaimedDraftCreateEmbeddedRequest addFormFieldRulesItem( + SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - if (skipMeNow.getClass().equals(java.io.File.class) || - skipMeNow.getClass().equals(Integer.class) || - skipMeNow.getClass().equals(String.class) || - skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for(int i = 0; i< getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } - else { - map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + public UnclaimedDraftCreateEmbeddedRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; } - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + public UnclaimedDraftCreateEmbeddedRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - if (usePreexistingFields.getClass().equals(java.io.File.class) || - usePreexistingFields.getClass().equals(Integer.class) || - usePreexistingFields.getClass().equals(String.class) || - usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for(int i = 0; i< getListSize(usePreexistingFields); i++) { - map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); - } - } - else { - map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - if (useTextTags.getClass().equals(java.io.File.class) || - useTextTags.getClass().equals(Integer.class) || - useTextTags.getClass().equals(String.class) || - useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for(int i = 0; i< getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } - else { - map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - if (populateAutoFillFields.getClass().equals(java.io.File.class) || - populateAutoFillFields.getClass().equals(Integer.class) || - populateAutoFillFields.getClass().equals(String.class) || - populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for(int i = 0; i< getListSize(populateAutoFillFields); i++) { - map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); - } - } - else { - map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); - } + public UnclaimedDraftCreateEmbeddedRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; + } + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + public UnclaimedDraftCreateEmbeddedRequest holdRequest(Boolean holdRequest) { + this.holdRequest = 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 @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHoldRequest() { + return holdRequest; + } + + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHoldRequest(Boolean holdRequest) { + this.holdRequest = holdRequest; + } + + public UnclaimedDraftCreateEmbeddedRequest isForEmbeddedSigning(Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + 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 @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; + } + + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + } + + public UnclaimedDraftCreateEmbeddedRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public UnclaimedDraftCreateEmbeddedRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public UnclaimedDraftCreateEmbeddedRequest requestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + public UnclaimedDraftCreateEmbeddedRequest showPreview(Boolean showPreview) { + this.showPreview = 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 @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowPreview() { + return showPreview; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(Boolean showPreview) { + this.showPreview = showPreview; + } + + public UnclaimedDraftCreateEmbeddedRequest showProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public UnclaimedDraftCreateEmbeddedRequest signers(List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateEmbeddedRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Unclaimed Draft Signature Request. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + public UnclaimedDraftCreateEmbeddedRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public UnclaimedDraftCreateEmbeddedRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public UnclaimedDraftCreateEmbeddedRequest skipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipMeNow() { + return skipMeNow; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; } - return o.toString().replace("\n", "\n "); - } -} + public UnclaimedDraftCreateEmbeddedRequest subject(String subject) { + this.subject = subject; + return this; + } + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public UnclaimedDraftCreateEmbeddedRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public UnclaimedDraftCreateEmbeddedRequest type(TypeEnum type) { + this.type = 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 @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + public UnclaimedDraftCreateEmbeddedRequest usePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + 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 @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + public UnclaimedDraftCreateEmbeddedRequest useTextTags(Boolean useTextTags) { + this.useTextTags = 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 @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + public UnclaimedDraftCreateEmbeddedRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = 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 @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + public UnclaimedDraftCreateEmbeddedRequest expiresAt(Integer expiresAt) { + this.expiresAt = 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this UnclaimedDraftCreateEmbeddedRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest = + (UnclaimedDraftCreateEmbeddedRequest) o; + return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedRequest.clientId) + && Objects.equals( + this.requesterEmailAddress, + unclaimedDraftCreateEmbeddedRequest.requesterEmailAddress) + && Objects.equals(this.files, unclaimedDraftCreateEmbeddedRequest.files) + && Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedRequest.fileUrls) + && Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedRequest.allowCcs) + && Objects.equals( + this.allowDecline, unclaimedDraftCreateEmbeddedRequest.allowDecline) + && Objects.equals( + this.allowReassign, unclaimedDraftCreateEmbeddedRequest.allowReassign) + && Objects.equals(this.attachments, unclaimedDraftCreateEmbeddedRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, unclaimedDraftCreateEmbeddedRequest.ccEmailAddresses) + && Objects.equals( + this.customFields, unclaimedDraftCreateEmbeddedRequest.customFields) + && Objects.equals( + this.editorOptions, unclaimedDraftCreateEmbeddedRequest.editorOptions) + && Objects.equals( + this.fieldOptions, unclaimedDraftCreateEmbeddedRequest.fieldOptions) + && Objects.equals( + this.forceSignerPage, unclaimedDraftCreateEmbeddedRequest.forceSignerPage) + && Objects.equals( + this.forceSubjectMessage, + unclaimedDraftCreateEmbeddedRequest.forceSubjectMessage) + && Objects.equals( + this.formFieldGroups, unclaimedDraftCreateEmbeddedRequest.formFieldGroups) + && Objects.equals( + this.formFieldRules, unclaimedDraftCreateEmbeddedRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + unclaimedDraftCreateEmbeddedRequest.formFieldsPerDocument) + && Objects.equals( + this.hideTextTags, unclaimedDraftCreateEmbeddedRequest.hideTextTags) + && Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedRequest.holdRequest) + && Objects.equals( + this.isForEmbeddedSigning, + unclaimedDraftCreateEmbeddedRequest.isForEmbeddedSigning) + && Objects.equals(this.message, unclaimedDraftCreateEmbeddedRequest.message) + && Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedRequest.metadata) + && Objects.equals( + this.requestingRedirectUrl, + unclaimedDraftCreateEmbeddedRequest.requestingRedirectUrl) + && Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedRequest.showPreview) + && Objects.equals( + this.showProgressStepper, + unclaimedDraftCreateEmbeddedRequest.showProgressStepper) + && Objects.equals(this.signers, unclaimedDraftCreateEmbeddedRequest.signers) + && Objects.equals( + this.signingOptions, unclaimedDraftCreateEmbeddedRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, + unclaimedDraftCreateEmbeddedRequest.signingRedirectUrl) + && Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedRequest.skipMeNow) + && Objects.equals(this.subject, unclaimedDraftCreateEmbeddedRequest.subject) + && Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedRequest.testMode) + && Objects.equals(this.type, unclaimedDraftCreateEmbeddedRequest.type) + && Objects.equals( + this.usePreexistingFields, + unclaimedDraftCreateEmbeddedRequest.usePreexistingFields) + && Objects.equals(this.useTextTags, unclaimedDraftCreateEmbeddedRequest.useTextTags) + && Objects.equals( + this.populateAutoFillFields, + unclaimedDraftCreateEmbeddedRequest.populateAutoFillFields) + && Objects.equals(this.expiresAt, unclaimedDraftCreateEmbeddedRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + requesterEmailAddress, + files, + fileUrls, + allowCcs, + allowDecline, + allowReassign, + attachments, + ccEmailAddresses, + customFields, + editorOptions, + fieldOptions, + forceSignerPage, + forceSubjectMessage, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + holdRequest, + isForEmbeddedSigning, + message, + metadata, + requestingRedirectUrl, + showPreview, + showProgressStepper, + signers, + signingOptions, + signingRedirectUrl, + skipMeNow, + subject, + testMode, + type, + usePreexistingFields, + useTextTags, + populateAutoFillFields, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateEmbeddedRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" requesterEmailAddress: ") + .append(toIndentedString(requesterEmailAddress)) + .append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" forceSignerPage: ").append(toIndentedString(forceSignerPage)).append("\n"); + sb.append(" forceSubjectMessage: ") + .append(toIndentedString(forceSubjectMessage)) + .append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); + sb.append(" isForEmbeddedSigning: ") + .append(toIndentedString(isForEmbeddedSigning)) + .append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" requestingRedirectUrl: ") + .append(toIndentedString(requestingRedirectUrl)) + .append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" usePreexistingFields: ") + .append(toIndentedString(usePreexistingFields)) + .append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } + + if (requesterEmailAddress.getClass().equals(java.io.File.class) + || requesterEmailAddress.getClass().equals(Integer.class) + || requesterEmailAddress.getClass().equals(String.class) + || requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for (int i = 0; i < getListSize(requesterEmailAddress); i++) { + map.put( + "requester_email_address[" + i + "]", + getFromList(requesterEmailAddress, i)); + } + } else { + map.put( + "requester_email_address", + JSON.getDefault() + .getMapper() + .writeValueAsString(requesterEmailAddress)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } + + if (allowCcs.getClass().equals(java.io.File.class) + || allowCcs.getClass().equals(Integer.class) + || allowCcs.getClass().equals(String.class) + || allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for (int i = 0; i < getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } else { + map.put( + "allow_ccs", + JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (forceSignerPage != null) { + if (isFileTypeOrListOfFiles(forceSignerPage)) { + fileTypeFound = true; + } + + if (forceSignerPage.getClass().equals(java.io.File.class) + || forceSignerPage.getClass().equals(Integer.class) + || forceSignerPage.getClass().equals(String.class) + || forceSignerPage.getClass().isEnum()) { + map.put("force_signer_page", forceSignerPage); + } else if (isListOfFile(forceSignerPage)) { + for (int i = 0; i < getListSize(forceSignerPage); i++) { + map.put("force_signer_page[" + i + "]", getFromList(forceSignerPage, i)); + } + } else { + map.put( + "force_signer_page", + JSON.getDefault().getMapper().writeValueAsString(forceSignerPage)); + } + } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } + + if (forceSubjectMessage.getClass().equals(java.io.File.class) + || forceSubjectMessage.getClass().equals(Integer.class) + || forceSubjectMessage.getClass().equals(String.class) + || forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for (int i = 0; i < getListSize(forceSubjectMessage); i++) { + map.put( + "force_subject_message[" + i + "]", + getFromList(forceSubjectMessage, i)); + } + } else { + map.put( + "force_subject_message", + JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (holdRequest != null) { + if (isFileTypeOrListOfFiles(holdRequest)) { + fileTypeFound = true; + } + + if (holdRequest.getClass().equals(java.io.File.class) + || holdRequest.getClass().equals(Integer.class) + || holdRequest.getClass().equals(String.class) + || holdRequest.getClass().isEnum()) { + map.put("hold_request", holdRequest); + } else if (isListOfFile(holdRequest)) { + for (int i = 0; i < getListSize(holdRequest); i++) { + map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); + } + } else { + map.put( + "hold_request", + JSON.getDefault().getMapper().writeValueAsString(holdRequest)); + } + } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } + + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) + || isForEmbeddedSigning.getClass().equals(Integer.class) + || isForEmbeddedSigning.getClass().equals(String.class) + || isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { + map.put( + "is_for_embedded_signing[" + i + "]", + getFromList(isForEmbeddedSigning, i)); + } + } else { + map.put( + "is_for_embedded_signing", + JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } + + if (requestingRedirectUrl.getClass().equals(java.io.File.class) + || requestingRedirectUrl.getClass().equals(Integer.class) + || requestingRedirectUrl.getClass().equals(String.class) + || requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { + map.put( + "requesting_redirect_url[" + i + "]", + getFromList(requestingRedirectUrl, i)); + } + } else { + map.put( + "requesting_redirect_url", + JSON.getDefault() + .getMapper() + .writeValueAsString(requestingRedirectUrl)); + } + } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } + + if (showPreview.getClass().equals(java.io.File.class) + || showPreview.getClass().equals(Integer.class) + || showPreview.getClass().equals(String.class) + || showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for (int i = 0; i < getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } else { + map.put( + "show_preview", + JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } + + if (skipMeNow.getClass().equals(java.io.File.class) + || skipMeNow.getClass().equals(Integer.class) + || skipMeNow.getClass().equals(String.class) + || skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for (int i = 0; i < getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } else { + map.put( + "skip_me_now", + JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } + + if (usePreexistingFields.getClass().equals(java.io.File.class) + || usePreexistingFields.getClass().equals(Integer.class) + || usePreexistingFields.getClass().equals(String.class) + || usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for (int i = 0; i < getListSize(usePreexistingFields); i++) { + map.put( + "use_preexisting_fields[" + i + "]", + getFromList(usePreexistingFields, i)); + } + } else { + map.put( + "use_preexisting_fields", + JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java index 29202b7..8310985 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.java @@ -10,1686 +10,1770 @@ * 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.SubCC; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubEditorOptions; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubSigningOptions; -import com.dropbox.sign.model.SubUnclaimedDraftTemplateSigner; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * UnclaimedDraftCreateEmbeddedWithTemplateRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class UnclaimedDraftCreateEmbeddedWithTemplateRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - private String requesterEmailAddress; + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + private String requesterEmailAddress; - public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; - private List templateIds = new ArrayList<>(); + public static final String JSON_PROPERTY_TEMPLATE_IDS = "template_ids"; + private List templateIds = new ArrayList<>(); - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; + private Boolean allowDecline = false; - public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; - private Boolean allowReassign = false; + public static final String JSON_PROPERTY_ALLOW_REASSIGN = "allow_reassign"; + private Boolean allowReassign = false; - public static final String JSON_PROPERTY_CCS = "ccs"; - private List ccs = null; + public static final String JSON_PROPERTY_CCS = "ccs"; + private List ccs = null; - public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; - private List customFields = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - private SubEditorOptions editorOptions; + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + private SubEditorOptions editorOptions; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; + private SubFieldOptions fieldOptions; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; - private Boolean forceSignerRoles = false; + public static final String JSON_PROPERTY_FORCE_SIGNER_ROLES = "force_signer_roles"; + private Boolean forceSignerRoles = false; - public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; - private Boolean forceSubjectMessage = false; + public static final String JSON_PROPERTY_FORCE_SUBJECT_MESSAGE = "force_subject_message"; + private Boolean forceSubjectMessage = false; - public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; - private Boolean holdRequest = false; + public static final String JSON_PROPERTY_HOLD_REQUEST = "hold_request"; + private Boolean holdRequest = false; - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - private Boolean isForEmbeddedSigning = false; + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + private Boolean isForEmbeddedSigning = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + private Map metadata = null; - public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; - private Boolean previewOnly = false; + public static final String JSON_PROPERTY_PREVIEW_ONLY = "preview_only"; + private Boolean previewOnly = false; - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - private String requestingRedirectUrl; + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + private String requestingRedirectUrl; - public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; - private Boolean showPreview = false; + public static final String JSON_PROPERTY_SHOW_PREVIEW = "show_preview"; + private Boolean showPreview = false; - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - private Boolean showProgressStepper = true; + 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 = null; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; - private Boolean skipMeNow = false; + public static final String JSON_PROPERTY_SKIP_ME_NOW = "skip_me_now"; + private Boolean skipMeNow = false; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; - public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = "populate_auto_fill_fields"; - private Boolean populateAutoFillFields = false; + public static final String JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS = + "populate_auto_fill_fields"; + private Boolean populateAutoFillFields = false; - public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; - private Boolean allowCcs = false; + public static final String JSON_PROPERTY_ALLOW_CCS = "allow_ccs"; + private Boolean allowCcs = false; - public UnclaimedDraftCreateEmbeddedWithTemplateRequest() { - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftCreateEmbeddedWithTemplateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftCreateEmbeddedWithTemplateRequest init(String jsonData) + throws Exception { + return new ObjectMapper() + .readValue(jsonData, UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); + } - static public UnclaimedDraftCreateEmbeddedWithTemplateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateEmbeddedWithTemplateRequest.class - ); - } + public static UnclaimedDraftCreateEmbeddedWithTemplateRequest init(HashMap data) + throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateEmbeddedWithTemplateRequest.class); + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(String clientId) { - this.clientId = clientId; - return this; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest clientId(String clientId) { + this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; + } - public String getClientId() { - return clientId; - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; + } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress( + String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + return this; + } - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } + /** + * The email address of the user that should be designated as the requester of this draft. + * + * @return requesterEmailAddress + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRequesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest requesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - return this; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest templateIds(List templateIds) { + this.templateIds = templateIds; + return this; + } - /** - * The email address of the user that should be designated as the requester of this draft. - * @return requesterEmailAddress - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addTemplateIdsItem( + String templateIdsItem) { + if (this.templateIds == null) { + this.templateIds = new ArrayList<>(); + } + this.templateIds.add(templateIdsItem); + return this; + } - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTemplateIds() { + return templateIds; + } + @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTemplateIds(List templateIds) { + this.templateIds = templateIds; + } - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setRequesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest templateIds(List templateIds) { - this.templateIds = templateIds; - return this; - } - - 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 - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getTemplateIds() { - return templateIds; - } - - - @JsonProperty(JSON_PROPERTY_TEMPLATE_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTemplateIds(List templateIds) { - this.templateIds = templateIds; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(Boolean allowReassign) { - this.allowReassign = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowReassign() { - return allowReassign; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowReassign(Boolean allowReassign) { - this.allowReassign = allowReassign; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest ccs(List ccs) { - this.ccs = ccs; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { - if (this.ccs == null) { - this.ccs = new ArrayList<>(); + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; } - this.ccs.add(ccsItem); - return this; - } - - /** - * Add CC email recipients. Required when a CC role exists for the Template. - * @return ccs - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcs() { - return ccs; - } - - - @JsonProperty(JSON_PROPERTY_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcs(List ccs) { - this.ccs = ccs; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * @return editorOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest files(List files) { - this.files = files; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + return this; } - this.files.add(filesItem); - 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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); + + /** + * 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 @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowReassign() { + return allowReassign; } - this.fileUrls.add(fileUrlsItem); - 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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - return this; - } - - /** - * Provide users the ability to review/edit the template signer roles. - * @return forceSignerRoles - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSignerRoles() { - return forceSignerRoles; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSignerRoles(Boolean forceSignerRoles) { - this.forceSignerRoles = forceSignerRoles; - } + @JsonProperty(JSON_PROPERTY_ALLOW_REASSIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowReassign(Boolean allowReassign) { + this.allowReassign = allowReassign; + } - public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - return this; - } - - /** - * Provide users the ability to review/edit the template subject and message. - * @return forceSubjectMessage - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getForceSubjectMessage() { - return forceSubjectMessage; - } - - - @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setForceSubjectMessage(Boolean forceSubjectMessage) { - this.forceSubjectMessage = forceSubjectMessage; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(Boolean holdRequest) { - this.holdRequest = holdRequest; - 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 - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHoldRequest() { - return holdRequest; - } - - - @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHoldRequest(Boolean holdRequest) { - this.holdRequest = holdRequest; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - 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 - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UnclaimedDraftCreateEmbeddedWithTemplateRequest ccs(List ccs) { + this.ccs = ccs; + return this; + } - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCcsItem(SubCC ccsItem) { + if (this.ccs == null) { + this.ccs = new ArrayList<>(); + } + this.ccs.add(ccsItem); + return this; + } - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); - } - this.metadata.put(key, metadataItem); - return this; - } + /** + * Add CC email recipients. Required when a CC role exists for the Template. + * + * @return ccs + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcs() { + return ccs; + } - /** - * 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(Boolean previewOnly) { - this.previewOnly = previewOnly; - return this; - } + @JsonProperty(JSON_PROPERTY_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcs(List ccs) { + this.ccs = ccs; + } - /** - * 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 - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPreviewOnly() { - return previewOnly; - } - - - @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPreviewOnly(Boolean previewOnly) { - this.previewOnly = previewOnly; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(Boolean showPreview) { - this.showPreview = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowPreview() { - return showPreview; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowPreview(Boolean showPreview) { - this.showPreview = showPreview; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UnclaimedDraftCreateEmbeddedWithTemplateRequest customFields( + List customFields) { + this.customFields = customFields; + return this; + } - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signers(List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem(SubUnclaimedDraftTemplateSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); - } - this.signers.add(signersItem); - return this; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addCustomFieldsItem( + SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); + } + this.customFields.add(customFieldsItem); + return this; + } - /** - * Add Signers to your Templated-based Signature Request. - * @return signers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; + } - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; + } - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - return this; - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest editorOptions( + SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + 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 - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getSkipMeNow() { - return skipMeNow; - } - - - @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSkipMeNow(Boolean skipMeNow) { - this.skipMeNow = skipMeNow; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(String subject) { - this.subject = subject; - return this; - } - - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(String title) { - this.title = title; - return this; - } - - /** - * The title you want to assign to the SignatureRequest. - * @return title - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getTitle() { - return title; - } - - - @JsonProperty(JSON_PROPERTY_TITLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTitle(String title) { - this.title = title; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = 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 - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPopulateAutoFillFields() { - return populateAutoFillFields; - } - - - @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { - this.populateAutoFillFields = populateAutoFillFields; - } - - - public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(Boolean allowCcs) { - this.allowCcs = 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 - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowCcs() { - return allowCcs; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_CCS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowCcs(Boolean allowCcs) { - this.allowCcs = allowCcs; - } - - - /** - * Return true if this UnclaimedDraftCreateEmbeddedWithTemplateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest = (UnclaimedDraftCreateEmbeddedWithTemplateRequest) o; - return Objects.equals(this.clientId, unclaimedDraftCreateEmbeddedWithTemplateRequest.clientId) && - Objects.equals(this.requesterEmailAddress, unclaimedDraftCreateEmbeddedWithTemplateRequest.requesterEmailAddress) && - Objects.equals(this.templateIds, unclaimedDraftCreateEmbeddedWithTemplateRequest.templateIds) && - Objects.equals(this.allowDecline, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowDecline) && - Objects.equals(this.allowReassign, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowReassign) && - Objects.equals(this.ccs, unclaimedDraftCreateEmbeddedWithTemplateRequest.ccs) && - Objects.equals(this.customFields, unclaimedDraftCreateEmbeddedWithTemplateRequest.customFields) && - Objects.equals(this.editorOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.editorOptions) && - Objects.equals(this.fieldOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.fieldOptions) && - Objects.equals(this.files, unclaimedDraftCreateEmbeddedWithTemplateRequest.files) && - Objects.equals(this.fileUrls, unclaimedDraftCreateEmbeddedWithTemplateRequest.fileUrls) && - Objects.equals(this.forceSignerRoles, unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSignerRoles) && - Objects.equals(this.forceSubjectMessage, unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSubjectMessage) && - Objects.equals(this.holdRequest, unclaimedDraftCreateEmbeddedWithTemplateRequest.holdRequest) && - Objects.equals(this.isForEmbeddedSigning, unclaimedDraftCreateEmbeddedWithTemplateRequest.isForEmbeddedSigning) && - Objects.equals(this.message, unclaimedDraftCreateEmbeddedWithTemplateRequest.message) && - Objects.equals(this.metadata, unclaimedDraftCreateEmbeddedWithTemplateRequest.metadata) && - Objects.equals(this.previewOnly, unclaimedDraftCreateEmbeddedWithTemplateRequest.previewOnly) && - Objects.equals(this.requestingRedirectUrl, unclaimedDraftCreateEmbeddedWithTemplateRequest.requestingRedirectUrl) && - Objects.equals(this.showPreview, unclaimedDraftCreateEmbeddedWithTemplateRequest.showPreview) && - Objects.equals(this.showProgressStepper, unclaimedDraftCreateEmbeddedWithTemplateRequest.showProgressStepper) && - Objects.equals(this.signers, unclaimedDraftCreateEmbeddedWithTemplateRequest.signers) && - Objects.equals(this.signingOptions, unclaimedDraftCreateEmbeddedWithTemplateRequest.signingOptions) && - Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateEmbeddedWithTemplateRequest.signingRedirectUrl) && - Objects.equals(this.skipMeNow, unclaimedDraftCreateEmbeddedWithTemplateRequest.skipMeNow) && - Objects.equals(this.subject, unclaimedDraftCreateEmbeddedWithTemplateRequest.subject) && - Objects.equals(this.testMode, unclaimedDraftCreateEmbeddedWithTemplateRequest.testMode) && - Objects.equals(this.title, unclaimedDraftCreateEmbeddedWithTemplateRequest.title) && - Objects.equals(this.populateAutoFillFields, unclaimedDraftCreateEmbeddedWithTemplateRequest.populateAutoFillFields) && - Objects.equals(this.allowCcs, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowCcs); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, requesterEmailAddress, templateIds, allowDecline, allowReassign, ccs, customFields, editorOptions, fieldOptions, files, fileUrls, forceSignerRoles, forceSubjectMessage, holdRequest, isForEmbeddedSigning, message, metadata, previewOnly, requestingRedirectUrl, showPreview, showProgressStepper, signers, signingOptions, signingRedirectUrl, skipMeNow, subject, testMode, title, populateAutoFillFields, allowCcs); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateEmbeddedWithTemplateRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); - sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); - sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); - sb.append(" forceSubjectMessage: ").append(toIndentedString(forceSubjectMessage)).append("\n"); - sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); - sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); - sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); - sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" populateAutoFillFields: ").append(toIndentedString(populateAutoFillFields)).append("\n"); - sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorOptions getEditorOptions() { + return editorOptions; + } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - if (requesterEmailAddress.getClass().equals(java.io.File.class) || - requesterEmailAddress.getClass().equals(Integer.class) || - requesterEmailAddress.getClass().equals(String.class) || - requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for(int i = 0; i< getListSize(requesterEmailAddress); i++) { - map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); - } - } - else { - map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest fieldOptions( + SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (templateIds != null) { - if (isFileTypeOrListOfFiles(templateIds)) { - fileTypeFound = true; - } - if (templateIds.getClass().equals(java.io.File.class) || - templateIds.getClass().equals(Integer.class) || - templateIds.getClass().equals(String.class) || - templateIds.getClass().isEnum()) { - map.put("template_ids", templateIds); - } else if (isListOfFile(templateIds)) { - for(int i = 0; i< getListSize(templateIds); i++) { - map.put("template_ids[" + i + "]", getFromList(templateIds, i)); - } - } - else { - map.put("template_ids", JSON.getDefault().getMapper().writeValueAsString(templateIds)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (allowReassign != null) { - if (isFileTypeOrListOfFiles(allowReassign)) { - fileTypeFound = true; - } - if (allowReassign.getClass().equals(java.io.File.class) || - allowReassign.getClass().equals(Integer.class) || - allowReassign.getClass().equals(String.class) || - allowReassign.getClass().isEnum()) { - map.put("allow_reassign", allowReassign); - } else if (isListOfFile(allowReassign)) { - for(int i = 0; i< getListSize(allowReassign); i++) { - map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); - } - } - else { - map.put("allow_reassign", JSON.getDefault().getMapper().writeValueAsString(allowReassign)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest files(List files) { + this.files = files; + return this; } - if (ccs != null) { - if (isFileTypeOrListOfFiles(ccs)) { - fileTypeFound = true; - } - if (ccs.getClass().equals(java.io.File.class) || - ccs.getClass().equals(Integer.class) || - ccs.getClass().equals(String.class) || - ccs.getClass().isEnum()) { - map.put("ccs", ccs); - } else if (isListOfFile(ccs)) { - for(int i = 0; i< getListSize(ccs); i++) { - map.put("ccs[" + i + "]", getFromList(ccs, i)); - } - } - else { - map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } + this.files.add(filesItem); + return this; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - if (editorOptions.getClass().equals(java.io.File.class) || - editorOptions.getClass().equals(Integer.class) || - editorOptions.getClass().equals(String.class) || - editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for(int i = 0; i< getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } - else { - map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); } + this.fileUrls.add(fileUrlsItem); + return this; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; } - if (forceSignerRoles != null) { - if (isFileTypeOrListOfFiles(forceSignerRoles)) { - fileTypeFound = true; - } - if (forceSignerRoles.getClass().equals(java.io.File.class) || - forceSignerRoles.getClass().equals(Integer.class) || - forceSignerRoles.getClass().equals(String.class) || - forceSignerRoles.getClass().isEnum()) { - map.put("force_signer_roles", forceSignerRoles); - } else if (isListOfFile(forceSignerRoles)) { - for(int i = 0; i< getListSize(forceSignerRoles); i++) { - map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); - } - } - else { - map.put("force_signer_roles", JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); - } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; } - if (forceSubjectMessage != null) { - if (isFileTypeOrListOfFiles(forceSubjectMessage)) { - fileTypeFound = true; - } - if (forceSubjectMessage.getClass().equals(java.io.File.class) || - forceSubjectMessage.getClass().equals(Integer.class) || - forceSubjectMessage.getClass().equals(String.class) || - forceSubjectMessage.getClass().isEnum()) { - map.put("force_subject_message", forceSubjectMessage); - } else if (isListOfFile(forceSubjectMessage)) { - for(int i = 0; i< getListSize(forceSubjectMessage); i++) { - map.put("force_subject_message[" + i + "]", getFromList(forceSubjectMessage, i)); - } - } - else { - map.put("force_subject_message", JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSignerRoles( + Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; + return this; } - if (holdRequest != null) { - if (isFileTypeOrListOfFiles(holdRequest)) { - fileTypeFound = true; - } - if (holdRequest.getClass().equals(java.io.File.class) || - holdRequest.getClass().equals(Integer.class) || - holdRequest.getClass().equals(String.class) || - holdRequest.getClass().isEnum()) { - map.put("hold_request", holdRequest); - } else if (isListOfFile(holdRequest)) { - for(int i = 0; i< getListSize(holdRequest); i++) { - map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); - } - } - else { - map.put("hold_request", JSON.getDefault().getMapper().writeValueAsString(holdRequest)); - } + /** + * Provide users the ability to review/edit the template signer roles. + * + * @return forceSignerRoles + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSignerRoles() { + return forceSignerRoles; } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || - isForEmbeddedSigning.getClass().equals(Integer.class) || - isForEmbeddedSigning.getClass().equals(String.class) || - isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { - map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); - } - } - else { - map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SIGNER_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSignerRoles(Boolean forceSignerRoles) { + this.forceSignerRoles = forceSignerRoles; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest forceSubjectMessage( + Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; + return this; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + /** + * Provide users the ability to review/edit the template subject and message. + * + * @return forceSubjectMessage + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceSubjectMessage() { + return forceSubjectMessage; } - if (previewOnly != null) { - if (isFileTypeOrListOfFiles(previewOnly)) { - fileTypeFound = true; - } - if (previewOnly.getClass().equals(java.io.File.class) || - previewOnly.getClass().equals(Integer.class) || - previewOnly.getClass().equals(String.class) || - previewOnly.getClass().isEnum()) { - map.put("preview_only", previewOnly); - } else if (isListOfFile(previewOnly)) { - for(int i = 0; i< getListSize(previewOnly); i++) { - map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); - } - } - else { - map.put("preview_only", JSON.getDefault().getMapper().writeValueAsString(previewOnly)); - } + @JsonProperty(JSON_PROPERTY_FORCE_SUBJECT_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForceSubjectMessage(Boolean forceSubjectMessage) { + this.forceSubjectMessage = forceSubjectMessage; } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - if (requestingRedirectUrl.getClass().equals(java.io.File.class) || - requestingRedirectUrl.getClass().equals(Integer.class) || - requestingRedirectUrl.getClass().equals(String.class) || - requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { - map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); - } - } - else { - map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest holdRequest(Boolean holdRequest) { + this.holdRequest = holdRequest; + return this; } - if (showPreview != null) { - if (isFileTypeOrListOfFiles(showPreview)) { - fileTypeFound = true; - } - if (showPreview.getClass().equals(java.io.File.class) || - showPreview.getClass().equals(Integer.class) || - showPreview.getClass().equals(String.class) || - showPreview.getClass().isEnum()) { - map.put("show_preview", showPreview); - } else if (isListOfFile(showPreview)) { - for(int i = 0; i< getListSize(showPreview); i++) { - map.put("show_preview[" + i + "]", getFromList(showPreview, i)); - } - } - else { - map.put("show_preview", JSON.getDefault().getMapper().writeValueAsString(showPreview)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHoldRequest() { + return holdRequest; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } + @JsonProperty(JSON_PROPERTY_HOLD_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHoldRequest(Boolean holdRequest) { + this.holdRequest = holdRequest; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest isForEmbeddedSigning( + Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + return this; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; } - if (skipMeNow != null) { - if (isFileTypeOrListOfFiles(skipMeNow)) { - fileTypeFound = true; - } - if (skipMeNow.getClass().equals(java.io.File.class) || - skipMeNow.getClass().equals(Integer.class) || - skipMeNow.getClass().equals(String.class) || - skipMeNow.getClass().isEnum()) { - map.put("skip_me_now", skipMeNow); - } else if (isListOfFile(skipMeNow)) { - for(int i = 0; i< getListSize(skipMeNow); i++) { - map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); - } - } - else { - map.put("skip_me_now", JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest message(String message) { + this.message = message; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); - } + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; } - if (title != null) { - if (isFileTypeOrListOfFiles(title)) { - fileTypeFound = true; - } - if (title.getClass().equals(java.io.File.class) || - title.getClass().equals(Integer.class) || - title.getClass().equals(String.class) || - title.getClass().isEnum()) { - map.put("title", title); - } else if (isListOfFile(title)) { - for(int i = 0; i< getListSize(title); i++) { - map.put("title[" + i + "]", getFromList(title, i)); - } - } - else { - map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; } - if (populateAutoFillFields != null) { - if (isFileTypeOrListOfFiles(populateAutoFillFields)) { - fileTypeFound = true; - } - if (populateAutoFillFields.getClass().equals(java.io.File.class) || - populateAutoFillFields.getClass().equals(Integer.class) || - populateAutoFillFields.getClass().equals(String.class) || - populateAutoFillFields.getClass().isEnum()) { - map.put("populate_auto_fill_fields", populateAutoFillFields); - } else if (isListOfFile(populateAutoFillFields)) { - for(int i = 0; i< getListSize(populateAutoFillFields); i++) { - map.put("populate_auto_fill_fields[" + i + "]", getFromList(populateAutoFillFields, i)); - } - } - else { - map.put("populate_auto_fill_fields", JSON.getDefault().getMapper().writeValueAsString(populateAutoFillFields)); + public UnclaimedDraftCreateEmbeddedWithTemplateRequest putMetadataItem( + String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } + this.metadata.put(key, metadataItem); + return this; } - if (allowCcs != null) { - if (isFileTypeOrListOfFiles(allowCcs)) { - fileTypeFound = true; - } - if (allowCcs.getClass().equals(java.io.File.class) || - allowCcs.getClass().equals(Integer.class) || - allowCcs.getClass().equals(String.class) || - allowCcs.getClass().isEnum()) { - map.put("allow_ccs", allowCcs); - } else if (isListOfFile(allowCcs)) { - for(int i = 0; i< getListSize(allowCcs); i++) { - map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); - } - } - else { - map.put("allow_ccs", JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + /** + * 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest previewOnly(Boolean previewOnly) { + this.previewOnly = 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). - + * `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 @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPreviewOnly() { + return previewOnly; + } + + @JsonProperty(JSON_PROPERTY_PREVIEW_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreviewOnly(Boolean previewOnly) { + this.previewOnly = previewOnly; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest requestingRedirectUrl( + String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest showPreview(Boolean showPreview) { + this.showPreview = 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 @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowPreview() { + return showPreview; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PREVIEW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowPreview(Boolean showPreview) { + this.showPreview = showPreview; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest showProgressStepper( + Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signers( + List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest addSignersItem( + SubUnclaimedDraftTemplateSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; + } + + /** + * Add Signers to your Templated-based Signature Request. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; + } + + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingOptions( + SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest signingRedirectUrl( + String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public UnclaimedDraftCreateEmbeddedWithTemplateRequest skipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSkipMeNow() { + return skipMeNow; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SKIP_ME_NOW) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipMeNow(Boolean skipMeNow) { + this.skipMeNow = skipMeNow; } - return o.toString().replace("\n", "\n "); - } -} + public UnclaimedDraftCreateEmbeddedWithTemplateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest title(String title) { + this.title = title; + return this; + } + + /** + * The title you want to assign to the SignatureRequest. + * + * @return title + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest populateAutoFillFields( + Boolean populateAutoFillFields) { + this.populateAutoFillFields = 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 @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPopulateAutoFillFields() { + return populateAutoFillFields; + } + + @JsonProperty(JSON_PROPERTY_POPULATE_AUTO_FILL_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPopulateAutoFillFields(Boolean populateAutoFillFields) { + this.populateAutoFillFields = populateAutoFillFields; + } + + public UnclaimedDraftCreateEmbeddedWithTemplateRequest allowCcs(Boolean allowCcs) { + this.allowCcs = 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 @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowCcs() { + return allowCcs; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_CCS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowCcs(Boolean allowCcs) { + this.allowCcs = allowCcs; + } + + /** Return true if this UnclaimedDraftCreateEmbeddedWithTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateEmbeddedWithTemplateRequest + unclaimedDraftCreateEmbeddedWithTemplateRequest = + (UnclaimedDraftCreateEmbeddedWithTemplateRequest) o; + return Objects.equals( + this.clientId, unclaimedDraftCreateEmbeddedWithTemplateRequest.clientId) + && Objects.equals( + this.requesterEmailAddress, + unclaimedDraftCreateEmbeddedWithTemplateRequest.requesterEmailAddress) + && Objects.equals( + this.templateIds, + unclaimedDraftCreateEmbeddedWithTemplateRequest.templateIds) + && Objects.equals( + this.allowDecline, + unclaimedDraftCreateEmbeddedWithTemplateRequest.allowDecline) + && Objects.equals( + this.allowReassign, + unclaimedDraftCreateEmbeddedWithTemplateRequest.allowReassign) + && Objects.equals(this.ccs, unclaimedDraftCreateEmbeddedWithTemplateRequest.ccs) + && Objects.equals( + this.customFields, + unclaimedDraftCreateEmbeddedWithTemplateRequest.customFields) + && Objects.equals( + this.editorOptions, + unclaimedDraftCreateEmbeddedWithTemplateRequest.editorOptions) + && Objects.equals( + this.fieldOptions, + unclaimedDraftCreateEmbeddedWithTemplateRequest.fieldOptions) + && Objects.equals(this.files, unclaimedDraftCreateEmbeddedWithTemplateRequest.files) + && Objects.equals( + this.fileUrls, unclaimedDraftCreateEmbeddedWithTemplateRequest.fileUrls) + && Objects.equals( + this.forceSignerRoles, + unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSignerRoles) + && Objects.equals( + this.forceSubjectMessage, + unclaimedDraftCreateEmbeddedWithTemplateRequest.forceSubjectMessage) + && Objects.equals( + this.holdRequest, + unclaimedDraftCreateEmbeddedWithTemplateRequest.holdRequest) + && Objects.equals( + this.isForEmbeddedSigning, + unclaimedDraftCreateEmbeddedWithTemplateRequest.isForEmbeddedSigning) + && Objects.equals( + this.message, unclaimedDraftCreateEmbeddedWithTemplateRequest.message) + && Objects.equals( + this.metadata, unclaimedDraftCreateEmbeddedWithTemplateRequest.metadata) + && Objects.equals( + this.previewOnly, + unclaimedDraftCreateEmbeddedWithTemplateRequest.previewOnly) + && Objects.equals( + this.requestingRedirectUrl, + unclaimedDraftCreateEmbeddedWithTemplateRequest.requestingRedirectUrl) + && Objects.equals( + this.showPreview, + unclaimedDraftCreateEmbeddedWithTemplateRequest.showPreview) + && Objects.equals( + this.showProgressStepper, + unclaimedDraftCreateEmbeddedWithTemplateRequest.showProgressStepper) + && Objects.equals( + this.signers, unclaimedDraftCreateEmbeddedWithTemplateRequest.signers) + && Objects.equals( + this.signingOptions, + unclaimedDraftCreateEmbeddedWithTemplateRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, + unclaimedDraftCreateEmbeddedWithTemplateRequest.signingRedirectUrl) + && Objects.equals( + this.skipMeNow, unclaimedDraftCreateEmbeddedWithTemplateRequest.skipMeNow) + && Objects.equals( + this.subject, unclaimedDraftCreateEmbeddedWithTemplateRequest.subject) + && Objects.equals( + this.testMode, unclaimedDraftCreateEmbeddedWithTemplateRequest.testMode) + && Objects.equals(this.title, unclaimedDraftCreateEmbeddedWithTemplateRequest.title) + && Objects.equals( + this.populateAutoFillFields, + unclaimedDraftCreateEmbeddedWithTemplateRequest.populateAutoFillFields) + && Objects.equals( + this.allowCcs, unclaimedDraftCreateEmbeddedWithTemplateRequest.allowCcs); + } + + @Override + public int hashCode() { + return Objects.hash( + clientId, + requesterEmailAddress, + templateIds, + allowDecline, + allowReassign, + ccs, + customFields, + editorOptions, + fieldOptions, + files, + fileUrls, + forceSignerRoles, + forceSubjectMessage, + holdRequest, + isForEmbeddedSigning, + message, + metadata, + previewOnly, + requestingRedirectUrl, + showPreview, + showProgressStepper, + signers, + signingOptions, + signingRedirectUrl, + skipMeNow, + subject, + testMode, + title, + populateAutoFillFields, + allowCcs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateEmbeddedWithTemplateRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" requesterEmailAddress: ") + .append(toIndentedString(requesterEmailAddress)) + .append("\n"); + sb.append(" templateIds: ").append(toIndentedString(templateIds)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" allowReassign: ").append(toIndentedString(allowReassign)).append("\n"); + sb.append(" ccs: ").append(toIndentedString(ccs)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" forceSignerRoles: ").append(toIndentedString(forceSignerRoles)).append("\n"); + sb.append(" forceSubjectMessage: ") + .append(toIndentedString(forceSubjectMessage)) + .append("\n"); + sb.append(" holdRequest: ").append(toIndentedString(holdRequest)).append("\n"); + sb.append(" isForEmbeddedSigning: ") + .append(toIndentedString(isForEmbeddedSigning)) + .append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" previewOnly: ").append(toIndentedString(previewOnly)).append("\n"); + sb.append(" requestingRedirectUrl: ") + .append(toIndentedString(requestingRedirectUrl)) + .append("\n"); + sb.append(" showPreview: ").append(toIndentedString(showPreview)).append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" skipMeNow: ").append(toIndentedString(skipMeNow)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" populateAutoFillFields: ") + .append(toIndentedString(populateAutoFillFields)) + .append("\n"); + sb.append(" allowCcs: ").append(toIndentedString(allowCcs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } + + if (requesterEmailAddress.getClass().equals(java.io.File.class) + || requesterEmailAddress.getClass().equals(Integer.class) + || requesterEmailAddress.getClass().equals(String.class) + || requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for (int i = 0; i < getListSize(requesterEmailAddress); i++) { + map.put( + "requester_email_address[" + i + "]", + getFromList(requesterEmailAddress, i)); + } + } else { + map.put( + "requester_email_address", + JSON.getDefault() + .getMapper() + .writeValueAsString(requesterEmailAddress)); + } + } + if (templateIds != null) { + if (isFileTypeOrListOfFiles(templateIds)) { + fileTypeFound = true; + } + + if (templateIds.getClass().equals(java.io.File.class) + || templateIds.getClass().equals(Integer.class) + || templateIds.getClass().equals(String.class) + || templateIds.getClass().isEnum()) { + map.put("template_ids", templateIds); + } else if (isListOfFile(templateIds)) { + for (int i = 0; i < getListSize(templateIds); i++) { + map.put("template_ids[" + i + "]", getFromList(templateIds, i)); + } + } else { + map.put( + "template_ids", + JSON.getDefault().getMapper().writeValueAsString(templateIds)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (allowReassign != null) { + if (isFileTypeOrListOfFiles(allowReassign)) { + fileTypeFound = true; + } + + if (allowReassign.getClass().equals(java.io.File.class) + || allowReassign.getClass().equals(Integer.class) + || allowReassign.getClass().equals(String.class) + || allowReassign.getClass().isEnum()) { + map.put("allow_reassign", allowReassign); + } else if (isListOfFile(allowReassign)) { + for (int i = 0; i < getListSize(allowReassign); i++) { + map.put("allow_reassign[" + i + "]", getFromList(allowReassign, i)); + } + } else { + map.put( + "allow_reassign", + JSON.getDefault().getMapper().writeValueAsString(allowReassign)); + } + } + if (ccs != null) { + if (isFileTypeOrListOfFiles(ccs)) { + fileTypeFound = true; + } + + if (ccs.getClass().equals(java.io.File.class) + || ccs.getClass().equals(Integer.class) + || ccs.getClass().equals(String.class) + || ccs.getClass().isEnum()) { + map.put("ccs", ccs); + } else if (isListOfFile(ccs)) { + for (int i = 0; i < getListSize(ccs); i++) { + map.put("ccs[" + i + "]", getFromList(ccs, i)); + } + } else { + map.put("ccs", JSON.getDefault().getMapper().writeValueAsString(ccs)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (forceSignerRoles != null) { + if (isFileTypeOrListOfFiles(forceSignerRoles)) { + fileTypeFound = true; + } + + if (forceSignerRoles.getClass().equals(java.io.File.class) + || forceSignerRoles.getClass().equals(Integer.class) + || forceSignerRoles.getClass().equals(String.class) + || forceSignerRoles.getClass().isEnum()) { + map.put("force_signer_roles", forceSignerRoles); + } else if (isListOfFile(forceSignerRoles)) { + for (int i = 0; i < getListSize(forceSignerRoles); i++) { + map.put("force_signer_roles[" + i + "]", getFromList(forceSignerRoles, i)); + } + } else { + map.put( + "force_signer_roles", + JSON.getDefault().getMapper().writeValueAsString(forceSignerRoles)); + } + } + if (forceSubjectMessage != null) { + if (isFileTypeOrListOfFiles(forceSubjectMessage)) { + fileTypeFound = true; + } + + if (forceSubjectMessage.getClass().equals(java.io.File.class) + || forceSubjectMessage.getClass().equals(Integer.class) + || forceSubjectMessage.getClass().equals(String.class) + || forceSubjectMessage.getClass().isEnum()) { + map.put("force_subject_message", forceSubjectMessage); + } else if (isListOfFile(forceSubjectMessage)) { + for (int i = 0; i < getListSize(forceSubjectMessage); i++) { + map.put( + "force_subject_message[" + i + "]", + getFromList(forceSubjectMessage, i)); + } + } else { + map.put( + "force_subject_message", + JSON.getDefault().getMapper().writeValueAsString(forceSubjectMessage)); + } + } + if (holdRequest != null) { + if (isFileTypeOrListOfFiles(holdRequest)) { + fileTypeFound = true; + } + + if (holdRequest.getClass().equals(java.io.File.class) + || holdRequest.getClass().equals(Integer.class) + || holdRequest.getClass().equals(String.class) + || holdRequest.getClass().isEnum()) { + map.put("hold_request", holdRequest); + } else if (isListOfFile(holdRequest)) { + for (int i = 0; i < getListSize(holdRequest); i++) { + map.put("hold_request[" + i + "]", getFromList(holdRequest, i)); + } + } else { + map.put( + "hold_request", + JSON.getDefault().getMapper().writeValueAsString(holdRequest)); + } + } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } + + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) + || isForEmbeddedSigning.getClass().equals(Integer.class) + || isForEmbeddedSigning.getClass().equals(String.class) + || isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { + map.put( + "is_for_embedded_signing[" + i + "]", + getFromList(isForEmbeddedSigning, i)); + } + } else { + map.put( + "is_for_embedded_signing", + JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (previewOnly != null) { + if (isFileTypeOrListOfFiles(previewOnly)) { + fileTypeFound = true; + } + + if (previewOnly.getClass().equals(java.io.File.class) + || previewOnly.getClass().equals(Integer.class) + || previewOnly.getClass().equals(String.class) + || previewOnly.getClass().isEnum()) { + map.put("preview_only", previewOnly); + } else if (isListOfFile(previewOnly)) { + for (int i = 0; i < getListSize(previewOnly); i++) { + map.put("preview_only[" + i + "]", getFromList(previewOnly, i)); + } + } else { + map.put( + "preview_only", + JSON.getDefault().getMapper().writeValueAsString(previewOnly)); + } + } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } + + if (requestingRedirectUrl.getClass().equals(java.io.File.class) + || requestingRedirectUrl.getClass().equals(Integer.class) + || requestingRedirectUrl.getClass().equals(String.class) + || requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { + map.put( + "requesting_redirect_url[" + i + "]", + getFromList(requestingRedirectUrl, i)); + } + } else { + map.put( + "requesting_redirect_url", + JSON.getDefault() + .getMapper() + .writeValueAsString(requestingRedirectUrl)); + } + } + if (showPreview != null) { + if (isFileTypeOrListOfFiles(showPreview)) { + fileTypeFound = true; + } + + if (showPreview.getClass().equals(java.io.File.class) + || showPreview.getClass().equals(Integer.class) + || showPreview.getClass().equals(String.class) + || showPreview.getClass().isEnum()) { + map.put("show_preview", showPreview); + } else if (isListOfFile(showPreview)) { + for (int i = 0; i < getListSize(showPreview); i++) { + map.put("show_preview[" + i + "]", getFromList(showPreview, i)); + } + } else { + map.put( + "show_preview", + JSON.getDefault().getMapper().writeValueAsString(showPreview)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (skipMeNow != null) { + if (isFileTypeOrListOfFiles(skipMeNow)) { + fileTypeFound = true; + } + + if (skipMeNow.getClass().equals(java.io.File.class) + || skipMeNow.getClass().equals(Integer.class) + || skipMeNow.getClass().equals(String.class) + || skipMeNow.getClass().isEnum()) { + map.put("skip_me_now", skipMeNow); + } else if (isListOfFile(skipMeNow)) { + for (int i = 0; i < getListSize(skipMeNow); i++) { + map.put("skip_me_now[" + i + "]", getFromList(skipMeNow, i)); + } + } else { + map.put( + "skip_me_now", + JSON.getDefault().getMapper().writeValueAsString(skipMeNow)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (title != null) { + if (isFileTypeOrListOfFiles(title)) { + fileTypeFound = true; + } + + if (title.getClass().equals(java.io.File.class) + || title.getClass().equals(Integer.class) + || title.getClass().equals(String.class) + || title.getClass().isEnum()) { + map.put("title", title); + } else if (isListOfFile(title)) { + for (int i = 0; i < getListSize(title); i++) { + map.put("title[" + i + "]", getFromList(title, i)); + } + } else { + map.put("title", JSON.getDefault().getMapper().writeValueAsString(title)); + } + } + if (populateAutoFillFields != null) { + if (isFileTypeOrListOfFiles(populateAutoFillFields)) { + fileTypeFound = true; + } + + if (populateAutoFillFields.getClass().equals(java.io.File.class) + || populateAutoFillFields.getClass().equals(Integer.class) + || populateAutoFillFields.getClass().equals(String.class) + || populateAutoFillFields.getClass().isEnum()) { + map.put("populate_auto_fill_fields", populateAutoFillFields); + } else if (isListOfFile(populateAutoFillFields)) { + for (int i = 0; i < getListSize(populateAutoFillFields); i++) { + map.put( + "populate_auto_fill_fields[" + i + "]", + getFromList(populateAutoFillFields, i)); + } + } else { + map.put( + "populate_auto_fill_fields", + JSON.getDefault() + .getMapper() + .writeValueAsString(populateAutoFillFields)); + } + } + if (allowCcs != null) { + if (isFileTypeOrListOfFiles(allowCcs)) { + fileTypeFound = true; + } + + if (allowCcs.getClass().equals(java.io.File.class) + || allowCcs.getClass().equals(Integer.class) + || allowCcs.getClass().equals(String.class) + || allowCcs.getClass().isEnum()) { + map.put("allow_ccs", allowCcs); + } else if (isListOfFile(allowCcs)) { + for (int i = 0; i < getListSize(allowCcs); i++) { + map.put("allow_ccs[" + i + "]", getFromList(allowCcs, i)); + } + } else { + map.put( + "allow_ccs", + JSON.getDefault().getMapper().writeValueAsString(allowCcs)); + } + } + } 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/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java index 1aff38f..2c2d0ff 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateRequest.java @@ -10,1447 +10,1488 @@ * 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.SubAttachment; -import com.dropbox.sign.model.SubCustomField; -import com.dropbox.sign.model.SubFieldOptions; -import com.dropbox.sign.model.SubFormFieldGroup; -import com.dropbox.sign.model.SubFormFieldRule; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; -import com.dropbox.sign.model.SubSigningOptions; -import com.dropbox.sign.model.SubUnclaimedDraftSigner; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.ObjectMapper; 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 java.util.Objects; -import com.dropbox.sign.ApiException; -/** - * - */ +/** */ @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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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. - */ - public enum TypeEnum { - SEND_DOCUMENT("send_document"), - - REQUEST_SIGNATURE("request_signature"); + /** + * 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. + */ + public enum TypeEnum { + SEND_DOCUMENT("send_document"), - private String value; + REQUEST_SIGNATURE("request_signature"); - TypeEnum(String value) { - this.value = value; - } + private String value; - @JsonValue - public String getValue() { - return value; - } + TypeEnum(String value) { + this.value = value; + } - @Override - public String toString() { - return String.valueOf(value); - } + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = null; + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; - public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; - private List fileUrls = null; + public static final String JSON_PROPERTY_FILE_URLS = "file_urls"; + private List fileUrls = null; - public static final String JSON_PROPERTY_ALLOW_DECLINE = "allow_decline"; - private Boolean allowDecline = false; + 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 = null; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = null; - public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; - private List ccEmailAddresses = null; + public static final String JSON_PROPERTY_CC_EMAIL_ADDRESSES = "cc_email_addresses"; + private List ccEmailAddresses = null; - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; + 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 = null; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "custom_fields"; + private List customFields = null; - public static final String JSON_PROPERTY_FIELD_OPTIONS = "field_options"; - private SubFieldOptions fieldOptions; + 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 = null; + public static final String JSON_PROPERTY_FORM_FIELD_GROUPS = "form_field_groups"; + private List formFieldGroups = null; - public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; - private List formFieldRules = null; + public static final String JSON_PROPERTY_FORM_FIELD_RULES = "form_field_rules"; + private List formFieldRules = null; - public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; - private List formFieldsPerDocument = null; + public static final String JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT = "form_fields_per_document"; + 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_HIDE_TEXT_TAGS = "hide_text_tags"; + private Boolean hideTextTags = false; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public static final String JSON_PROPERTY_METADATA = "metadata"; - private Map metadata = null; + public static final String JSON_PROPERTY_METADATA = "metadata"; + 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_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + private Boolean showProgressStepper = true; - public static final String JSON_PROPERTY_SIGNERS = "signers"; - private List signers = null; + public static final String JSON_PROPERTY_SIGNERS = "signers"; + private List signers = null; - public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; - private SubSigningOptions signingOptions; + public static final String JSON_PROPERTY_SIGNING_OPTIONS = "signing_options"; + private SubSigningOptions signingOptions; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; - public static final String JSON_PROPERTY_SUBJECT = "subject"; - private String subject; + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; - public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; - private Boolean usePreexistingFields = false; + public static final String JSON_PROPERTY_USE_PREEXISTING_FIELDS = "use_preexisting_fields"; + private Boolean usePreexistingFields = false; - public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; - private Boolean useTextTags = false; + public static final String JSON_PROPERTY_USE_TEXT_TAGS = "use_text_tags"; + private Boolean useTextTags = false; - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; - public UnclaimedDraftCreateRequest() { - } + public UnclaimedDraftCreateRequest() {} - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftCreateRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateRequest.class); - } + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftCreateRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateRequest.class); + } - static public UnclaimedDraftCreateRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateRequest.class - ); - } + public static UnclaimedDraftCreateRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateRequest.class); + } - public UnclaimedDraftCreateRequest type(TypeEnum type) { - this.type = type; - return this; - } + public UnclaimedDraftCreateRequest type(TypeEnum type) { + this.type = 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 - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + /** + * 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 + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TypeEnum getType() { + return type; + } - public TypeEnum getType() { - return type; - } + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(TypeEnum type) { + this.type = type; + } + public UnclaimedDraftCreateRequest files(List files) { + this.files = files; + return this; + } - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(TypeEnum type) { - this.type = type; - } + public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(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 @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } - public UnclaimedDraftCreateRequest files(List files) { - this.files = files; - return this; - } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } - public UnclaimedDraftCreateRequest addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); + public UnclaimedDraftCreateRequest fileUrls(List fileUrls) { + this.fileUrls = fileUrls; + return this; } - this.files.add(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 - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { + if (this.fileUrls == null) { + this.fileUrls = new ArrayList<>(); + } + this.fileUrls.add(fileUrlsItem); + return this; + } - public List getFiles() { - return files; - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFileUrls() { + return fileUrls; + } + @JsonProperty(JSON_PROPERTY_FILE_URLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileUrls(List fileUrls) { + this.fileUrls = fileUrls; + } - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - public UnclaimedDraftCreateRequest fileUrls(List fileUrls) { - this.fileUrls = fileUrls; - return this; - } - - public UnclaimedDraftCreateRequest addFileUrlsItem(String fileUrlsItem) { - if (this.fileUrls == null) { - this.fileUrls = new ArrayList<>(); - } - this.fileUrls.add(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 - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFileUrls() { - return fileUrls; - } - - - @JsonProperty(JSON_PROPERTY_FILE_URLS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFileUrls(List fileUrls) { - this.fileUrls = fileUrls; - } - - - public UnclaimedDraftCreateRequest allowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - return this; - } - - /** - * Allows signers to decline to sign a document if `true`. Defaults to `false`. - * @return allowDecline - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAllowDecline() { - return allowDecline; - } - - - @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowDecline(Boolean allowDecline) { - this.allowDecline = allowDecline; - } + public UnclaimedDraftCreateRequest allowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + return this; + } + /** + * Allows signers to decline to sign a document if `true`. Defaults to + * `false`. + * + * @return allowDecline + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAllowDecline() { + return allowDecline; + } - public UnclaimedDraftCreateRequest attachments(List attachments) { - this.attachments = attachments; - return this; - } - - public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { - if (this.attachments == null) { - this.attachments = new ArrayList<>(); - } - this.attachments.add(attachmentsItem); - return this; - } - - /** - * A list describing the attachments - * @return attachments - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getAttachments() { - return attachments; - } - - - @JsonProperty(JSON_PROPERTY_ATTACHMENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttachments(List attachments) { - this.attachments = attachments; - } - - - public UnclaimedDraftCreateRequest ccEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - return this; - } - - public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { - if (this.ccEmailAddresses == null) { - this.ccEmailAddresses = new ArrayList<>(); - } - this.ccEmailAddresses.add(ccEmailAddressesItem); - return this; - } - - /** - * The email addresses that should be CCed. - * @return ccEmailAddresses - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCcEmailAddresses() { - return ccEmailAddresses; - } - - - @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCcEmailAddresses(List ccEmailAddresses) { - this.ccEmailAddresses = ccEmailAddresses; - } - - - public UnclaimedDraftCreateRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClientId(String clientId) { - this.clientId = clientId; - } - - - public UnclaimedDraftCreateRequest customFields(List customFields) { - this.customFields = customFields; - return this; - } - - public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); - } - this.customFields.add(customFieldsItem); - 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 - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCustomFields() { - return customFields; - } - - - @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(List customFields) { - this.customFields = customFields; - } + @JsonProperty(JSON_PROPERTY_ALLOW_DECLINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowDecline(Boolean allowDecline) { + this.allowDecline = allowDecline; + } + public UnclaimedDraftCreateRequest attachments(List attachments) { + this.attachments = attachments; + return this; + } - public UnclaimedDraftCreateRequest fieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - return this; - } - - /** - * Get fieldOptions - * @return fieldOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubFieldOptions getFieldOptions() { - return fieldOptions; - } - - - @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldOptions(SubFieldOptions fieldOptions) { - this.fieldOptions = fieldOptions; - } - - - public UnclaimedDraftCreateRequest formFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - return this; - } + public UnclaimedDraftCreateRequest addAttachmentsItem(SubAttachment attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } - public UnclaimedDraftCreateRequest addFormFieldGroupsItem(SubFormFieldGroup formFieldGroupsItem) { - if (this.formFieldGroups == null) { - this.formFieldGroups = new ArrayList<>(); - } - this.formFieldGroups.add(formFieldGroupsItem); - 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 - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldGroups() { - return formFieldGroups; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldGroups(List formFieldGroups) { - this.formFieldGroups = formFieldGroups; - } - - - public UnclaimedDraftCreateRequest formFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - return this; - } - - public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { - if (this.formFieldRules == null) { - this.formFieldRules = new ArrayList<>(); - } - this.formFieldRules.add(formFieldRulesItem); - return this; - } - - /** - * Conditional Logic rules for fields defined in `form_fields_per_document`. - * @return formFieldRules - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFormFieldRules() { - return formFieldRules; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldRules(List formFieldRules) { - this.formFieldRules = formFieldRules; - } - - - public UnclaimedDraftCreateRequest formFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - return this; - } - - public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem(SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { - if (this.formFieldsPerDocument == null) { - this.formFieldsPerDocument = new ArrayList<>(); - } - 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.Nullable - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * A list describing the attachments + * + * @return attachments + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAttachments() { + return attachments; + } - public List getFormFieldsPerDocument() { - return formFieldsPerDocument; - } - - - @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFormFieldsPerDocument(List formFieldsPerDocument) { - this.formFieldsPerDocument = formFieldsPerDocument; - } - - - public UnclaimedDraftCreateRequest hideTextTags(Boolean hideTextTags) { - this.hideTextTags = 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 - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHideTextTags() { - return hideTextTags; - } - - - @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHideTextTags(Boolean hideTextTags) { - this.hideTextTags = hideTextTags; - } - - - public UnclaimedDraftCreateRequest message(String message) { - this.message = message; - return this; - } - - /** - * The custom message in the email that will be sent to the signers. - * @return message - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - public UnclaimedDraftCreateRequest metadata(Map metadata) { - this.metadata = metadata; - return this; - } - - public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap<>(); + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; } - this.metadata.put(key, 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 - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMetadata() { - return metadata; - } - - - @JsonProperty(JSON_PROPERTY_METADATA) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - - public UnclaimedDraftCreateRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public UnclaimedDraftCreateRequest signers(List signers) { - this.signers = signers; - return this; - } - - public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { - if (this.signers == null) { - this.signers = new ArrayList<>(); + + public UnclaimedDraftCreateRequest ccEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + return this; } - this.signers.add(signersItem); - return this; - } - - /** - * Add Signers to your Unclaimed Draft Signature Request. - * @return signers - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getSigners() { - return signers; - } - - - @JsonProperty(JSON_PROPERTY_SIGNERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigners(List signers) { - this.signers = signers; - } - - public UnclaimedDraftCreateRequest signingOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - return this; - } - - /** - * Get signingOptions - * @return signingOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubSigningOptions getSigningOptions() { - return signingOptions; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningOptions(SubSigningOptions signingOptions) { - this.signingOptions = signingOptions; - } - - - public UnclaimedDraftCreateRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } + public UnclaimedDraftCreateRequest addCcEmailAddressesItem(String ccEmailAddressesItem) { + if (this.ccEmailAddresses == null) { + this.ccEmailAddresses = new ArrayList<>(); + } + this.ccEmailAddresses.add(ccEmailAddressesItem); + return this; + } - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public UnclaimedDraftCreateRequest subject(String subject) { - this.subject = subject; - return this; - } + /** + * The email addresses that should be CCed. + * + * @return ccEmailAddresses + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCcEmailAddresses() { + return ccEmailAddresses; + } - /** - * The subject in the email that will be sent to the signers. - * @return subject - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSubject() { - return subject; - } - - - @JsonProperty(JSON_PROPERTY_SUBJECT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubject(String subject) { - this.subject = subject; - } - - - public UnclaimedDraftCreateRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - public UnclaimedDraftCreateRequest usePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - 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 - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUsePreexistingFields() { - return usePreexistingFields; - } - - - @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsePreexistingFields(Boolean usePreexistingFields) { - this.usePreexistingFields = usePreexistingFields; - } - - - public UnclaimedDraftCreateRequest useTextTags(Boolean useTextTags) { - this.useTextTags = 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 - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getUseTextTags() { - return useTextTags; - } - - - @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUseTextTags(Boolean useTextTags) { - this.useTextTags = useTextTags; - } - - - public UnclaimedDraftCreateRequest expiresAt(Integer expiresAt) { - this.expiresAt = 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 - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - /** - * Return true if this UnclaimedDraftCreateRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateRequest unclaimedDraftCreateRequest = (UnclaimedDraftCreateRequest) o; - return Objects.equals(this.type, unclaimedDraftCreateRequest.type) && - Objects.equals(this.files, unclaimedDraftCreateRequest.files) && - Objects.equals(this.fileUrls, unclaimedDraftCreateRequest.fileUrls) && - Objects.equals(this.allowDecline, unclaimedDraftCreateRequest.allowDecline) && - Objects.equals(this.attachments, unclaimedDraftCreateRequest.attachments) && - Objects.equals(this.ccEmailAddresses, unclaimedDraftCreateRequest.ccEmailAddresses) && - Objects.equals(this.clientId, unclaimedDraftCreateRequest.clientId) && - Objects.equals(this.customFields, unclaimedDraftCreateRequest.customFields) && - Objects.equals(this.fieldOptions, unclaimedDraftCreateRequest.fieldOptions) && - Objects.equals(this.formFieldGroups, unclaimedDraftCreateRequest.formFieldGroups) && - Objects.equals(this.formFieldRules, unclaimedDraftCreateRequest.formFieldRules) && - Objects.equals(this.formFieldsPerDocument, unclaimedDraftCreateRequest.formFieldsPerDocument) && - Objects.equals(this.hideTextTags, unclaimedDraftCreateRequest.hideTextTags) && - Objects.equals(this.message, unclaimedDraftCreateRequest.message) && - Objects.equals(this.metadata, unclaimedDraftCreateRequest.metadata) && - Objects.equals(this.showProgressStepper, unclaimedDraftCreateRequest.showProgressStepper) && - Objects.equals(this.signers, unclaimedDraftCreateRequest.signers) && - Objects.equals(this.signingOptions, unclaimedDraftCreateRequest.signingOptions) && - Objects.equals(this.signingRedirectUrl, unclaimedDraftCreateRequest.signingRedirectUrl) && - Objects.equals(this.subject, unclaimedDraftCreateRequest.subject) && - Objects.equals(this.testMode, unclaimedDraftCreateRequest.testMode) && - Objects.equals(this.usePreexistingFields, unclaimedDraftCreateRequest.usePreexistingFields) && - Objects.equals(this.useTextTags, unclaimedDraftCreateRequest.useTextTags) && - Objects.equals(this.expiresAt, unclaimedDraftCreateRequest.expiresAt); - } - - @Override - public int hashCode() { - return Objects.hash(type, files, fileUrls, allowDecline, attachments, ccEmailAddresses, clientId, customFields, fieldOptions, formFieldGroups, formFieldRules, formFieldsPerDocument, hideTextTags, message, metadata, showProgressStepper, signers, signingOptions, signingRedirectUrl, subject, testMode, usePreexistingFields, useTextTags, expiresAt); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateRequest {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); - sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); - sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); - sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); - sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); - sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); - sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); - sb.append(" formFieldsPerDocument: ").append(toIndentedString(formFieldsPerDocument)).append("\n"); - sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); - sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append(" usePreexistingFields: ").append(toIndentedString(usePreexistingFields)).append("\n"); - sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (type != null) { - if (isFileTypeOrListOfFiles(type)) { - fileTypeFound = true; - } + @JsonProperty(JSON_PROPERTY_CC_EMAIL_ADDRESSES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCcEmailAddresses(List ccEmailAddresses) { + this.ccEmailAddresses = ccEmailAddresses; + } - if (type.getClass().equals(java.io.File.class) || - type.getClass().equals(Integer.class) || - type.getClass().equals(String.class) || - type.getClass().isEnum()) { - map.put("type", type); - } else if (isListOfFile(type)) { - for(int i = 0; i< getListSize(type); i++) { - map.put("type[" + i + "]", getFromList(type, i)); - } - } - else { - map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); - } + public UnclaimedDraftCreateRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (files != null) { - if (isFileTypeOrListOfFiles(files)) { - fileTypeFound = true; - } - if (files.getClass().equals(java.io.File.class) || - files.getClass().equals(Integer.class) || - files.getClass().equals(String.class) || - files.getClass().isEnum()) { - map.put("files", files); - } else if (isListOfFile(files)) { - for(int i = 0; i< getListSize(files); i++) { - map.put("files[" + i + "]", getFromList(files, i)); - } - } - else { - map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClientId() { + return clientId; } - if (fileUrls != null) { - if (isFileTypeOrListOfFiles(fileUrls)) { - fileTypeFound = true; - } - if (fileUrls.getClass().equals(java.io.File.class) || - fileUrls.getClass().equals(Integer.class) || - fileUrls.getClass().equals(String.class) || - fileUrls.getClass().isEnum()) { - map.put("file_urls", fileUrls); - } else if (isListOfFile(fileUrls)) { - for(int i = 0; i< getListSize(fileUrls); i++) { - map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); - } - } - else { - map.put("file_urls", JSON.getDefault().getMapper().writeValueAsString(fileUrls)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (allowDecline != null) { - if (isFileTypeOrListOfFiles(allowDecline)) { - fileTypeFound = true; - } - if (allowDecline.getClass().equals(java.io.File.class) || - allowDecline.getClass().equals(Integer.class) || - allowDecline.getClass().equals(String.class) || - allowDecline.getClass().isEnum()) { - map.put("allow_decline", allowDecline); - } else if (isListOfFile(allowDecline)) { - for(int i = 0; i< getListSize(allowDecline); i++) { - map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); - } - } - else { - map.put("allow_decline", JSON.getDefault().getMapper().writeValueAsString(allowDecline)); - } + public UnclaimedDraftCreateRequest customFields(List customFields) { + this.customFields = customFields; + return this; } - if (attachments != null) { - if (isFileTypeOrListOfFiles(attachments)) { - fileTypeFound = true; - } - if (attachments.getClass().equals(java.io.File.class) || - attachments.getClass().equals(Integer.class) || - attachments.getClass().equals(String.class) || - attachments.getClass().isEnum()) { - map.put("attachments", attachments); - } else if (isListOfFile(attachments)) { - for(int i = 0; i< getListSize(attachments); i++) { - map.put("attachments[" + i + "]", getFromList(attachments, i)); - } - } - else { - map.put("attachments", JSON.getDefault().getMapper().writeValueAsString(attachments)); + public UnclaimedDraftCreateRequest addCustomFieldsItem(SubCustomField customFieldsItem) { + if (this.customFields == null) { + this.customFields = new ArrayList<>(); } + this.customFields.add(customFieldsItem); + return this; } - if (ccEmailAddresses != null) { - if (isFileTypeOrListOfFiles(ccEmailAddresses)) { - fileTypeFound = true; - } - if (ccEmailAddresses.getClass().equals(java.io.File.class) || - ccEmailAddresses.getClass().equals(Integer.class) || - ccEmailAddresses.getClass().equals(String.class) || - ccEmailAddresses.getClass().isEnum()) { - map.put("cc_email_addresses", ccEmailAddresses); - } else if (isListOfFile(ccEmailAddresses)) { - for(int i = 0; i< getListSize(ccEmailAddresses); i++) { - map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); - } - } - else { - map.put("cc_email_addresses", JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomFields() { + return customFields; } - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomFields(List customFields) { + this.customFields = customFields; } - if (customFields != null) { - if (isFileTypeOrListOfFiles(customFields)) { - fileTypeFound = true; - } - if (customFields.getClass().equals(java.io.File.class) || - customFields.getClass().equals(Integer.class) || - customFields.getClass().equals(String.class) || - customFields.getClass().isEnum()) { - map.put("custom_fields", customFields); - } else if (isListOfFile(customFields)) { - for(int i = 0; i< getListSize(customFields); i++) { - map.put("custom_fields[" + i + "]", getFromList(customFields, i)); - } - } - else { - map.put("custom_fields", JSON.getDefault().getMapper().writeValueAsString(customFields)); - } + public UnclaimedDraftCreateRequest fieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; + return this; } - if (fieldOptions != null) { - if (isFileTypeOrListOfFiles(fieldOptions)) { - fileTypeFound = true; - } - if (fieldOptions.getClass().equals(java.io.File.class) || - fieldOptions.getClass().equals(Integer.class) || - fieldOptions.getClass().equals(String.class) || - fieldOptions.getClass().isEnum()) { - map.put("field_options", fieldOptions); - } else if (isListOfFile(fieldOptions)) { - for(int i = 0; i< getListSize(fieldOptions); i++) { - map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); - } - } - else { - map.put("field_options", JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); - } + /** + * Get fieldOptions + * + * @return fieldOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubFieldOptions getFieldOptions() { + return fieldOptions; } - if (formFieldGroups != null) { - if (isFileTypeOrListOfFiles(formFieldGroups)) { - fileTypeFound = true; - } - if (formFieldGroups.getClass().equals(java.io.File.class) || - formFieldGroups.getClass().equals(Integer.class) || - formFieldGroups.getClass().equals(String.class) || - formFieldGroups.getClass().isEnum()) { - map.put("form_field_groups", formFieldGroups); - } else if (isListOfFile(formFieldGroups)) { - for(int i = 0; i< getListSize(formFieldGroups); i++) { - map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); - } - } - else { - map.put("form_field_groups", JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); - } + @JsonProperty(JSON_PROPERTY_FIELD_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldOptions(SubFieldOptions fieldOptions) { + this.fieldOptions = fieldOptions; } - if (formFieldRules != null) { - if (isFileTypeOrListOfFiles(formFieldRules)) { - fileTypeFound = true; - } - if (formFieldRules.getClass().equals(java.io.File.class) || - formFieldRules.getClass().equals(Integer.class) || - formFieldRules.getClass().equals(String.class) || - formFieldRules.getClass().isEnum()) { - map.put("form_field_rules", formFieldRules); - } else if (isListOfFile(formFieldRules)) { - for(int i = 0; i< getListSize(formFieldRules); i++) { - map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); - } - } - else { - map.put("form_field_rules", JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); - } + public UnclaimedDraftCreateRequest formFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; + return this; } - if (formFieldsPerDocument != null) { - if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { - fileTypeFound = true; - } - if (formFieldsPerDocument.getClass().equals(java.io.File.class) || - formFieldsPerDocument.getClass().equals(Integer.class) || - formFieldsPerDocument.getClass().equals(String.class) || - formFieldsPerDocument.getClass().isEnum()) { - map.put("form_fields_per_document", formFieldsPerDocument); - } else if (isListOfFile(formFieldsPerDocument)) { - for(int i = 0; i< getListSize(formFieldsPerDocument); i++) { - map.put("form_fields_per_document[" + i + "]", getFromList(formFieldsPerDocument, i)); - } - } - else { - map.put("form_fields_per_document", JSON.getDefault().getMapper().writeValueAsString(formFieldsPerDocument)); + public UnclaimedDraftCreateRequest addFormFieldGroupsItem( + SubFormFieldGroup formFieldGroupsItem) { + if (this.formFieldGroups == null) { + this.formFieldGroups = new ArrayList<>(); } + this.formFieldGroups.add(formFieldGroupsItem); + return this; } - if (hideTextTags != null) { - if (isFileTypeOrListOfFiles(hideTextTags)) { - fileTypeFound = true; - } - if (hideTextTags.getClass().equals(java.io.File.class) || - hideTextTags.getClass().equals(Integer.class) || - hideTextTags.getClass().equals(String.class) || - hideTextTags.getClass().isEnum()) { - map.put("hide_text_tags", hideTextTags); - } else if (isListOfFile(hideTextTags)) { - for(int i = 0; i< getListSize(hideTextTags); i++) { - map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); - } - } - else { - map.put("hide_text_tags", JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldGroups() { + return formFieldGroups; } - if (message != null) { - if (isFileTypeOrListOfFiles(message)) { - fileTypeFound = true; - } - if (message.getClass().equals(java.io.File.class) || - message.getClass().equals(Integer.class) || - message.getClass().equals(String.class) || - message.getClass().isEnum()) { - map.put("message", message); - } else if (isListOfFile(message)) { - for(int i = 0; i< getListSize(message); i++) { - map.put("message[" + i + "]", getFromList(message, i)); - } - } - else { - map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldGroups(List formFieldGroups) { + this.formFieldGroups = formFieldGroups; } - if (metadata != null) { - if (isFileTypeOrListOfFiles(metadata)) { - fileTypeFound = true; - } - if (metadata.getClass().equals(java.io.File.class) || - metadata.getClass().equals(Integer.class) || - metadata.getClass().equals(String.class) || - metadata.getClass().isEnum()) { - map.put("metadata", metadata); - } else if (isListOfFile(metadata)) { - for(int i = 0; i< getListSize(metadata); i++) { - map.put("metadata[" + i + "]", getFromList(metadata, i)); - } - } - else { - map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); - } + public UnclaimedDraftCreateRequest formFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; + return this; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + public UnclaimedDraftCreateRequest addFormFieldRulesItem(SubFormFieldRule formFieldRulesItem) { + if (this.formFieldRules == null) { + this.formFieldRules = new ArrayList<>(); } + this.formFieldRules.add(formFieldRulesItem); + return this; } - if (signers != null) { - if (isFileTypeOrListOfFiles(signers)) { - fileTypeFound = true; - } - if (signers.getClass().equals(java.io.File.class) || - signers.getClass().equals(Integer.class) || - signers.getClass().equals(String.class) || - signers.getClass().isEnum()) { - map.put("signers", signers); - } else if (isListOfFile(signers)) { - for(int i = 0; i< getListSize(signers); i++) { - map.put("signers[" + i + "]", getFromList(signers, i)); - } - } - else { - map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); - } + /** + * Conditional Logic rules for fields defined in `form_fields_per_document`. + * + * @return formFieldRules + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldRules() { + return formFieldRules; } - if (signingOptions != null) { - if (isFileTypeOrListOfFiles(signingOptions)) { - fileTypeFound = true; - } - if (signingOptions.getClass().equals(java.io.File.class) || - signingOptions.getClass().equals(Integer.class) || - signingOptions.getClass().equals(String.class) || - signingOptions.getClass().isEnum()) { - map.put("signing_options", signingOptions); - } else if (isListOfFile(signingOptions)) { - for(int i = 0; i< getListSize(signingOptions); i++) { - map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); - } - } - else { - map.put("signing_options", JSON.getDefault().getMapper().writeValueAsString(signingOptions)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELD_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldRules(List formFieldRules) { + this.formFieldRules = formFieldRules; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + public UnclaimedDraftCreateRequest formFieldsPerDocument( + List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; + return this; } - if (subject != null) { - if (isFileTypeOrListOfFiles(subject)) { - fileTypeFound = true; - } - if (subject.getClass().equals(java.io.File.class) || - subject.getClass().equals(Integer.class) || - subject.getClass().equals(String.class) || - subject.getClass().isEnum()) { - map.put("subject", subject); - } else if (isListOfFile(subject)) { - for(int i = 0; i< getListSize(subject); i++) { - map.put("subject[" + i + "]", getFromList(subject, i)); - } - } - else { - map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + public UnclaimedDraftCreateRequest addFormFieldsPerDocumentItem( + SubFormFieldsPerDocumentBase formFieldsPerDocumentItem) { + if (this.formFieldsPerDocument == null) { + this.formFieldsPerDocument = new ArrayList<>(); } + this.formFieldsPerDocument.add(formFieldsPerDocumentItem); + return this; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } - } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFormFieldsPerDocument() { + return formFieldsPerDocument; } - if (usePreexistingFields != null) { - if (isFileTypeOrListOfFiles(usePreexistingFields)) { - fileTypeFound = true; - } - if (usePreexistingFields.getClass().equals(java.io.File.class) || - usePreexistingFields.getClass().equals(Integer.class) || - usePreexistingFields.getClass().equals(String.class) || - usePreexistingFields.getClass().isEnum()) { - map.put("use_preexisting_fields", usePreexistingFields); - } else if (isListOfFile(usePreexistingFields)) { - for(int i = 0; i< getListSize(usePreexistingFields); i++) { - map.put("use_preexisting_fields[" + i + "]", getFromList(usePreexistingFields, i)); - } - } - else { - map.put("use_preexisting_fields", JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); - } + @JsonProperty(JSON_PROPERTY_FORM_FIELDS_PER_DOCUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormFieldsPerDocument(List formFieldsPerDocument) { + this.formFieldsPerDocument = formFieldsPerDocument; } - if (useTextTags != null) { - if (isFileTypeOrListOfFiles(useTextTags)) { - fileTypeFound = true; - } - if (useTextTags.getClass().equals(java.io.File.class) || - useTextTags.getClass().equals(Integer.class) || - useTextTags.getClass().equals(String.class) || - useTextTags.getClass().isEnum()) { - map.put("use_text_tags", useTextTags); - } else if (isListOfFile(useTextTags)) { - for(int i = 0; i< getListSize(useTextTags); i++) { - map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); - } - } - else { - map.put("use_text_tags", JSON.getDefault().getMapper().writeValueAsString(useTextTags)); - } + public UnclaimedDraftCreateRequest hideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + return this; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } + /** + * 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 @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideTextTags() { + return hideTextTags; + } + + @JsonProperty(JSON_PROPERTY_HIDE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideTextTags(Boolean hideTextTags) { + this.hideTextTags = hideTextTags; + } + + public UnclaimedDraftCreateRequest message(String message) { + this.message = message; + return this; + } + + /** + * The custom message in the email that will be sent to the signers. + * + * @return message + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public UnclaimedDraftCreateRequest metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + public UnclaimedDraftCreateRequest putMetadataItem(String key, Object metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + this.metadata.put(key, 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 @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMetadata() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public UnclaimedDraftCreateRequest showProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public UnclaimedDraftCreateRequest signers(List signers) { + this.signers = signers; + return this; + } + + public UnclaimedDraftCreateRequest addSignersItem(SubUnclaimedDraftSigner signersItem) { + if (this.signers == null) { + this.signers = new ArrayList<>(); } + this.signers.add(signersItem); + return this; } - } catch (Exception e) { - throw new ApiException(e); + + /** + * Add Signers to your Unclaimed Draft Signature Request. + * + * @return signers + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSigners() { + return signers; } - return fileTypeFound ? map : new HashMap<>(); - } + @JsonProperty(JSON_PROPERTY_SIGNERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigners(List signers) { + this.signers = signers; + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public UnclaimedDraftCreateRequest signingOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + return this; + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + /** + * Get signingOptions + * + * @return signingOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubSigningOptions getSigningOptions() { + return signingOptions; + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + @JsonProperty(JSON_PROPERTY_SIGNING_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningOptions(SubSigningOptions signingOptions) { + this.signingOptions = signingOptions; + } - private Object getFromList(Object obj, int index) throws Exception { - return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index); - } + public UnclaimedDraftCreateRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); - } + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } - /** - * 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"; + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; } - return o.toString().replace("\n", "\n "); - } -} + public UnclaimedDraftCreateRequest subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject in the email that will be sent to the signers. + * + * @return subject + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public UnclaimedDraftCreateRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + public UnclaimedDraftCreateRequest usePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + 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 @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUsePreexistingFields() { + return usePreexistingFields; + } + @JsonProperty(JSON_PROPERTY_USE_PREEXISTING_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsePreexistingFields(Boolean usePreexistingFields) { + this.usePreexistingFields = usePreexistingFields; + } + + public UnclaimedDraftCreateRequest useTextTags(Boolean useTextTags) { + this.useTextTags = 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 @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseTextTags() { + return useTextTags; + } + + @JsonProperty(JSON_PROPERTY_USE_TEXT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseTextTags(Boolean useTextTags) { + this.useTextTags = useTextTags; + } + + public UnclaimedDraftCreateRequest expiresAt(Integer expiresAt) { + this.expiresAt = 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 @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + /** Return true if this UnclaimedDraftCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnclaimedDraftCreateRequest unclaimedDraftCreateRequest = (UnclaimedDraftCreateRequest) o; + return Objects.equals(this.type, unclaimedDraftCreateRequest.type) + && Objects.equals(this.files, unclaimedDraftCreateRequest.files) + && Objects.equals(this.fileUrls, unclaimedDraftCreateRequest.fileUrls) + && Objects.equals(this.allowDecline, unclaimedDraftCreateRequest.allowDecline) + && Objects.equals(this.attachments, unclaimedDraftCreateRequest.attachments) + && Objects.equals( + this.ccEmailAddresses, unclaimedDraftCreateRequest.ccEmailAddresses) + && Objects.equals(this.clientId, unclaimedDraftCreateRequest.clientId) + && Objects.equals(this.customFields, unclaimedDraftCreateRequest.customFields) + && Objects.equals(this.fieldOptions, unclaimedDraftCreateRequest.fieldOptions) + && Objects.equals(this.formFieldGroups, unclaimedDraftCreateRequest.formFieldGroups) + && Objects.equals(this.formFieldRules, unclaimedDraftCreateRequest.formFieldRules) + && Objects.equals( + this.formFieldsPerDocument, + unclaimedDraftCreateRequest.formFieldsPerDocument) + && Objects.equals(this.hideTextTags, unclaimedDraftCreateRequest.hideTextTags) + && Objects.equals(this.message, unclaimedDraftCreateRequest.message) + && Objects.equals(this.metadata, unclaimedDraftCreateRequest.metadata) + && Objects.equals( + this.showProgressStepper, unclaimedDraftCreateRequest.showProgressStepper) + && Objects.equals(this.signers, unclaimedDraftCreateRequest.signers) + && Objects.equals(this.signingOptions, unclaimedDraftCreateRequest.signingOptions) + && Objects.equals( + this.signingRedirectUrl, unclaimedDraftCreateRequest.signingRedirectUrl) + && Objects.equals(this.subject, unclaimedDraftCreateRequest.subject) + && Objects.equals(this.testMode, unclaimedDraftCreateRequest.testMode) + && Objects.equals( + this.usePreexistingFields, unclaimedDraftCreateRequest.usePreexistingFields) + && Objects.equals(this.useTextTags, unclaimedDraftCreateRequest.useTextTags) + && Objects.equals(this.expiresAt, unclaimedDraftCreateRequest.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + files, + fileUrls, + allowDecline, + attachments, + ccEmailAddresses, + clientId, + customFields, + fieldOptions, + formFieldGroups, + formFieldRules, + formFieldsPerDocument, + hideTextTags, + message, + metadata, + showProgressStepper, + signers, + signingOptions, + signingRedirectUrl, + subject, + testMode, + usePreexistingFields, + useTextTags, + expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append(" fileUrls: ").append(toIndentedString(fileUrls)).append("\n"); + sb.append(" allowDecline: ").append(toIndentedString(allowDecline)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append(" ccEmailAddresses: ").append(toIndentedString(ccEmailAddresses)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" fieldOptions: ").append(toIndentedString(fieldOptions)).append("\n"); + sb.append(" formFieldGroups: ").append(toIndentedString(formFieldGroups)).append("\n"); + sb.append(" formFieldRules: ").append(toIndentedString(formFieldRules)).append("\n"); + sb.append(" formFieldsPerDocument: ") + .append(toIndentedString(formFieldsPerDocument)) + .append("\n"); + sb.append(" hideTextTags: ").append(toIndentedString(hideTextTags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" signers: ").append(toIndentedString(signers)).append("\n"); + sb.append(" signingOptions: ").append(toIndentedString(signingOptions)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append(" usePreexistingFields: ") + .append(toIndentedString(usePreexistingFields)) + .append("\n"); + sb.append(" useTextTags: ").append(toIndentedString(useTextTags)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (type != null) { + if (isFileTypeOrListOfFiles(type)) { + fileTypeFound = true; + } + + if (type.getClass().equals(java.io.File.class) + || type.getClass().equals(Integer.class) + || type.getClass().equals(String.class) + || type.getClass().isEnum()) { + map.put("type", type); + } else if (isListOfFile(type)) { + for (int i = 0; i < getListSize(type); i++) { + map.put("type[" + i + "]", getFromList(type, i)); + } + } else { + map.put("type", JSON.getDefault().getMapper().writeValueAsString(type)); + } + } + if (files != null) { + if (isFileTypeOrListOfFiles(files)) { + fileTypeFound = true; + } + + if (files.getClass().equals(java.io.File.class) + || files.getClass().equals(Integer.class) + || files.getClass().equals(String.class) + || files.getClass().isEnum()) { + map.put("files", files); + } else if (isListOfFile(files)) { + for (int i = 0; i < getListSize(files); i++) { + map.put("files[" + i + "]", getFromList(files, i)); + } + } else { + map.put("files", JSON.getDefault().getMapper().writeValueAsString(files)); + } + } + if (fileUrls != null) { + if (isFileTypeOrListOfFiles(fileUrls)) { + fileTypeFound = true; + } + + if (fileUrls.getClass().equals(java.io.File.class) + || fileUrls.getClass().equals(Integer.class) + || fileUrls.getClass().equals(String.class) + || fileUrls.getClass().isEnum()) { + map.put("file_urls", fileUrls); + } else if (isListOfFile(fileUrls)) { + for (int i = 0; i < getListSize(fileUrls); i++) { + map.put("file_urls[" + i + "]", getFromList(fileUrls, i)); + } + } else { + map.put( + "file_urls", + JSON.getDefault().getMapper().writeValueAsString(fileUrls)); + } + } + if (allowDecline != null) { + if (isFileTypeOrListOfFiles(allowDecline)) { + fileTypeFound = true; + } + + if (allowDecline.getClass().equals(java.io.File.class) + || allowDecline.getClass().equals(Integer.class) + || allowDecline.getClass().equals(String.class) + || allowDecline.getClass().isEnum()) { + map.put("allow_decline", allowDecline); + } else if (isListOfFile(allowDecline)) { + for (int i = 0; i < getListSize(allowDecline); i++) { + map.put("allow_decline[" + i + "]", getFromList(allowDecline, i)); + } + } else { + map.put( + "allow_decline", + JSON.getDefault().getMapper().writeValueAsString(allowDecline)); + } + } + if (attachments != null) { + if (isFileTypeOrListOfFiles(attachments)) { + fileTypeFound = true; + } + + if (attachments.getClass().equals(java.io.File.class) + || attachments.getClass().equals(Integer.class) + || attachments.getClass().equals(String.class) + || attachments.getClass().isEnum()) { + map.put("attachments", attachments); + } else if (isListOfFile(attachments)) { + for (int i = 0; i < getListSize(attachments); i++) { + map.put("attachments[" + i + "]", getFromList(attachments, i)); + } + } else { + map.put( + "attachments", + JSON.getDefault().getMapper().writeValueAsString(attachments)); + } + } + if (ccEmailAddresses != null) { + if (isFileTypeOrListOfFiles(ccEmailAddresses)) { + fileTypeFound = true; + } + + if (ccEmailAddresses.getClass().equals(java.io.File.class) + || ccEmailAddresses.getClass().equals(Integer.class) + || ccEmailAddresses.getClass().equals(String.class) + || ccEmailAddresses.getClass().isEnum()) { + map.put("cc_email_addresses", ccEmailAddresses); + } else if (isListOfFile(ccEmailAddresses)) { + for (int i = 0; i < getListSize(ccEmailAddresses); i++) { + map.put("cc_email_addresses[" + i + "]", getFromList(ccEmailAddresses, i)); + } + } else { + map.put( + "cc_email_addresses", + JSON.getDefault().getMapper().writeValueAsString(ccEmailAddresses)); + } + } + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (customFields != null) { + if (isFileTypeOrListOfFiles(customFields)) { + fileTypeFound = true; + } + + if (customFields.getClass().equals(java.io.File.class) + || customFields.getClass().equals(Integer.class) + || customFields.getClass().equals(String.class) + || customFields.getClass().isEnum()) { + map.put("custom_fields", customFields); + } else if (isListOfFile(customFields)) { + for (int i = 0; i < getListSize(customFields); i++) { + map.put("custom_fields[" + i + "]", getFromList(customFields, i)); + } + } else { + map.put( + "custom_fields", + JSON.getDefault().getMapper().writeValueAsString(customFields)); + } + } + if (fieldOptions != null) { + if (isFileTypeOrListOfFiles(fieldOptions)) { + fileTypeFound = true; + } + + if (fieldOptions.getClass().equals(java.io.File.class) + || fieldOptions.getClass().equals(Integer.class) + || fieldOptions.getClass().equals(String.class) + || fieldOptions.getClass().isEnum()) { + map.put("field_options", fieldOptions); + } else if (isListOfFile(fieldOptions)) { + for (int i = 0; i < getListSize(fieldOptions); i++) { + map.put("field_options[" + i + "]", getFromList(fieldOptions, i)); + } + } else { + map.put( + "field_options", + JSON.getDefault().getMapper().writeValueAsString(fieldOptions)); + } + } + if (formFieldGroups != null) { + if (isFileTypeOrListOfFiles(formFieldGroups)) { + fileTypeFound = true; + } + + if (formFieldGroups.getClass().equals(java.io.File.class) + || formFieldGroups.getClass().equals(Integer.class) + || formFieldGroups.getClass().equals(String.class) + || formFieldGroups.getClass().isEnum()) { + map.put("form_field_groups", formFieldGroups); + } else if (isListOfFile(formFieldGroups)) { + for (int i = 0; i < getListSize(formFieldGroups); i++) { + map.put("form_field_groups[" + i + "]", getFromList(formFieldGroups, i)); + } + } else { + map.put( + "form_field_groups", + JSON.getDefault().getMapper().writeValueAsString(formFieldGroups)); + } + } + if (formFieldRules != null) { + if (isFileTypeOrListOfFiles(formFieldRules)) { + fileTypeFound = true; + } + + if (formFieldRules.getClass().equals(java.io.File.class) + || formFieldRules.getClass().equals(Integer.class) + || formFieldRules.getClass().equals(String.class) + || formFieldRules.getClass().isEnum()) { + map.put("form_field_rules", formFieldRules); + } else if (isListOfFile(formFieldRules)) { + for (int i = 0; i < getListSize(formFieldRules); i++) { + map.put("form_field_rules[" + i + "]", getFromList(formFieldRules, i)); + } + } else { + map.put( + "form_field_rules", + JSON.getDefault().getMapper().writeValueAsString(formFieldRules)); + } + } + if (formFieldsPerDocument != null) { + if (isFileTypeOrListOfFiles(formFieldsPerDocument)) { + fileTypeFound = true; + } + + if (formFieldsPerDocument.getClass().equals(java.io.File.class) + || formFieldsPerDocument.getClass().equals(Integer.class) + || formFieldsPerDocument.getClass().equals(String.class) + || formFieldsPerDocument.getClass().isEnum()) { + map.put("form_fields_per_document", formFieldsPerDocument); + } else if (isListOfFile(formFieldsPerDocument)) { + for (int i = 0; i < getListSize(formFieldsPerDocument); i++) { + map.put( + "form_fields_per_document[" + i + "]", + getFromList(formFieldsPerDocument, i)); + } + } else { + map.put( + "form_fields_per_document", + JSON.getDefault() + .getMapper() + .writeValueAsString(formFieldsPerDocument)); + } + } + if (hideTextTags != null) { + if (isFileTypeOrListOfFiles(hideTextTags)) { + fileTypeFound = true; + } + + if (hideTextTags.getClass().equals(java.io.File.class) + || hideTextTags.getClass().equals(Integer.class) + || hideTextTags.getClass().equals(String.class) + || hideTextTags.getClass().isEnum()) { + map.put("hide_text_tags", hideTextTags); + } else if (isListOfFile(hideTextTags)) { + for (int i = 0; i < getListSize(hideTextTags); i++) { + map.put("hide_text_tags[" + i + "]", getFromList(hideTextTags, i)); + } + } else { + map.put( + "hide_text_tags", + JSON.getDefault().getMapper().writeValueAsString(hideTextTags)); + } + } + if (message != null) { + if (isFileTypeOrListOfFiles(message)) { + fileTypeFound = true; + } + + if (message.getClass().equals(java.io.File.class) + || message.getClass().equals(Integer.class) + || message.getClass().equals(String.class) + || message.getClass().isEnum()) { + map.put("message", message); + } else if (isListOfFile(message)) { + for (int i = 0; i < getListSize(message); i++) { + map.put("message[" + i + "]", getFromList(message, i)); + } + } else { + map.put("message", JSON.getDefault().getMapper().writeValueAsString(message)); + } + } + if (metadata != null) { + if (isFileTypeOrListOfFiles(metadata)) { + fileTypeFound = true; + } + + if (metadata.getClass().equals(java.io.File.class) + || metadata.getClass().equals(Integer.class) + || metadata.getClass().equals(String.class) + || metadata.getClass().isEnum()) { + map.put("metadata", metadata); + } else if (isListOfFile(metadata)) { + for (int i = 0; i < getListSize(metadata); i++) { + map.put("metadata[" + i + "]", getFromList(metadata, i)); + } + } else { + map.put("metadata", JSON.getDefault().getMapper().writeValueAsString(metadata)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (signers != null) { + if (isFileTypeOrListOfFiles(signers)) { + fileTypeFound = true; + } + + if (signers.getClass().equals(java.io.File.class) + || signers.getClass().equals(Integer.class) + || signers.getClass().equals(String.class) + || signers.getClass().isEnum()) { + map.put("signers", signers); + } else if (isListOfFile(signers)) { + for (int i = 0; i < getListSize(signers); i++) { + map.put("signers[" + i + "]", getFromList(signers, i)); + } + } else { + map.put("signers", JSON.getDefault().getMapper().writeValueAsString(signers)); + } + } + if (signingOptions != null) { + if (isFileTypeOrListOfFiles(signingOptions)) { + fileTypeFound = true; + } + + if (signingOptions.getClass().equals(java.io.File.class) + || signingOptions.getClass().equals(Integer.class) + || signingOptions.getClass().equals(String.class) + || signingOptions.getClass().isEnum()) { + map.put("signing_options", signingOptions); + } else if (isListOfFile(signingOptions)) { + for (int i = 0; i < getListSize(signingOptions); i++) { + map.put("signing_options[" + i + "]", getFromList(signingOptions, i)); + } + } else { + map.put( + "signing_options", + JSON.getDefault().getMapper().writeValueAsString(signingOptions)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (subject != null) { + if (isFileTypeOrListOfFiles(subject)) { + fileTypeFound = true; + } + + if (subject.getClass().equals(java.io.File.class) + || subject.getClass().equals(Integer.class) + || subject.getClass().equals(String.class) + || subject.getClass().isEnum()) { + map.put("subject", subject); + } else if (isListOfFile(subject)) { + for (int i = 0; i < getListSize(subject); i++) { + map.put("subject[" + i + "]", getFromList(subject, i)); + } + } else { + map.put("subject", JSON.getDefault().getMapper().writeValueAsString(subject)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + if (usePreexistingFields != null) { + if (isFileTypeOrListOfFiles(usePreexistingFields)) { + fileTypeFound = true; + } + + if (usePreexistingFields.getClass().equals(java.io.File.class) + || usePreexistingFields.getClass().equals(Integer.class) + || usePreexistingFields.getClass().equals(String.class) + || usePreexistingFields.getClass().isEnum()) { + map.put("use_preexisting_fields", usePreexistingFields); + } else if (isListOfFile(usePreexistingFields)) { + for (int i = 0; i < getListSize(usePreexistingFields); i++) { + map.put( + "use_preexisting_fields[" + i + "]", + getFromList(usePreexistingFields, i)); + } + } else { + map.put( + "use_preexisting_fields", + JSON.getDefault().getMapper().writeValueAsString(usePreexistingFields)); + } + } + if (useTextTags != null) { + if (isFileTypeOrListOfFiles(useTextTags)) { + fileTypeFound = true; + } + + if (useTextTags.getClass().equals(java.io.File.class) + || useTextTags.getClass().equals(Integer.class) + || useTextTags.getClass().equals(String.class) + || useTextTags.getClass().isEnum()) { + map.put("use_text_tags", useTextTags); + } else if (isListOfFile(useTextTags)) { + for (int i = 0; i < getListSize(useTextTags); i++) { + map.put("use_text_tags[" + i + "]", getFromList(useTextTags, i)); + } + } else { + map.put( + "use_text_tags", + JSON.getDefault().getMapper().writeValueAsString(useTextTags)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } + + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } + + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } + + private boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } + + private Object getFromList(Object obj, int index) throws Exception { + return Class.forName(java.util.List.class.getName()) + .getMethod("get", int.class) + .invoke(obj, index); + } + + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java index 1bb6397..6e6ed41 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftCreateResponse.java @@ -10,231 +10,220 @@ * 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.UnclaimedDraftResponse; -import com.dropbox.sign.model.WarningResponse; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * UnclaimedDraftCreateResponse - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) 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 = null; - - public UnclaimedDraftCreateResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftCreateResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateResponse.class); - } - - static public UnclaimedDraftCreateResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftCreateResponse.class - ); - } - - public UnclaimedDraftCreateResponse unclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { - this.unclaimedDraft = unclaimedDraft; - return this; - } - - /** - * Get unclaimedDraft - * @return unclaimedDraft - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public UnclaimedDraftResponse getUnclaimedDraft() { - return unclaimedDraft; - } - - - @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUnclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { - this.unclaimedDraft = unclaimedDraft; - } - - - public UnclaimedDraftCreateResponse warnings(List warnings) { - this.warnings = warnings; - return this; - } - - public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { - if (this.warnings == null) { - this.warnings = new ArrayList<>(); - } - this.warnings.add(warningsItem); - return this; - } - - /** - * A list of warnings. - * @return warnings - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWarnings() { - return warnings; - } - - - @JsonProperty(JSON_PROPERTY_WARNINGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWarnings(List warnings) { - this.warnings = warnings; - } - - - /** - * Return true if this UnclaimedDraftCreateResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftCreateResponse unclaimedDraftCreateResponse = (UnclaimedDraftCreateResponse) o; - return Objects.equals(this.unclaimedDraft, unclaimedDraftCreateResponse.unclaimedDraft) && - Objects.equals(this.warnings, unclaimedDraftCreateResponse.warnings); - } - - @Override - public int hashCode() { - return Objects.hash(unclaimedDraft, warnings); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftCreateResponse {\n"); - sb.append(" unclaimedDraft: ").append(toIndentedString(unclaimedDraft)).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 (unclaimedDraft != null) { - if (isFileTypeOrListOfFiles(unclaimedDraft)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_UNCLAIMED_DRAFT = "unclaimed_draft"; + private UnclaimedDraftResponse unclaimedDraft; - if (unclaimedDraft.getClass().equals(java.io.File.class) || - unclaimedDraft.getClass().equals(Integer.class) || - unclaimedDraft.getClass().equals(String.class) || - unclaimedDraft.getClass().isEnum()) { - map.put("unclaimed_draft", unclaimedDraft); - } else if (isListOfFile(unclaimedDraft)) { - for(int i = 0; i< getListSize(unclaimedDraft); i++) { - map.put("unclaimed_draft[" + i + "]", getFromList(unclaimedDraft, i)); - } - } - else { - map.put("unclaimed_draft", JSON.getDefault().getMapper().writeValueAsString(unclaimedDraft)); - } + public static final String JSON_PROPERTY_WARNINGS = "warnings"; + private List warnings = null; + + public UnclaimedDraftCreateResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftCreateResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftCreateResponse.class); + } + + public static UnclaimedDraftCreateResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftCreateResponse.class); + } + + public UnclaimedDraftCreateResponse unclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { + this.unclaimedDraft = unclaimedDraft; + return this; + } + + /** + * Get unclaimedDraft + * + * @return unclaimedDraft + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UnclaimedDraftResponse getUnclaimedDraft() { + return unclaimedDraft; + } + + @JsonProperty(JSON_PROPERTY_UNCLAIMED_DRAFT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUnclaimedDraft(UnclaimedDraftResponse unclaimedDraft) { + this.unclaimedDraft = unclaimedDraft; + } + + public UnclaimedDraftCreateResponse warnings(List warnings) { + this.warnings = warnings; + return this; } - if (warnings != null) { - if (isFileTypeOrListOfFiles(warnings)) { - fileTypeFound = true; + + public UnclaimedDraftCreateResponse addWarningsItem(WarningResponse warningsItem) { + if (this.warnings == null) { + this.warnings = new ArrayList<>(); } + this.warnings.add(warningsItem); + return this; + } - 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)); - } + /** + * A list of warnings. + * + * @return warnings + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWarnings() { + return warnings; + } + + @JsonProperty(JSON_PROPERTY_WARNINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWarnings(List warnings) { + this.warnings = warnings; + } + + /** Return true if this UnclaimedDraftCreateResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warnings", JSON.getDefault().getMapper().writeValueAsString(warnings)); + if (o == null || getClass() != o.getClass()) { + return false; } + UnclaimedDraftCreateResponse unclaimedDraftCreateResponse = + (UnclaimedDraftCreateResponse) o; + return Objects.equals(this.unclaimedDraft, unclaimedDraftCreateResponse.unclaimedDraft) + && Objects.equals(this.warnings, unclaimedDraftCreateResponse.warnings); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(unclaimedDraft, warnings); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftCreateResponse {\n"); + sb.append(" unclaimedDraft: ").append(toIndentedString(unclaimedDraft)).append("\n"); + sb.append(" warnings: ").append(toIndentedString(warnings)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (unclaimedDraft != null) { + if (isFileTypeOrListOfFiles(unclaimedDraft)) { + fileTypeFound = true; + } + + if (unclaimedDraft.getClass().equals(java.io.File.class) + || unclaimedDraft.getClass().equals(Integer.class) + || unclaimedDraft.getClass().equals(String.class) + || unclaimedDraft.getClass().isEnum()) { + map.put("unclaimed_draft", unclaimedDraft); + } else if (isListOfFile(unclaimedDraft)) { + for (int i = 0; i < getListSize(unclaimedDraft); i++) { + map.put("unclaimed_draft[" + i + "]", getFromList(unclaimedDraft, i)); + } + } else { + map.put( + "unclaimed_draft", + JSON.getDefault().getMapper().writeValueAsString(unclaimedDraft)); + } + } + 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 isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java index d8aaacb..eabad71 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftEditAndResendRequest.java @@ -10,520 +10,548 @@ * 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.SubEditorOptions; +import com.dropbox.sign.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * UnclaimedDraftEditAndResendRequest - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class UnclaimedDraftEditAndResendRequest { - public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; - private String clientId; - - public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; - private SubEditorOptions editorOptions; - - public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; - private Boolean isForEmbeddedSigning; - - public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; - private String requesterEmailAddress; - - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - private String requestingRedirectUrl; - - public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; - private Boolean showProgressStepper = true; + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode = false; - - public UnclaimedDraftEditAndResendRequest() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftEditAndResendRequest init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftEditAndResendRequest.class); - } + public static final String JSON_PROPERTY_EDITOR_OPTIONS = "editor_options"; + private SubEditorOptions editorOptions; - static public UnclaimedDraftEditAndResendRequest init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftEditAndResendRequest.class - ); - } + public static final String JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING = "is_for_embedded_signing"; + private Boolean isForEmbeddedSigning; - public UnclaimedDraftEditAndResendRequest clientId(String clientId) { - this.clientId = 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 - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClientId() { - return clientId; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClientId(String clientId) { - this.clientId = clientId; - } + public static final String JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS = "requester_email_address"; + private String requesterEmailAddress; + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + private String requestingRedirectUrl; - public UnclaimedDraftEditAndResendRequest editorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - return this; - } - - /** - * Get editorOptions - * @return editorOptions - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SubEditorOptions getEditorOptions() { - return editorOptions; - } - - - @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEditorOptions(SubEditorOptions editorOptions) { - this.editorOptions = editorOptions; - } - - - public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - return this; - } - - /** - * The request created from this draft will also be signable in embedded mode if set to `true`. - * @return isForEmbeddedSigning - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getIsForEmbeddedSigning() { - return isForEmbeddedSigning; - } - - - @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { - this.isForEmbeddedSigning = isForEmbeddedSigning; - } - - - public UnclaimedDraftEditAndResendRequest requesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - 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 - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequesterEmailAddress() { - return requesterEmailAddress; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequesterEmailAddress(String requesterEmailAddress) { - this.requesterEmailAddress = requesterEmailAddress; - } - - - public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully request a signature. - * @return requestingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - - public UnclaimedDraftEditAndResendRequest showProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = 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 - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getShowProgressStepper() { - return showProgressStepper; - } - - - @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShowProgressStepper(Boolean showProgressStepper) { - this.showProgressStepper = showProgressStepper; - } - - - public UnclaimedDraftEditAndResendRequest signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public UnclaimedDraftEditAndResendRequest testMode(Boolean testMode) { - this.testMode = 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 - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - /** - * Return true if this UnclaimedDraftEditAndResendRequest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest = (UnclaimedDraftEditAndResendRequest) o; - return Objects.equals(this.clientId, unclaimedDraftEditAndResendRequest.clientId) && - Objects.equals(this.editorOptions, unclaimedDraftEditAndResendRequest.editorOptions) && - Objects.equals(this.isForEmbeddedSigning, unclaimedDraftEditAndResendRequest.isForEmbeddedSigning) && - Objects.equals(this.requesterEmailAddress, unclaimedDraftEditAndResendRequest.requesterEmailAddress) && - Objects.equals(this.requestingRedirectUrl, unclaimedDraftEditAndResendRequest.requestingRedirectUrl) && - Objects.equals(this.showProgressStepper, unclaimedDraftEditAndResendRequest.showProgressStepper) && - Objects.equals(this.signingRedirectUrl, unclaimedDraftEditAndResendRequest.signingRedirectUrl) && - Objects.equals(this.testMode, unclaimedDraftEditAndResendRequest.testMode); - } - - @Override - public int hashCode() { - return Objects.hash(clientId, editorOptions, isForEmbeddedSigning, requesterEmailAddress, requestingRedirectUrl, showProgressStepper, signingRedirectUrl, testMode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftEditAndResendRequest {\n"); - sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); - sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); - sb.append(" isForEmbeddedSigning: ").append(toIndentedString(isForEmbeddedSigning)).append("\n"); - sb.append(" requesterEmailAddress: ").append(toIndentedString(requesterEmailAddress)).append("\n"); - sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); - sb.append(" showProgressStepper: ").append(toIndentedString(showProgressStepper)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (clientId != null) { - if (isFileTypeOrListOfFiles(clientId)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_SHOW_PROGRESS_STEPPER = "show_progress_stepper"; + private Boolean showProgressStepper = true; - if (clientId.getClass().equals(java.io.File.class) || - clientId.getClass().equals(Integer.class) || - clientId.getClass().equals(String.class) || - clientId.getClass().isEnum()) { - map.put("client_id", clientId); - } else if (isListOfFile(clientId)) { - for(int i = 0; i< getListSize(clientId); i++) { - map.put("client_id[" + i + "]", getFromList(clientId, i)); - } - } - else { - map.put("client_id", JSON.getDefault().getMapper().writeValueAsString(clientId)); - } + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode = false; + + public UnclaimedDraftEditAndResendRequest() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftEditAndResendRequest init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftEditAndResendRequest.class); } - if (editorOptions != null) { - if (isFileTypeOrListOfFiles(editorOptions)) { - fileTypeFound = true; - } - if (editorOptions.getClass().equals(java.io.File.class) || - editorOptions.getClass().equals(Integer.class) || - editorOptions.getClass().equals(String.class) || - editorOptions.getClass().isEnum()) { - map.put("editor_options", editorOptions); - } else if (isListOfFile(editorOptions)) { - for(int i = 0; i< getListSize(editorOptions); i++) { - map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); - } - } - else { - map.put("editor_options", JSON.getDefault().getMapper().writeValueAsString(editorOptions)); - } + public static UnclaimedDraftEditAndResendRequest init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), + UnclaimedDraftEditAndResendRequest.class); } - if (isForEmbeddedSigning != null) { - if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { - fileTypeFound = true; - } - if (isForEmbeddedSigning.getClass().equals(java.io.File.class) || - isForEmbeddedSigning.getClass().equals(Integer.class) || - isForEmbeddedSigning.getClass().equals(String.class) || - isForEmbeddedSigning.getClass().isEnum()) { - map.put("is_for_embedded_signing", isForEmbeddedSigning); - } else if (isListOfFile(isForEmbeddedSigning)) { - for(int i = 0; i< getListSize(isForEmbeddedSigning); i++) { - map.put("is_for_embedded_signing[" + i + "]", getFromList(isForEmbeddedSigning, i)); - } - } - else { - map.put("is_for_embedded_signing", JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); - } + public UnclaimedDraftEditAndResendRequest clientId(String clientId) { + this.clientId = clientId; + return this; } - if (requesterEmailAddress != null) { - if (isFileTypeOrListOfFiles(requesterEmailAddress)) { - fileTypeFound = true; - } - if (requesterEmailAddress.getClass().equals(java.io.File.class) || - requesterEmailAddress.getClass().equals(Integer.class) || - requesterEmailAddress.getClass().equals(String.class) || - requesterEmailAddress.getClass().isEnum()) { - map.put("requester_email_address", requesterEmailAddress); - } else if (isListOfFile(requesterEmailAddress)) { - for(int i = 0; i< getListSize(requesterEmailAddress); i++) { - map.put("requester_email_address[" + i + "]", getFromList(requesterEmailAddress, i)); - } - } - else { - map.put("requester_email_address", JSON.getDefault().getMapper().writeValueAsString(requesterEmailAddress)); - } + /** + * 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 + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClientId() { + return clientId; } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - if (requestingRedirectUrl.getClass().equals(java.io.File.class) || - requestingRedirectUrl.getClass().equals(Integer.class) || - requestingRedirectUrl.getClass().equals(String.class) || - requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { - map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); - } - } - else { - map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); - } + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClientId(String clientId) { + this.clientId = clientId; } - if (showProgressStepper != null) { - if (isFileTypeOrListOfFiles(showProgressStepper)) { - fileTypeFound = true; - } - if (showProgressStepper.getClass().equals(java.io.File.class) || - showProgressStepper.getClass().equals(Integer.class) || - showProgressStepper.getClass().equals(String.class) || - showProgressStepper.getClass().isEnum()) { - map.put("show_progress_stepper", showProgressStepper); - } else if (isListOfFile(showProgressStepper)) { - for(int i = 0; i< getListSize(showProgressStepper); i++) { - map.put("show_progress_stepper[" + i + "]", getFromList(showProgressStepper, i)); - } - } - else { - map.put("show_progress_stepper", JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); - } + public UnclaimedDraftEditAndResendRequest editorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + return this; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + /** + * Get editorOptions + * + * @return editorOptions + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubEditorOptions getEditorOptions() { + return editorOptions; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } + @JsonProperty(JSON_PROPERTY_EDITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEditorOptions(SubEditorOptions editorOptions) { + this.editorOptions = editorOptions; + } + + public UnclaimedDraftEditAndResendRequest isForEmbeddedSigning(Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + return this; + } + + /** + * The request created from this draft will also be signable in embedded mode if set to + * `true`. + * + * @return isForEmbeddedSigning + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsForEmbeddedSigning() { + return isForEmbeddedSigning; + } + + @JsonProperty(JSON_PROPERTY_IS_FOR_EMBEDDED_SIGNING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsForEmbeddedSigning(Boolean isForEmbeddedSigning) { + this.isForEmbeddedSigning = isForEmbeddedSigning; + } + + public UnclaimedDraftEditAndResendRequest requesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + 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 @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequesterEmailAddress() { + return requesterEmailAddress; + } + + @JsonProperty(JSON_PROPERTY_REQUESTER_EMAIL_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequesterEmailAddress(String requesterEmailAddress) { + this.requesterEmailAddress = requesterEmailAddress; + } + + public UnclaimedDraftEditAndResendRequest requestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully request a signature. + * + * @return requestingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + public UnclaimedDraftEditAndResendRequest showProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = 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 @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getShowProgressStepper() { + return showProgressStepper; + } + + @JsonProperty(JSON_PROPERTY_SHOW_PROGRESS_STEPPER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShowProgressStepper(Boolean showProgressStepper) { + this.showProgressStepper = showProgressStepper; + } + + public UnclaimedDraftEditAndResendRequest signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public UnclaimedDraftEditAndResendRequest testMode(Boolean testMode) { + this.testMode = 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 @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + /** Return true if this UnclaimedDraftEditAndResendRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + if (o == null || getClass() != o.getClass()) { + return false; } + UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest = + (UnclaimedDraftEditAndResendRequest) o; + return Objects.equals(this.clientId, unclaimedDraftEditAndResendRequest.clientId) + && Objects.equals( + this.editorOptions, unclaimedDraftEditAndResendRequest.editorOptions) + && Objects.equals( + this.isForEmbeddedSigning, + unclaimedDraftEditAndResendRequest.isForEmbeddedSigning) + && Objects.equals( + this.requesterEmailAddress, + unclaimedDraftEditAndResendRequest.requesterEmailAddress) + && Objects.equals( + this.requestingRedirectUrl, + unclaimedDraftEditAndResendRequest.requestingRedirectUrl) + && Objects.equals( + this.showProgressStepper, + unclaimedDraftEditAndResendRequest.showProgressStepper) + && Objects.equals( + this.signingRedirectUrl, + unclaimedDraftEditAndResendRequest.signingRedirectUrl) + && Objects.equals(this.testMode, unclaimedDraftEditAndResendRequest.testMode); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + clientId, + editorOptions, + isForEmbeddedSigning, + requesterEmailAddress, + requestingRedirectUrl, + showProgressStepper, + signingRedirectUrl, + testMode); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftEditAndResendRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" editorOptions: ").append(toIndentedString(editorOptions)).append("\n"); + sb.append(" isForEmbeddedSigning: ") + .append(toIndentedString(isForEmbeddedSigning)) + .append("\n"); + sb.append(" requesterEmailAddress: ") + .append(toIndentedString(requesterEmailAddress)) + .append("\n"); + sb.append(" requestingRedirectUrl: ") + .append(toIndentedString(requestingRedirectUrl)) + .append("\n"); + sb.append(" showProgressStepper: ") + .append(toIndentedString(showProgressStepper)) + .append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (clientId != null) { + if (isFileTypeOrListOfFiles(clientId)) { + fileTypeFound = true; + } + + if (clientId.getClass().equals(java.io.File.class) + || clientId.getClass().equals(Integer.class) + || clientId.getClass().equals(String.class) + || clientId.getClass().isEnum()) { + map.put("client_id", clientId); + } else if (isListOfFile(clientId)) { + for (int i = 0; i < getListSize(clientId); i++) { + map.put("client_id[" + i + "]", getFromList(clientId, i)); + } + } else { + map.put( + "client_id", + JSON.getDefault().getMapper().writeValueAsString(clientId)); + } + } + if (editorOptions != null) { + if (isFileTypeOrListOfFiles(editorOptions)) { + fileTypeFound = true; + } + + if (editorOptions.getClass().equals(java.io.File.class) + || editorOptions.getClass().equals(Integer.class) + || editorOptions.getClass().equals(String.class) + || editorOptions.getClass().isEnum()) { + map.put("editor_options", editorOptions); + } else if (isListOfFile(editorOptions)) { + for (int i = 0; i < getListSize(editorOptions); i++) { + map.put("editor_options[" + i + "]", getFromList(editorOptions, i)); + } + } else { + map.put( + "editor_options", + JSON.getDefault().getMapper().writeValueAsString(editorOptions)); + } + } + if (isForEmbeddedSigning != null) { + if (isFileTypeOrListOfFiles(isForEmbeddedSigning)) { + fileTypeFound = true; + } + + if (isForEmbeddedSigning.getClass().equals(java.io.File.class) + || isForEmbeddedSigning.getClass().equals(Integer.class) + || isForEmbeddedSigning.getClass().equals(String.class) + || isForEmbeddedSigning.getClass().isEnum()) { + map.put("is_for_embedded_signing", isForEmbeddedSigning); + } else if (isListOfFile(isForEmbeddedSigning)) { + for (int i = 0; i < getListSize(isForEmbeddedSigning); i++) { + map.put( + "is_for_embedded_signing[" + i + "]", + getFromList(isForEmbeddedSigning, i)); + } + } else { + map.put( + "is_for_embedded_signing", + JSON.getDefault().getMapper().writeValueAsString(isForEmbeddedSigning)); + } + } + if (requesterEmailAddress != null) { + if (isFileTypeOrListOfFiles(requesterEmailAddress)) { + fileTypeFound = true; + } + + if (requesterEmailAddress.getClass().equals(java.io.File.class) + || requesterEmailAddress.getClass().equals(Integer.class) + || requesterEmailAddress.getClass().equals(String.class) + || requesterEmailAddress.getClass().isEnum()) { + map.put("requester_email_address", requesterEmailAddress); + } else if (isListOfFile(requesterEmailAddress)) { + for (int i = 0; i < getListSize(requesterEmailAddress); i++) { + map.put( + "requester_email_address[" + i + "]", + getFromList(requesterEmailAddress, i)); + } + } else { + map.put( + "requester_email_address", + JSON.getDefault() + .getMapper() + .writeValueAsString(requesterEmailAddress)); + } + } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } + + if (requestingRedirectUrl.getClass().equals(java.io.File.class) + || requestingRedirectUrl.getClass().equals(Integer.class) + || requestingRedirectUrl.getClass().equals(String.class) + || requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { + map.put( + "requesting_redirect_url[" + i + "]", + getFromList(requestingRedirectUrl, i)); + } + } else { + map.put( + "requesting_redirect_url", + JSON.getDefault() + .getMapper() + .writeValueAsString(requestingRedirectUrl)); + } + } + if (showProgressStepper != null) { + if (isFileTypeOrListOfFiles(showProgressStepper)) { + fileTypeFound = true; + } + + if (showProgressStepper.getClass().equals(java.io.File.class) + || showProgressStepper.getClass().equals(Integer.class) + || showProgressStepper.getClass().equals(String.class) + || showProgressStepper.getClass().isEnum()) { + map.put("show_progress_stepper", showProgressStepper); + } else if (isListOfFile(showProgressStepper)) { + for (int i = 0; i < getListSize(showProgressStepper); i++) { + map.put( + "show_progress_stepper[" + i + "]", + getFromList(showProgressStepper, i)); + } + } else { + map.put( + "show_progress_stepper", + JSON.getDefault().getMapper().writeValueAsString(showProgressStepper)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java b/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java index 261ccf5..7de5a3e 100644 --- a/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java +++ b/src/main/java/com/dropbox/sign/model/UnclaimedDraftResponse.java @@ -10,419 +10,424 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * A group of documents that a user can take ownership of via the claim URL. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class UnclaimedDraftResponse { - public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; - private String signatureRequestId; - - public static final String JSON_PROPERTY_CLAIM_URL = "claim_url"; - private String claimUrl; - - public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; - private String signingRedirectUrl; - - public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; - private String requestingRedirectUrl; - - public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - private Integer expiresAt; - - public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; - private Boolean testMode; - - public UnclaimedDraftResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public UnclaimedDraftResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, UnclaimedDraftResponse.class); - } - - static public UnclaimedDraftResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - UnclaimedDraftResponse.class - ); - } - - public UnclaimedDraftResponse signatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - return this; - } - - /** - * The ID of the signature request that is represented by this UnclaimedDraft. - * @return signatureRequestId - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSignatureRequestId() { - return signatureRequestId; - } - - - @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignatureRequestId(String signatureRequestId) { - this.signatureRequestId = signatureRequestId; - } - - - public UnclaimedDraftResponse claimUrl(String claimUrl) { - this.claimUrl = claimUrl; - return this; - } - - /** - * The URL to be used to claim this UnclaimedDraft. - * @return claimUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CLAIM_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClaimUrl() { - return claimUrl; - } - - - @JsonProperty(JSON_PROPERTY_CLAIM_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClaimUrl(String claimUrl) { - this.claimUrl = claimUrl; - } - - - public UnclaimedDraftResponse signingRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - return this; - } - - /** - * The URL you want signers redirected to after they successfully sign. - * @return signingRedirectUrl - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSigningRedirectUrl() { - return signingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningRedirectUrl(String signingRedirectUrl) { - this.signingRedirectUrl = signingRedirectUrl; - } - - - public UnclaimedDraftResponse requestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = 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 - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getRequestingRedirectUrl() { - return requestingRedirectUrl; - } - - - @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestingRedirectUrl(String requestingRedirectUrl) { - this.requestingRedirectUrl = requestingRedirectUrl; - } - - - public UnclaimedDraftResponse expiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * When the link expires. - * @return expiresAt - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getExpiresAt() { - return expiresAt; - } - - - @JsonProperty(JSON_PROPERTY_EXPIRES_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(Integer expiresAt) { - this.expiresAt = expiresAt; - } - - - public UnclaimedDraftResponse testMode(Boolean testMode) { - this.testMode = testMode; - return this; - } - - /** - * Whether this is a test draft. Signature requests made from test drafts have no legal value. - * @return testMode - */ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getTestMode() { - return testMode; - } - - - @JsonProperty(JSON_PROPERTY_TEST_MODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTestMode(Boolean testMode) { - this.testMode = testMode; - } - - - /** - * Return true if this UnclaimedDraftResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static final String JSON_PROPERTY_SIGNATURE_REQUEST_ID = "signature_request_id"; + private String signatureRequestId; + + public static final String JSON_PROPERTY_CLAIM_URL = "claim_url"; + private String claimUrl; + + public static final String JSON_PROPERTY_SIGNING_REDIRECT_URL = "signing_redirect_url"; + private String signingRedirectUrl; + + public static final String JSON_PROPERTY_REQUESTING_REDIRECT_URL = "requesting_redirect_url"; + private String requestingRedirectUrl; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Integer expiresAt; + + public static final String JSON_PROPERTY_TEST_MODE = "test_mode"; + private Boolean testMode; + + public UnclaimedDraftResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static UnclaimedDraftResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, UnclaimedDraftResponse.class); } - if (o == null || getClass() != o.getClass()) { - return false; + + public static UnclaimedDraftResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue( + new ObjectMapper().writeValueAsString(data), UnclaimedDraftResponse.class); } - UnclaimedDraftResponse unclaimedDraftResponse = (UnclaimedDraftResponse) o; - return Objects.equals(this.signatureRequestId, unclaimedDraftResponse.signatureRequestId) && - Objects.equals(this.claimUrl, unclaimedDraftResponse.claimUrl) && - Objects.equals(this.signingRedirectUrl, unclaimedDraftResponse.signingRedirectUrl) && - Objects.equals(this.requestingRedirectUrl, unclaimedDraftResponse.requestingRedirectUrl) && - Objects.equals(this.expiresAt, unclaimedDraftResponse.expiresAt) && - Objects.equals(this.testMode, unclaimedDraftResponse.testMode); - } - - @Override - public int hashCode() { - return Objects.hash(signatureRequestId, claimUrl, signingRedirectUrl, requestingRedirectUrl, expiresAt, testMode); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UnclaimedDraftResponse {\n"); - sb.append(" signatureRequestId: ").append(toIndentedString(signatureRequestId)).append("\n"); - sb.append(" claimUrl: ").append(toIndentedString(claimUrl)).append("\n"); - sb.append(" signingRedirectUrl: ").append(toIndentedString(signingRedirectUrl)).append("\n"); - sb.append(" requestingRedirectUrl: ").append(toIndentedString(requestingRedirectUrl)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (signatureRequestId != null) { - if (isFileTypeOrListOfFiles(signatureRequestId)) { - fileTypeFound = true; - } - if (signatureRequestId.getClass().equals(java.io.File.class) || - signatureRequestId.getClass().equals(Integer.class) || - signatureRequestId.getClass().equals(String.class) || - signatureRequestId.getClass().isEnum()) { - map.put("signature_request_id", signatureRequestId); - } else if (isListOfFile(signatureRequestId)) { - for(int i = 0; i< getListSize(signatureRequestId); i++) { - map.put("signature_request_id[" + i + "]", getFromList(signatureRequestId, i)); - } - } - else { - map.put("signature_request_id", JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); - } + public UnclaimedDraftResponse signatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; + return this; } - if (claimUrl != null) { - if (isFileTypeOrListOfFiles(claimUrl)) { - fileTypeFound = true; - } - if (claimUrl.getClass().equals(java.io.File.class) || - claimUrl.getClass().equals(Integer.class) || - claimUrl.getClass().equals(String.class) || - claimUrl.getClass().isEnum()) { - map.put("claim_url", claimUrl); - } else if (isListOfFile(claimUrl)) { - for(int i = 0; i< getListSize(claimUrl); i++) { - map.put("claim_url[" + i + "]", getFromList(claimUrl, i)); - } - } - else { - map.put("claim_url", JSON.getDefault().getMapper().writeValueAsString(claimUrl)); - } + /** + * The ID of the signature request that is represented by this UnclaimedDraft. + * + * @return signatureRequestId + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSignatureRequestId() { + return signatureRequestId; } - if (signingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(signingRedirectUrl)) { - fileTypeFound = true; - } - if (signingRedirectUrl.getClass().equals(java.io.File.class) || - signingRedirectUrl.getClass().equals(Integer.class) || - signingRedirectUrl.getClass().equals(String.class) || - signingRedirectUrl.getClass().isEnum()) { - map.put("signing_redirect_url", signingRedirectUrl); - } else if (isListOfFile(signingRedirectUrl)) { - for(int i = 0; i< getListSize(signingRedirectUrl); i++) { - map.put("signing_redirect_url[" + i + "]", getFromList(signingRedirectUrl, i)); - } - } - else { - map.put("signing_redirect_url", JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); - } + @JsonProperty(JSON_PROPERTY_SIGNATURE_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignatureRequestId(String signatureRequestId) { + this.signatureRequestId = signatureRequestId; } - if (requestingRedirectUrl != null) { - if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { - fileTypeFound = true; - } - if (requestingRedirectUrl.getClass().equals(java.io.File.class) || - requestingRedirectUrl.getClass().equals(Integer.class) || - requestingRedirectUrl.getClass().equals(String.class) || - requestingRedirectUrl.getClass().isEnum()) { - map.put("requesting_redirect_url", requestingRedirectUrl); - } else if (isListOfFile(requestingRedirectUrl)) { - for(int i = 0; i< getListSize(requestingRedirectUrl); i++) { - map.put("requesting_redirect_url[" + i + "]", getFromList(requestingRedirectUrl, i)); - } - } - else { - map.put("requesting_redirect_url", JSON.getDefault().getMapper().writeValueAsString(requestingRedirectUrl)); - } + public UnclaimedDraftResponse claimUrl(String claimUrl) { + this.claimUrl = claimUrl; + return this; } - if (expiresAt != null) { - if (isFileTypeOrListOfFiles(expiresAt)) { - fileTypeFound = true; - } - if (expiresAt.getClass().equals(java.io.File.class) || - expiresAt.getClass().equals(Integer.class) || - expiresAt.getClass().equals(String.class) || - expiresAt.getClass().isEnum()) { - map.put("expires_at", expiresAt); - } else if (isListOfFile(expiresAt)) { - for(int i = 0; i< getListSize(expiresAt); i++) { - map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); - } - } - else { - map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt)); - } + /** + * The URL to be used to claim this UnclaimedDraft. + * + * @return claimUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_CLAIM_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClaimUrl() { + return claimUrl; } - if (testMode != null) { - if (isFileTypeOrListOfFiles(testMode)) { - fileTypeFound = true; - } - if (testMode.getClass().equals(java.io.File.class) || - testMode.getClass().equals(Integer.class) || - testMode.getClass().equals(String.class) || - testMode.getClass().isEnum()) { - map.put("test_mode", testMode); - } else if (isListOfFile(testMode)) { - for(int i = 0; i< getListSize(testMode); i++) { - map.put("test_mode[" + i + "]", getFromList(testMode, i)); - } + @JsonProperty(JSON_PROPERTY_CLAIM_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClaimUrl(String claimUrl) { + this.claimUrl = claimUrl; + } + + public UnclaimedDraftResponse signingRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + return this; + } + + /** + * The URL you want signers redirected to after they successfully sign. + * + * @return signingRedirectUrl + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSigningRedirectUrl() { + return signingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSigningRedirectUrl(String signingRedirectUrl) { + this.signingRedirectUrl = signingRedirectUrl; + } + + public UnclaimedDraftResponse requestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = 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 @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestingRedirectUrl() { + return requestingRedirectUrl; + } + + @JsonProperty(JSON_PROPERTY_REQUESTING_REDIRECT_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestingRedirectUrl(String requestingRedirectUrl) { + this.requestingRedirectUrl = requestingRedirectUrl; + } + + public UnclaimedDraftResponse expiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * When the link expires. + * + * @return expiresAt + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getExpiresAt() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Integer expiresAt) { + this.expiresAt = expiresAt; + } + + public UnclaimedDraftResponse testMode(Boolean testMode) { + this.testMode = testMode; + return this; + } + + /** + * Whether this is a test draft. Signature requests made from test drafts have no legal value. + * + * @return testMode + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTestMode() { + return testMode; + } + + @JsonProperty(JSON_PROPERTY_TEST_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTestMode(Boolean testMode) { + this.testMode = testMode; + } + + /** Return true if this UnclaimedDraftResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("test_mode", JSON.getDefault().getMapper().writeValueAsString(testMode)); + if (o == null || getClass() != o.getClass()) { + return false; } + UnclaimedDraftResponse unclaimedDraftResponse = (UnclaimedDraftResponse) o; + return Objects.equals(this.signatureRequestId, unclaimedDraftResponse.signatureRequestId) + && Objects.equals(this.claimUrl, unclaimedDraftResponse.claimUrl) + && Objects.equals( + this.signingRedirectUrl, unclaimedDraftResponse.signingRedirectUrl) + && Objects.equals( + this.requestingRedirectUrl, unclaimedDraftResponse.requestingRedirectUrl) + && Objects.equals(this.expiresAt, unclaimedDraftResponse.expiresAt) + && Objects.equals(this.testMode, unclaimedDraftResponse.testMode); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash( + signatureRequestId, + claimUrl, + signingRedirectUrl, + requestingRedirectUrl, + expiresAt, + testMode); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnclaimedDraftResponse {\n"); + sb.append(" signatureRequestId: ") + .append(toIndentedString(signatureRequestId)) + .append("\n"); + sb.append(" claimUrl: ").append(toIndentedString(claimUrl)).append("\n"); + sb.append(" signingRedirectUrl: ") + .append(toIndentedString(signingRedirectUrl)) + .append("\n"); + sb.append(" requestingRedirectUrl: ") + .append(toIndentedString(requestingRedirectUrl)) + .append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" testMode: ").append(toIndentedString(testMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (signatureRequestId != null) { + if (isFileTypeOrListOfFiles(signatureRequestId)) { + fileTypeFound = true; + } + + if (signatureRequestId.getClass().equals(java.io.File.class) + || signatureRequestId.getClass().equals(Integer.class) + || signatureRequestId.getClass().equals(String.class) + || signatureRequestId.getClass().isEnum()) { + map.put("signature_request_id", signatureRequestId); + } else if (isListOfFile(signatureRequestId)) { + for (int i = 0; i < getListSize(signatureRequestId); i++) { + map.put( + "signature_request_id[" + i + "]", + getFromList(signatureRequestId, i)); + } + } else { + map.put( + "signature_request_id", + JSON.getDefault().getMapper().writeValueAsString(signatureRequestId)); + } + } + if (claimUrl != null) { + if (isFileTypeOrListOfFiles(claimUrl)) { + fileTypeFound = true; + } + + if (claimUrl.getClass().equals(java.io.File.class) + || claimUrl.getClass().equals(Integer.class) + || claimUrl.getClass().equals(String.class) + || claimUrl.getClass().isEnum()) { + map.put("claim_url", claimUrl); + } else if (isListOfFile(claimUrl)) { + for (int i = 0; i < getListSize(claimUrl); i++) { + map.put("claim_url[" + i + "]", getFromList(claimUrl, i)); + } + } else { + map.put( + "claim_url", + JSON.getDefault().getMapper().writeValueAsString(claimUrl)); + } + } + if (signingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(signingRedirectUrl)) { + fileTypeFound = true; + } + + if (signingRedirectUrl.getClass().equals(java.io.File.class) + || signingRedirectUrl.getClass().equals(Integer.class) + || signingRedirectUrl.getClass().equals(String.class) + || signingRedirectUrl.getClass().isEnum()) { + map.put("signing_redirect_url", signingRedirectUrl); + } else if (isListOfFile(signingRedirectUrl)) { + for (int i = 0; i < getListSize(signingRedirectUrl); i++) { + map.put( + "signing_redirect_url[" + i + "]", + getFromList(signingRedirectUrl, i)); + } + } else { + map.put( + "signing_redirect_url", + JSON.getDefault().getMapper().writeValueAsString(signingRedirectUrl)); + } + } + if (requestingRedirectUrl != null) { + if (isFileTypeOrListOfFiles(requestingRedirectUrl)) { + fileTypeFound = true; + } + + if (requestingRedirectUrl.getClass().equals(java.io.File.class) + || requestingRedirectUrl.getClass().equals(Integer.class) + || requestingRedirectUrl.getClass().equals(String.class) + || requestingRedirectUrl.getClass().isEnum()) { + map.put("requesting_redirect_url", requestingRedirectUrl); + } else if (isListOfFile(requestingRedirectUrl)) { + for (int i = 0; i < getListSize(requestingRedirectUrl); i++) { + map.put( + "requesting_redirect_url[" + i + "]", + getFromList(requestingRedirectUrl, i)); + } + } else { + map.put( + "requesting_redirect_url", + JSON.getDefault() + .getMapper() + .writeValueAsString(requestingRedirectUrl)); + } + } + if (expiresAt != null) { + if (isFileTypeOrListOfFiles(expiresAt)) { + fileTypeFound = true; + } + + if (expiresAt.getClass().equals(java.io.File.class) + || expiresAt.getClass().equals(Integer.class) + || expiresAt.getClass().equals(String.class) + || expiresAt.getClass().isEnum()) { + map.put("expires_at", expiresAt); + } else if (isListOfFile(expiresAt)) { + for (int i = 0; i < getListSize(expiresAt); i++) { + map.put("expires_at[" + i + "]", getFromList(expiresAt, i)); + } + } else { + map.put( + "expires_at", + JSON.getDefault().getMapper().writeValueAsString(expiresAt)); + } + } + if (testMode != null) { + if (isFileTypeOrListOfFiles(testMode)) { + fileTypeFound = true; + } + + if (testMode.getClass().equals(java.io.File.class) + || testMode.getClass().equals(Integer.class) + || testMode.getClass().equals(String.class) + || testMode.getClass().isEnum()) { + map.put("test_mode", testMode); + } else if (isListOfFile(testMode)) { + for (int i = 0; i < getListSize(testMode); i++) { + map.put("test_mode[" + i + "]", getFromList(testMode, i)); + } + } else { + map.put( + "test_mode", + JSON.getDefault().getMapper().writeValueAsString(testMode)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + return fileTypeFound ? map : new HashMap<>(); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/main/java/com/dropbox/sign/model/WarningResponse.java b/src/main/java/com/dropbox/sign/model/WarningResponse.java index 96374e9..acbd565 100644 --- a/src/main/java/com/dropbox/sign/model/WarningResponse.java +++ b/src/main/java/com/dropbox/sign/model/WarningResponse.java @@ -10,219 +10,210 @@ * 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.ApiException; +import com.dropbox.sign.JSON; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.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 java.util.HashMap; +import java.util.Map; +import java.util.Objects; - -import com.dropbox.sign.ApiException; -/** - * A list of warnings. - */ +/** 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", + comments = "Generator version: 7.8.0") +@JsonIgnoreProperties(ignoreUnknown = true) public class WarningResponse { - public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; - private String warningMsg; - - public static final String JSON_PROPERTY_WARNING_NAME = "warning_name"; - private String warningName; - - public WarningResponse() { - } - - /** - * Attempt to instantiate and hydrate a new instance of this class - * @param jsonData String of JSON data representing target object - */ - static public WarningResponse init(String jsonData) throws Exception { - return new ObjectMapper().readValue(jsonData, WarningResponse.class); - } - - static public WarningResponse init(HashMap data) throws Exception { - return new ObjectMapper().readValue( - new ObjectMapper().writeValueAsString(data), - WarningResponse.class - ); - } - - public WarningResponse warningMsg(String warningMsg) { - this.warningMsg = warningMsg; - return this; - } - - /** - * Warning message - * @return warningMsg - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WARNING_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getWarningMsg() { - return warningMsg; - } - - - @JsonProperty(JSON_PROPERTY_WARNING_MSG) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWarningMsg(String warningMsg) { - this.warningMsg = warningMsg; - } - - - public WarningResponse warningName(String warningName) { - this.warningName = warningName; - return this; - } - - /** - * Warning name - * @return warningName - */ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_WARNING_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getWarningName() { - return warningName; - } - - - @JsonProperty(JSON_PROPERTY_WARNING_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setWarningName(String warningName) { - this.warningName = warningName; - } - - - /** - * Return true if this WarningResponse object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - WarningResponse warningResponse = (WarningResponse) o; - return Objects.equals(this.warningMsg, warningResponse.warningMsg) && - Objects.equals(this.warningName, warningResponse.warningName); - } - - @Override - public int hashCode() { - return Objects.hash(warningMsg, warningName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class WarningResponse {\n"); - sb.append(" warningMsg: ").append(toIndentedString(warningMsg)).append("\n"); - sb.append(" warningName: ").append(toIndentedString(warningName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public Map createFormData() throws ApiException { - Map map = new HashMap<>(); - boolean fileTypeFound = false; - try { - if (warningMsg != null) { - if (isFileTypeOrListOfFiles(warningMsg)) { - fileTypeFound = true; - } + public static final String JSON_PROPERTY_WARNING_MSG = "warning_msg"; + private String warningMsg; - if (warningMsg.getClass().equals(java.io.File.class) || - warningMsg.getClass().equals(Integer.class) || - warningMsg.getClass().equals(String.class) || - warningMsg.getClass().isEnum()) { - map.put("warning_msg", warningMsg); - } else if (isListOfFile(warningMsg)) { - for(int i = 0; i< getListSize(warningMsg); i++) { - map.put("warning_msg[" + i + "]", getFromList(warningMsg, i)); - } - } - else { - map.put("warning_msg", JSON.getDefault().getMapper().writeValueAsString(warningMsg)); - } + public static final String JSON_PROPERTY_WARNING_NAME = "warning_name"; + private String warningName; + + public WarningResponse() {} + + /** + * Attempt to instantiate and hydrate a new instance of this class + * + * @param jsonData String of JSON data representing target object + */ + public static WarningResponse init(String jsonData) throws Exception { + return new ObjectMapper().readValue(jsonData, WarningResponse.class); } - if (warningName != null) { - if (isFileTypeOrListOfFiles(warningName)) { - fileTypeFound = true; - } - if (warningName.getClass().equals(java.io.File.class) || - warningName.getClass().equals(Integer.class) || - warningName.getClass().equals(String.class) || - warningName.getClass().isEnum()) { - map.put("warning_name", warningName); - } else if (isListOfFile(warningName)) { - for(int i = 0; i< getListSize(warningName); i++) { - map.put("warning_name[" + i + "]", getFromList(warningName, i)); - } + public static WarningResponse init(HashMap data) throws Exception { + return new ObjectMapper() + .readValue(new ObjectMapper().writeValueAsString(data), WarningResponse.class); + } + + public WarningResponse warningMsg(String warningMsg) { + this.warningMsg = warningMsg; + return this; + } + + /** + * Warning message + * + * @return warningMsg + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNING_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWarningMsg() { + return warningMsg; + } + + @JsonProperty(JSON_PROPERTY_WARNING_MSG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarningMsg(String warningMsg) { + this.warningMsg = warningMsg; + } + + public WarningResponse warningName(String warningName) { + this.warningName = warningName; + return this; + } + + /** + * Warning name + * + * @return warningName + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_WARNING_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWarningName() { + return warningName; + } + + @JsonProperty(JSON_PROPERTY_WARNING_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWarningName(String warningName) { + this.warningName = warningName; + } + + /** Return true if this WarningResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - else { - map.put("warning_name", JSON.getDefault().getMapper().writeValueAsString(warningName)); + if (o == null || getClass() != o.getClass()) { + return false; } + WarningResponse warningResponse = (WarningResponse) o; + return Objects.equals(this.warningMsg, warningResponse.warningMsg) + && Objects.equals(this.warningName, warningResponse.warningName); } - } catch (Exception e) { - throw new ApiException(e); + + @Override + public int hashCode() { + return Objects.hash(warningMsg, warningName); } - return fileTypeFound ? map : new HashMap<>(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WarningResponse {\n"); + sb.append(" warningMsg: ").append(toIndentedString(warningMsg)).append("\n"); + sb.append(" warningName: ").append(toIndentedString(warningName)).append("\n"); + sb.append("}"); + return sb.toString(); + } - private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { - return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); - } + public Map createFormData() throws ApiException { + Map map = new HashMap<>(); + boolean fileTypeFound = false; + try { + if (warningMsg != null) { + if (isFileTypeOrListOfFiles(warningMsg)) { + fileTypeFound = true; + } + + if (warningMsg.getClass().equals(java.io.File.class) + || warningMsg.getClass().equals(Integer.class) + || warningMsg.getClass().equals(String.class) + || warningMsg.getClass().isEnum()) { + map.put("warning_msg", warningMsg); + } else if (isListOfFile(warningMsg)) { + for (int i = 0; i < getListSize(warningMsg); i++) { + map.put("warning_msg[" + i + "]", getFromList(warningMsg, i)); + } + } else { + map.put( + "warning_msg", + JSON.getDefault().getMapper().writeValueAsString(warningMsg)); + } + } + if (warningName != null) { + if (isFileTypeOrListOfFiles(warningName)) { + fileTypeFound = true; + } + + if (warningName.getClass().equals(java.io.File.class) + || warningName.getClass().equals(Integer.class) + || warningName.getClass().equals(String.class) + || warningName.getClass().isEnum()) { + map.put("warning_name", warningName); + } else if (isListOfFile(warningName)) { + for (int i = 0; i < getListSize(warningName); i++) { + map.put("warning_name[" + i + "]", getFromList(warningName, i)); + } + } else { + map.put( + "warning_name", + JSON.getDefault().getMapper().writeValueAsString(warningName)); + } + } + } catch (Exception e) { + throw new ApiException(e); + } - private boolean isListOfFile(Object obj) throws Exception { - return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File; - } + return fileTypeFound ? map : new HashMap<>(); + } + + private boolean isFileTypeOrListOfFiles(Object obj) throws Exception { + return obj.getClass().equals(java.io.File.class) || isListOfFile(obj); + } - private boolean isListEmpty(Object obj) throws Exception { - return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); - } + private boolean isListOfFile(Object obj) throws Exception { + return obj instanceof java.util.List + && !isListEmpty(obj) + && getFromList(obj, 0) instanceof java.io.File; + } - 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 boolean isListEmpty(Object obj) throws Exception { + return (boolean) + Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj); + } - private int getListSize(Object obj) throws Exception { - return (int) Class.forName(java.util.List.class.getName()).getMethod("size").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); + } - /** - * 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"; + private int getListSize(Object obj) throws Exception { + return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj); } - return o.toString().replace("\n", "\n "); - } + /** + * 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/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java b/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java index 8bd0c74..cbbbccd 100644 --- a/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java +++ b/src/test/java/com/dropbox/sign/EventCallbackHelperTest.java @@ -1,56 +1,48 @@ package com.dropbox.sign; -import com.dropbox.sign.model.ApiAppCreateRequest; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.model.EventCallbackRequest; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; 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; +import com.dropbox.sign.model.EventCallbackRequest; +import com.fasterxml.jackson.databind.JsonNode; import java.util.Arrays; import java.util.List; +import org.junit.jupiter.api.Test; public class EventCallbackHelperTest { - public static final String APIKEY = "324e3b0840f065eb51f3fd63231d0d33daa35d4ed10d27718839e81737065782"; + public static final String APIKEY = + "324e3b0840f065eb51f3fd63231d0d33daa35d4ed10d27718839e81737065782"; @Test public void testIsValid() throws Exception { String reverseApiKey = new StringBuilder(APIKEY).reverse().toString(); - List account_keys = Arrays.asList( - "base", - "base_no_metadata", - "account", - "account_no_metadata", - "signature_request", - "signature_request_no_metadata", - "template", - "template_no_metadata" - ); + List account_keys = + Arrays.asList( + "base", + "base_no_metadata", + "account", + "account_no_metadata", + "signature_request", + "signature_request_no_metadata", + "template", + "template_no_metadata"); for (String key : account_keys) { - JsonNode content = TestHelper.getJsonContents("EventCallbackHelper_AccountCallbacks", key); + JsonNode content = + TestHelper.getJsonContents("EventCallbackHelper_AccountCallbacks", key); EventCallbackRequest callbackEvent = EventCallbackRequest.init(content.toString()); assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); assertEquals( - EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK, - EventCallbackHelper.getCallbackType(callbackEvent) - ); + EventCallbackHelper.EVENT_TYPE_ACCOUNT_CALLBACK, + EventCallbackHelper.getCallbackType(callbackEvent)); } - List app_keys = Arrays.asList( - "base", - "account", - "signature_request", - "template" - ); + List app_keys = Arrays.asList("base", "account", "signature_request", "template"); for (String key : app_keys) { JsonNode content = TestHelper.getJsonContents("EventCallbackHelper_AppCallbacks", key); @@ -60,9 +52,8 @@ public void testIsValid() throws Exception { assertTrue(EventCallbackHelper.isValid(APIKEY, callbackEvent)); assertFalse(EventCallbackHelper.isValid(reverseApiKey, callbackEvent)); assertEquals( - EventCallbackHelper.EVENT_TYPE_APP_CALLBACK, - EventCallbackHelper.getCallbackType(callbackEvent) - ); + EventCallbackHelper.EVENT_TYPE_APP_CALLBACK, + EventCallbackHelper.getCallbackType(callbackEvent)); } } } diff --git a/src/test/java/com/dropbox/sign/FixtureTest.java b/src/test/java/com/dropbox/sign/FixtureTest.java index d173e8d..3332ebc 100644 --- a/src/test/java/com/dropbox/sign/FixtureTest.java +++ b/src/test/java/com/dropbox/sign/FixtureTest.java @@ -1,54 +1,56 @@ package com.dropbox.sign; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; +import org.junit.jupiter.api.Test; public class FixtureTest { - private final List fixtures = Arrays.asList( - "AccountCreateRequest", - "AccountUpdateRequest", - "AccountVerifyRequest", - "ApiAppCreateRequest", - "ApiAppUpdateRequest", - "EmbeddedEditUrlRequest", - "OAuthTokenGenerateRequest", - "OAuthTokenRefreshRequest", - "ReportCreateRequest", - "SignatureRequestBulkCreateEmbeddedWithTemplateRequest", - "SignatureRequestBulkSendWithTemplateRequest", - "SignatureRequestCreateEmbeddedRequest", - "SignatureRequestCreateEmbeddedWithTemplateRequest", - "SignatureRequestRemindRequest", - "SignatureRequestSendRequest", - "SignatureRequestSendWithTemplateRequest", - "SignatureRequestUpdateRequest", - "TeamAddMemberRequest", - "TeamCreateRequest", - "TeamRemoveMemberRequest", - "TeamUpdateRequest", - "TemplateAddUserRequest", - "TemplateCreateEmbeddedDraftRequest", - "TemplateRemoveUserRequest", - "TemplateUpdateFilesRequest", - "UnclaimedDraftCreateEmbeddedRequest", - "UnclaimedDraftCreateEmbeddedWithTemplateRequest", - "UnclaimedDraftCreateRequest", - "UnclaimedDraftEditAndResendRequest"); + private final List fixtures = + Arrays.asList( + "AccountCreateRequest", + "AccountUpdateRequest", + "AccountVerifyRequest", + "ApiAppCreateRequest", + "ApiAppUpdateRequest", + "EmbeddedEditUrlRequest", + "OAuthTokenGenerateRequest", + "OAuthTokenRefreshRequest", + "ReportCreateRequest", + "SignatureRequestBulkCreateEmbeddedWithTemplateRequest", + "SignatureRequestBulkSendWithTemplateRequest", + "SignatureRequestCreateEmbeddedRequest", + "SignatureRequestCreateEmbeddedWithTemplateRequest", + "SignatureRequestRemindRequest", + "SignatureRequestSendRequest", + "SignatureRequestSendWithTemplateRequest", + "SignatureRequestUpdateRequest", + "TeamAddMemberRequest", + "TeamCreateRequest", + "TeamRemoveMemberRequest", + "TeamUpdateRequest", + "TemplateAddUserRequest", + "TemplateCreateEmbeddedDraftRequest", + "TemplateRemoveUserRequest", + "TemplateUpdateFilesRequest", + "UnclaimedDraftCreateEmbeddedRequest", + "UnclaimedDraftCreateEmbeddedWithTemplateRequest", + "UnclaimedDraftCreateRequest", + "UnclaimedDraftEditAndResendRequest"); @Test public void testFixture() throws Exception { ObjectMapper mapper = JSON.getDefault().getMapper(); for (String fixtureName : fixtures) { - JsonNode fixture = mapper.readTree( - Files.newInputStream(Paths.get("test_fixtures/" + fixtureName + ".json")) - ); + JsonNode fixture = + mapper.readTree( + Files.newInputStream( + Paths.get("test_fixtures/" + fixtureName + ".json"))); for (JsonNode expected : fixture) { String data = expected.toString(); diff --git a/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java b/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java index 0ec09f9..823a21c 100644 --- a/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java +++ b/src/test/java/com/dropbox/sign/SubFormFieldsPerDocumentTest.java @@ -1,17 +1,17 @@ package com.dropbox.sign; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.model.SubFormFieldsPerDocumentBase; import com.fasterxml.jackson.databind.node.ObjectNode; -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; import java.util.Iterator; import java.util.Map; +import org.junit.jupiter.api.Test; public class SubFormFieldsPerDocumentTest { public final String packageNamePrefix = "com.dropbox.sign.model."; @@ -19,9 +19,10 @@ public class SubFormFieldsPerDocumentTest { @Test public void testSubFormFieldsPerDocumentBase() throws Exception { ObjectMapper mapper = JSON.getDefault().getMapper(); - JsonNode content = mapper.readTree( - Files.newInputStream(Paths.get("test_fixtures//SubFormFieldsPerDocument.json")) - ); + JsonNode content = + mapper.readTree( + Files.newInputStream( + Paths.get("test_fixtures//SubFormFieldsPerDocument.json"))); Iterator> fields = content.fields(); while (fields.hasNext()) { @@ -29,7 +30,8 @@ public void testSubFormFieldsPerDocumentBase() throws Exception { String fieldName = kv.getKey(); JsonNode expected = kv.getValue(); - SubFormFieldsPerDocumentBase base = SubFormFieldsPerDocumentBase.init(expected.toString()); + SubFormFieldsPerDocumentBase base = + SubFormFieldsPerDocumentBase.init(expected.toString()); assertTrue(Class.forName(packageNamePrefix + fieldName).isInstance(base)); @@ -44,9 +46,10 @@ public void testSubFormFieldsPerDocumentBase() throws Exception { @Test public void testSignersAllowsInt() throws Exception { ObjectMapper mapper = JSON.getDefault().getMapper(); - JsonNode content = mapper.readTree( - Files.newInputStream(Paths.get("test_fixtures//SubFormFieldsPerDocument.json")) - ); + JsonNode content = + mapper.readTree( + Files.newInputStream( + Paths.get("test_fixtures//SubFormFieldsPerDocument.json"))); Iterator> fields = content.fields(); while (fields.hasNext()) { @@ -56,7 +59,8 @@ public void testSignersAllowsInt() throws Exception { ((ObjectNode) data).put("signer", 1234); - SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); + SubFormFieldsPerDocumentBase result = + SubFormFieldsPerDocumentBase.init(data.toString()); assertEquals(expected_signer, result.getSigner()); } @@ -65,9 +69,10 @@ public void testSignersAllowsInt() throws Exception { @Test public void testSignersAllowsString() throws Exception { ObjectMapper mapper = JSON.getDefault().getMapper(); - JsonNode content = mapper.readTree( - Files.newInputStream(Paths.get("test_fixtures//SubFormFieldsPerDocument.json")) - ); + JsonNode content = + mapper.readTree( + Files.newInputStream( + Paths.get("test_fixtures//SubFormFieldsPerDocument.json"))); Iterator> fields = content.fields(); while (fields.hasNext()) { @@ -77,7 +82,8 @@ public void testSignersAllowsString() throws Exception { ((ObjectNode) data).put("signer", "sender"); - SubFormFieldsPerDocumentBase result = SubFormFieldsPerDocumentBase.init(data.toString()); + SubFormFieldsPerDocumentBase result = + SubFormFieldsPerDocumentBase.init(data.toString()); assertEquals(expected_signer, result.getSigner()); } diff --git a/src/test/java/com/dropbox/sign/TestHelper.java b/src/test/java/com/dropbox/sign/TestHelper.java index 0e07286..7cb2d81 100644 --- a/src/test/java/com/dropbox/sign/TestHelper.java +++ b/src/test/java/com/dropbox/sign/TestHelper.java @@ -1,16 +1,15 @@ package com.dropbox.sign; +import static org.mockito.Mockito.*; + +import com.dropbox.sign.model.ErrorResponse; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.dropbox.sign.model.ErrorResponse; -import org.mockito.Mockito; - import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; - -import static org.mockito.Mockito.*; +import org.mockito.Mockito; public class TestHelper { public static InputStream readFileFromResource(String fileName) throws Exception { @@ -21,7 +20,8 @@ public static JsonNode getJsonContents(String filename) throws Exception { return getJsonContents(filename, "default"); } - public static JsonNode getJsonContents(String filename, String topLevelFieldName) throws Exception { + public static JsonNode getJsonContents(String filename, String topLevelFieldName) + throws Exception { ObjectMapper objectMapper = JSON.getDefault().getMapper(); JsonNode jsonNode = objectMapper.readTree(readFileFromResource(filename)); @@ -32,38 +32,23 @@ public static ApiClient setUpMock(int statusCode, Object obj) throws ApiExceptio ApiClient apiClient = Mockito.spy(ApiClient.class); ApiResponse response = new ApiResponse<>(statusCode, new HashMap<>(), obj); if (statusCode >= 200 && statusCode <= 299) { - doReturn(response).when(apiClient).invokeAPI( - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - eq(false) - ); + doReturn(response) + .when(apiClient) + .invokeAPI( + any(), any(), any(), any(), any(), any(), any(), any(), any(), any(), + any(), any(), eq(false)); } else { - doThrow(new ApiException(statusCode, obj.toString(), null, obj.toString(), (ErrorResponse) obj)) - .when(apiClient).invokeAPI( - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - eq(false) - ); + doThrow( + new ApiException( + statusCode, + obj.toString(), + null, + obj.toString(), + (ErrorResponse) obj)) + .when(apiClient) + .invokeAPI( + any(), any(), any(), any(), any(), any(), any(), any(), any(), any(), + any(), any(), eq(false)); } return apiClient; diff --git a/src/test/java/com/dropbox/sign/api/AccountApiTest.java b/src/test/java/com/dropbox/sign/api/AccountApiTest.java index 04e0e64..3f95a9b 100644 --- a/src/test/java/com/dropbox/sign/api/AccountApiTest.java +++ b/src/test/java/com/dropbox/sign/api/AccountApiTest.java @@ -1,24 +1,27 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.ApiException; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -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; +import org.junit.jupiter.api.Test; public class AccountApiTest { @Test public void accountCreateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(AccountCreateResponse.class.getSimpleName()); - AccountCreateResponse expectedResponse = AccountCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(AccountCreateResponse.class.getSimpleName()); + AccountCreateResponse expectedResponse = + AccountCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(AccountCreateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(AccountCreateRequest.class.getSimpleName()); AccountCreateRequest request = AccountCreateRequest.init(requestData.toString()); @@ -30,8 +33,10 @@ public void accountCreateTest() throws Exception { @Test public void accountGetTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(AccountGetResponse.class.getSimpleName()); - AccountGetResponse expectedResponse = AccountGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(AccountGetResponse.class.getSimpleName()); + AccountGetResponse expectedResponse = + AccountGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); AccountApi accountApi = new AccountApi(apiClient); @@ -42,11 +47,14 @@ public void accountGetTest() throws Exception { @Test public void accountUpdateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(AccountGetResponse.class.getSimpleName()); - AccountGetResponse expectedResponse = AccountGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(AccountGetResponse.class.getSimpleName()); + AccountGetResponse expectedResponse = + AccountGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(AccountUpdateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(AccountUpdateRequest.class.getSimpleName()); AccountUpdateRequest request = AccountUpdateRequest.init(requestData.toString()); @@ -58,11 +66,14 @@ public void accountUpdateTest() throws Exception { @Test public void accountVerifyTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(AccountVerifyResponse.class.getSimpleName()); - AccountVerifyResponse expectedResponse = AccountVerifyResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(AccountVerifyResponse.class.getSimpleName()); + AccountVerifyResponse expectedResponse = + AccountVerifyResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(AccountVerifyRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(AccountVerifyRequest.class.getSimpleName()); AccountVerifyRequest request = AccountVerifyRequest.init(requestData.toString()); @@ -74,23 +85,27 @@ public void accountVerifyTest() throws Exception { @Test public void testHttpCodeRange() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(ErrorResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ErrorResponse.class.getSimpleName()); ErrorResponse expectedResponse = ErrorResponse.init(expectedResponseData.toString()); - JsonNode requestData = TestHelper.getJsonContents(AccountVerifyRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(AccountVerifyRequest.class.getSimpleName()); AccountVerifyRequest request = AccountVerifyRequest.init(requestData.toString()); - IntStream.range(400, 500).forEach(value -> { - try { - ApiClient apiClient = TestHelper.setUpMock(value, expectedResponse); - AccountApi accountApi = new AccountApi(apiClient); - accountApi.accountVerify(request); - fail(); - } catch (ApiException e) { - assertEquals(value, e.getCode()); - assertEquals(expectedResponse, e.getErrorResponse()); - } - }); + IntStream.range(400, 500) + .forEach( + value -> { + try { + ApiClient apiClient = TestHelper.setUpMock(value, expectedResponse); + AccountApi accountApi = new AccountApi(apiClient); + accountApi.accountVerify(request); + fail(); + } catch (ApiException e) { + assertEquals(value, e.getCode()); + assertEquals(expectedResponse, e.getErrorResponse()); + } + }); } } diff --git a/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java b/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java index 3c0d800..66ac877 100644 --- a/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java +++ b/src/test/java/com/dropbox/sign/api/ApiAppApiTest.java @@ -1,23 +1,25 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -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; +import org.junit.jupiter.api.Test; public class ApiAppApiTest { @Test public void apiAppCreateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); - ApiAppGetResponse expectedResponse = ApiAppGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); + ApiAppGetResponse expectedResponse = + ApiAppGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(ApiAppCreateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(ApiAppCreateRequest.class.getSimpleName()); ApiAppCreateRequest request = ApiAppCreateRequest.init(requestData.toString()); request.customLogoFile(new File("test_fixtures/pdf-sample.pdf")); @@ -30,8 +32,8 @@ public void apiAppCreateTest() throws Exception { @Test public void apiAppDeleteTest() { - //String clientId = null; - //api.apiAppDelete(clientId); + // String clientId = null; + // api.apiAppDelete(clientId); // TODO: test validations } @@ -39,8 +41,10 @@ public void apiAppDeleteTest() { public void apiAppGetTest() throws Exception { String clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - JsonNode expectedResponseData = TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); - ApiAppGetResponse expectedResponse = ApiAppGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); + ApiAppGetResponse expectedResponse = + ApiAppGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); ApiAppApi api = new ApiAppApi(apiClient); @@ -51,8 +55,10 @@ public void apiAppGetTest() throws Exception { @Test public void apiAppListTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(ApiAppListResponse.class.getSimpleName()); - ApiAppListResponse expectedResponse = ApiAppListResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ApiAppListResponse.class.getSimpleName()); + ApiAppListResponse expectedResponse = + ApiAppListResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); ApiAppApi api = new ApiAppApi(apiClient); @@ -65,11 +71,14 @@ public void apiAppListTest() throws Exception { public void apiAppUpdateTest() throws Exception { String clientId = "0dd3b823a682527788c4e40cb7b6f7e9"; - JsonNode expectedResponseData = TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); - ApiAppGetResponse expectedResponse = ApiAppGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ApiAppGetResponse.class.getSimpleName()); + ApiAppGetResponse expectedResponse = + ApiAppGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(ApiAppUpdateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(ApiAppUpdateRequest.class.getSimpleName()); ApiAppUpdateRequest request = ApiAppUpdateRequest.init(requestData.toString()); request.customLogoFile(new File("test_fixtures/pdf-sample.pdf")); diff --git a/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java b/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java index e70b325..f224d96 100644 --- a/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java +++ b/src/test/java/com/dropbox/sign/api/BulkSendJobApiTest.java @@ -1,19 +1,21 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; 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 public void bulkSendJobGetTest() throws Exception { String id = "6e683bc0369ba3d5b6f43c2c22a8031dbf6bd174"; - JsonNode expectedResponseData = TestHelper.getJsonContents(BulkSendJobGetResponse.class.getSimpleName()); - BulkSendJobGetResponse expectedResponse = BulkSendJobGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(BulkSendJobGetResponse.class.getSimpleName()); + BulkSendJobGetResponse expectedResponse = + BulkSendJobGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); BulkSendJobApi api = new BulkSendJobApi(apiClient); @@ -24,8 +26,10 @@ public void bulkSendJobGetTest() throws Exception { @Test public void bulkSendJobListTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(BulkSendJobListResponse.class.getSimpleName()); - BulkSendJobListResponse expectedResponse = BulkSendJobListResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(BulkSendJobListResponse.class.getSimpleName()); + BulkSendJobListResponse expectedResponse = + BulkSendJobListResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); BulkSendJobApi api = new BulkSendJobApi(apiClient); diff --git a/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java b/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java index e52f455..aea6b94 100644 --- a/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java +++ b/src/test/java/com/dropbox/sign/api/EmbeddedApiTest.java @@ -1,23 +1,26 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; 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 public void embeddedEditUrlTest() throws Exception { String templateId = "5de8179668f2033afac48da1868d0093bf133266"; - JsonNode expectedResponseData = TestHelper.getJsonContents(EmbeddedEditUrlResponse.class.getSimpleName()); - EmbeddedEditUrlResponse expectedResponse = EmbeddedEditUrlResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(EmbeddedEditUrlResponse.class.getSimpleName()); + EmbeddedEditUrlResponse expectedResponse = + EmbeddedEditUrlResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(EmbeddedEditUrlRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(EmbeddedEditUrlRequest.class.getSimpleName()); EmbeddedEditUrlRequest request = EmbeddedEditUrlRequest.init(requestData.toString()); @@ -31,8 +34,10 @@ public void embeddedEditUrlTest() throws Exception { public void embeddedSignUrlTest() throws Exception { String signatureId = "50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b"; - JsonNode expectedResponseData = TestHelper.getJsonContents(EmbeddedSignUrlResponse.class.getSimpleName()); - EmbeddedSignUrlResponse expectedResponse = EmbeddedSignUrlResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(EmbeddedSignUrlResponse.class.getSimpleName()); + EmbeddedSignUrlResponse expectedResponse = + EmbeddedSignUrlResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); EmbeddedApi api = new EmbeddedApi(apiClient); diff --git a/src/test/java/com/dropbox/sign/api/OAuthApiTest.java b/src/test/java/com/dropbox/sign/api/OAuthApiTest.java index fe95c51..fd944e6 100644 --- a/src/test/java/com/dropbox/sign/api/OAuthApiTest.java +++ b/src/test/java/com/dropbox/sign/api/OAuthApiTest.java @@ -1,21 +1,24 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; 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 public void oauthTokenGenerateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(OAuthTokenResponse.class.getSimpleName()); - OAuthTokenResponse expectedResponse = OAuthTokenResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(OAuthTokenResponse.class.getSimpleName()); + OAuthTokenResponse expectedResponse = + OAuthTokenResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(OAuthTokenGenerateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(OAuthTokenGenerateRequest.class.getSimpleName()); OAuthTokenGenerateRequest request = OAuthTokenGenerateRequest.init(requestData.toString()); @@ -27,11 +30,14 @@ public void oauthTokenGenerateTest() throws Exception { @Test public void oauthTokenRefreshTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(OAuthTokenResponse.class.getSimpleName()); - OAuthTokenResponse expectedResponse = OAuthTokenResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(OAuthTokenResponse.class.getSimpleName()); + OAuthTokenResponse expectedResponse = + OAuthTokenResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(OAuthTokenRefreshRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(OAuthTokenRefreshRequest.class.getSimpleName()); OAuthTokenRefreshRequest request = OAuthTokenRefreshRequest.init(requestData.toString()); diff --git a/src/test/java/com/dropbox/sign/api/ReportApiTest.java b/src/test/java/com/dropbox/sign/api/ReportApiTest.java index 65c4a9c..2caac35 100644 --- a/src/test/java/com/dropbox/sign/api/ReportApiTest.java +++ b/src/test/java/com/dropbox/sign/api/ReportApiTest.java @@ -1,21 +1,24 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; 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 public void reportCreateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(ReportCreateResponse.class.getSimpleName()); - ReportCreateResponse expectedResponse = ReportCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(ReportCreateResponse.class.getSimpleName()); + ReportCreateResponse expectedResponse = + ReportCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(ReportCreateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(ReportCreateRequest.class.getSimpleName()); ReportCreateRequest request = ReportCreateRequest.init(requestData.toString()); diff --git a/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java b/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java index eadcbb2..04d2153 100644 --- a/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java +++ b/src/test/java/com/dropbox/sign/api/SignatureRequestApiTest.java @@ -1,88 +1,104 @@ package com.dropbox.sign.api; -import com.dropbox.sign.ApiClient; -import com.dropbox.sign.TestHelper; -import com.dropbox.sign.model.*; -import com.fasterxml.jackson.databind.JsonNode; -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; import static org.mockito.ArgumentMatchers.eq; +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.TestHelper; +import com.dropbox.sign.model.*; +import com.fasterxml.jackson.databind.JsonNode; import java.io.File; import java.util.Arrays; import java.util.HashMap; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; public class SignatureRequestApiTest { @Test public void initAcceptsHashMap() throws Exception { - SignatureRequestSendRequest data = SignatureRequestSendRequest.init( - new HashMap() {{ - put("title", "NDA with Acme Co."); - put("subject", "The NDA we talked about"); - put("message", "Please sign this NDA and then we can discuss more."); - put("signers", Arrays.asList - ( - new HashMap() {{ - put("email_address", "jill@example.com"); - put("name", "Jill"); - put("order", 1); - }} - )); - put("form_fields_per_document", Arrays.asList( - new HashMap() {{ - put("type", "signature"); - put("document_index", 0); - put("api_id", "4688957689"); - put("name", "signature1"); - put("x", 5); - put("y", 7); - put("width", 60); - put("height", 30); - put("required", true); - put("signer", 0); - put("page", 1); - }} - )); - }} - ); + SignatureRequestSendRequest data = + SignatureRequestSendRequest.init( + new HashMap() { + { + put("title", "NDA with Acme Co."); + put("subject", "The NDA we talked about"); + put( + "message", + "Please sign this NDA and then we can discuss more."); + put( + "signers", + Arrays.asList( + new HashMap() { + { + put("email_address", "jill@example.com"); + put("name", "Jill"); + put("order", 1); + } + })); + put( + "form_fields_per_document", + Arrays.asList( + new HashMap() { + { + put("type", "signature"); + put("document_index", 0); + put("api_id", "4688957689"); + put("name", "signature1"); + put("x", 5); + put("y", 7); + put("width", 60); + put("height", 30); + put("required", true); + put("signer", 0); + put("page", 1); + } + })); + } + }); assert data.getFormFieldsPerDocument() != null; - assertEquals( - "signature", - data.getFormFieldsPerDocument().get(0).getType() - ); + assertEquals("signature", data.getFormFieldsPerDocument().get(0).getType()); } @Test public void signatureRequestBulkCreateEmbeddedWithTemplateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(BulkSendJobSendResponse.class.getSimpleName()); - BulkSendJobSendResponse expectedResponse = BulkSendJobSendResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(BulkSendJobSendResponse.class.getSimpleName()); + BulkSendJobSendResponse expectedResponse = + BulkSendJobSendResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.class + .getSimpleName()); - SignatureRequestBulkCreateEmbeddedWithTemplateRequest request = SignatureRequestBulkCreateEmbeddedWithTemplateRequest.init(requestData.toString()); + SignatureRequestBulkCreateEmbeddedWithTemplateRequest request = + SignatureRequestBulkCreateEmbeddedWithTemplateRequest.init(requestData.toString()); request.signerFile(new File("test_fixtures/bulk-send-sample.csv")); SignatureRequestApi api = new SignatureRequestApi(apiClient); - BulkSendJobSendResponse response = api.signatureRequestBulkCreateEmbeddedWithTemplate(request); + BulkSendJobSendResponse response = + api.signatureRequestBulkCreateEmbeddedWithTemplate(request); assertEquals(expectedResponse, response); } @Test public void signatureRequestBulkSendWithTemplateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(BulkSendJobSendResponse.class.getSimpleName()); - BulkSendJobSendResponse expectedResponse = BulkSendJobSendResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(BulkSendJobSendResponse.class.getSimpleName()); + BulkSendJobSendResponse expectedResponse = + BulkSendJobSendResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestBulkSendWithTemplateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + SignatureRequestBulkSendWithTemplateRequest.class.getSimpleName()); - SignatureRequestBulkSendWithTemplateRequest request = SignatureRequestBulkSendWithTemplateRequest.init(requestData.toString()); + SignatureRequestBulkSendWithTemplateRequest request = + SignatureRequestBulkSendWithTemplateRequest.init(requestData.toString()); request.signerFile(new File("test_fixtures/bulk-send-sample.csv")); SignatureRequestApi api = new SignatureRequestApi(apiClient); @@ -93,20 +109,25 @@ public void signatureRequestBulkSendWithTemplateTest() throws Exception { @Test public void signatureRequestCancelTest() { - //String signatureRequestId = null; - //api.signatureRequestCancel(signatureRequestId); + // String signatureRequestId = null; + // api.signatureRequestCancel(signatureRequestId); // TODO: test validations } @Test public void signatureRequestCreateEmbeddedTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestCreateEmbeddedRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + SignatureRequestCreateEmbeddedRequest.class.getSimpleName()); - SignatureRequestCreateEmbeddedRequest request = SignatureRequestCreateEmbeddedRequest.init(requestData.toString()); + SignatureRequestCreateEmbeddedRequest request = + SignatureRequestCreateEmbeddedRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); SignatureRequestApi api = new SignatureRequestApi(apiClient); @@ -117,17 +138,23 @@ public void signatureRequestCreateEmbeddedTest() throws Exception { @Test public void signatureRequestCreateEmbeddedWithTemplateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestCreateEmbeddedWithTemplateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + SignatureRequestCreateEmbeddedWithTemplateRequest.class.getSimpleName()); - SignatureRequestCreateEmbeddedWithTemplateRequest request = SignatureRequestCreateEmbeddedWithTemplateRequest.init(requestData.toString()); + SignatureRequestCreateEmbeddedWithTemplateRequest request = + SignatureRequestCreateEmbeddedWithTemplateRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); SignatureRequestApi api = new SignatureRequestApi(apiClient); - SignatureRequestGetResponse response = api.signatureRequestCreateEmbeddedWithTemplate(request); + SignatureRequestGetResponse response = + api.signatureRequestCreateEmbeddedWithTemplate(request); assertEquals(expectedResponse, response); } @@ -141,8 +168,10 @@ public void signatureRequestFilesTest() { public void signatureRequestGetTest() throws Exception { String signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); SignatureRequestApi api = new SignatureRequestApi(apiClient); @@ -155,17 +184,14 @@ public void signatureRequestGetTest() throws Exception { public void signatureRequestListTest() throws Exception { String accountId = "all"; - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestListResponse.class.getSimpleName()); - SignatureRequestListResponse expectedResponse = SignatureRequestListResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestListResponse.class.getSimpleName()); + SignatureRequestListResponse expectedResponse = + SignatureRequestListResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); SignatureRequestApi api = new SignatureRequestApi(apiClient); - SignatureRequestListResponse response = api.signatureRequestList( - accountId, - 1, - 20, - null - ); + SignatureRequestListResponse response = api.signatureRequestList(accountId, 1, 20, null); assertEquals(expectedResponse, response); } @@ -174,8 +200,10 @@ public void signatureRequestListTest() throws Exception { public void signatureRequestReleaseHoldTest() throws Exception { String signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); SignatureRequestApi api = new SignatureRequestApi(apiClient); @@ -188,36 +216,45 @@ public void signatureRequestReleaseHoldTest() throws Exception { public void signatureRequestRemindTest() throws Exception { String signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestRemindRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(SignatureRequestRemindRequest.class.getSimpleName()); - SignatureRequestRemindRequest request = SignatureRequestRemindRequest.init(requestData.toString()); + SignatureRequestRemindRequest request = + SignatureRequestRemindRequest.init(requestData.toString()); SignatureRequestApi api = new SignatureRequestApi(apiClient); - SignatureRequestGetResponse response = api.signatureRequestRemind(signatureRequestId, request); + SignatureRequestGetResponse response = + api.signatureRequestRemind(signatureRequestId, request); assertEquals(expectedResponse, response); } @Test public void signatureRequestRemoveTest() { - //String signatureRequestId = null; - //api.signatureRequestRemove(signatureRequestId); + // String signatureRequestId = null; + // api.signatureRequestRemove(signatureRequestId); // TODO: test validations } @Test public void signatureRequestSendTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); - SignatureRequestSendRequest request = SignatureRequestSendRequest.init(requestData.toString()); + SignatureRequestSendRequest request = + SignatureRequestSendRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); SignatureRequestApi api = new SignatureRequestApi(apiClient); @@ -228,74 +265,87 @@ public void signatureRequestSendTest() throws Exception { @Test public void signatureRequestSendFileForcesMultipartFormDataTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); - SignatureRequestSendRequest request = SignatureRequestSendRequest.init(requestData.toString()); + SignatureRequestSendRequest request = + SignatureRequestSendRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); SignatureRequestApi api = new SignatureRequestApi(apiClient); api.signatureRequestSend(request); - Mockito.verify(apiClient).invokeAPI( - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - eq("multipart/form-data"), - any(), - any(), - eq(false) - ); + Mockito.verify(apiClient) + .invokeAPI( + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any(), + eq("multipart/form-data"), + any(), + any(), + eq(false)); } @Test public void signatureRequestSendNoFileForcesApplicationJsonTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(SignatureRequestSendRequest.class.getSimpleName()); - SignatureRequestSendRequest request = SignatureRequestSendRequest.init(requestData.toString()); + SignatureRequestSendRequest request = + SignatureRequestSendRequest.init(requestData.toString()); SignatureRequestApi api = new SignatureRequestApi(apiClient); api.signatureRequestSend(request); - Mockito.verify(apiClient).invokeAPI( - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - any(), - eq("application/json"), - any(), - any(), - eq(false) - ); + Mockito.verify(apiClient) + .invokeAPI( + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any(), + eq("application/json"), + any(), + any(), + eq(false)); } @Test public void signatureRequestSendWithTemplateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestSendWithTemplateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + SignatureRequestSendWithTemplateRequest.class.getSimpleName()); - SignatureRequestSendWithTemplateRequest request = SignatureRequestSendWithTemplateRequest.init(requestData.toString()); + SignatureRequestSendWithTemplateRequest request = + SignatureRequestSendWithTemplateRequest.init(requestData.toString()); SignatureRequestApi api = new SignatureRequestApi(apiClient); SignatureRequestGetResponse response = api.signatureRequestSendWithTemplate(request); @@ -307,16 +357,21 @@ public void signatureRequestSendWithTemplateTest() throws Exception { public void signatureRequestUpdateTest() throws Exception { String signatureRequestId = "fa5c8a0b0f492d768749333ad6fcc214c111e967"; - JsonNode expectedResponseData = TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); - SignatureRequestGetResponse expectedResponse = SignatureRequestGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(SignatureRequestGetResponse.class.getSimpleName()); + SignatureRequestGetResponse expectedResponse = + SignatureRequestGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(SignatureRequestUpdateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(SignatureRequestUpdateRequest.class.getSimpleName()); - SignatureRequestUpdateRequest request = SignatureRequestUpdateRequest.init(requestData.toString()); + SignatureRequestUpdateRequest request = + SignatureRequestUpdateRequest.init(requestData.toString()); SignatureRequestApi api = new SignatureRequestApi(apiClient); - SignatureRequestGetResponse response = api.signatureRequestUpdate(signatureRequestId, request); + SignatureRequestGetResponse response = + api.signatureRequestUpdate(signatureRequestId, request); assertEquals(expectedResponse, response); } diff --git a/src/test/java/com/dropbox/sign/api/TeamApiTest.java b/src/test/java/com/dropbox/sign/api/TeamApiTest.java index bc9e77e..e477612 100644 --- a/src/test/java/com/dropbox/sign/api/TeamApiTest.java +++ b/src/test/java/com/dropbox/sign/api/TeamApiTest.java @@ -1,24 +1,24 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; 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 - */ +/** API tests for TeamApi */ public class TeamApiTest { @Test public void teamAddMemberTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); TeamGetResponse expectedResponse = TeamGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TeamAddMemberRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(TeamAddMemberRequest.class.getSimpleName()); TeamAddMemberRequest request = TeamAddMemberRequest.init(requestData.toString()); @@ -30,7 +30,8 @@ public void teamAddMemberTest() throws Exception { @Test public void teamCreateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); TeamGetResponse expectedResponse = TeamGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); @@ -46,13 +47,14 @@ public void teamCreateTest() throws Exception { @Test public void teamDeleteTest() { - //api.teamDelete(); + // api.teamDelete(); // TODO: test validations } @Test public void teamGetTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); TeamGetResponse expectedResponse = TeamGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); @@ -64,11 +66,13 @@ public void teamGetTest() throws Exception { @Test public void teamRemoveMemberTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); TeamGetResponse expectedResponse = TeamGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TeamRemoveMemberRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(TeamRemoveMemberRequest.class.getSimpleName()); TeamRemoveMemberRequest request = TeamRemoveMemberRequest.init(requestData.toString()); @@ -80,7 +84,8 @@ public void teamRemoveMemberTest() throws Exception { @Test public void teamUpdateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TeamGetResponse.class.getSimpleName()); TeamGetResponse expectedResponse = TeamGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); diff --git a/src/test/java/com/dropbox/sign/api/TemplateApiTest.java b/src/test/java/com/dropbox/sign/api/TemplateApiTest.java index 5c1d04b..d23c5cb 100644 --- a/src/test/java/com/dropbox/sign/api/TemplateApiTest.java +++ b/src/test/java/com/dropbox/sign/api/TemplateApiTest.java @@ -1,25 +1,27 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -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; +import org.junit.jupiter.api.Test; public class TemplateApiTest { @Test public void templateAddUserTest() throws Exception { String templateId = "f57db65d3f933b5316d398057a36176831451a35"; - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); - TemplateGetResponse expectedResponse = TemplateGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); + TemplateGetResponse expectedResponse = + TemplateGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TemplateAddUserRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(TemplateAddUserRequest.class.getSimpleName()); TemplateAddUserRequest request = TemplateAddUserRequest.init(requestData.toString()); @@ -31,13 +33,19 @@ public void templateAddUserTest() throws Exception { @Test public void templateCreateEmbeddedDraftTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateCreateEmbeddedDraftResponse.class.getSimpleName()); - TemplateCreateEmbeddedDraftResponse expectedResponse = TemplateCreateEmbeddedDraftResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents( + TemplateCreateEmbeddedDraftResponse.class.getSimpleName()); + TemplateCreateEmbeddedDraftResponse expectedResponse = + TemplateCreateEmbeddedDraftResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TemplateCreateEmbeddedDraftRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + TemplateCreateEmbeddedDraftRequest.class.getSimpleName()); - TemplateCreateEmbeddedDraftRequest request = TemplateCreateEmbeddedDraftRequest.init(requestData.toString()); + TemplateCreateEmbeddedDraftRequest request = + TemplateCreateEmbeddedDraftRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); TemplateApi api = new TemplateApi(apiClient); @@ -48,8 +56,8 @@ public void templateCreateEmbeddedDraftTest() throws Exception { @Test public void templateDeleteTest() { - //String templateId = null; - //api.templateDelete(templateId); + // String templateId = null; + // api.templateDelete(templateId); // TODO: test validations } @@ -62,8 +70,10 @@ public void templateFilesTest() { public void templateGetTest() throws Exception { String templateId = "f57db65d3f933b5316d398057a36176831451a35"; - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); - TemplateGetResponse expectedResponse = TemplateGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); + TemplateGetResponse expectedResponse = + TemplateGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); TemplateApi api = new TemplateApi(apiClient); @@ -76,8 +86,10 @@ public void templateGetTest() throws Exception { public void templateListTest() throws Exception { String accountId = "all"; - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateListResponse.class.getSimpleName()); - TemplateListResponse expectedResponse = TemplateListResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TemplateListResponse.class.getSimpleName()); + TemplateListResponse expectedResponse = + TemplateListResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); TemplateApi api = new TemplateApi(apiClient); @@ -90,11 +102,14 @@ public void templateListTest() throws Exception { public void templateRemoveUserTest() throws Exception { String templateId = "f57db65d3f933b5316d398057a36176831451a35"; - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); - TemplateGetResponse expectedResponse = TemplateGetResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TemplateGetResponse.class.getSimpleName()); + TemplateGetResponse expectedResponse = + TemplateGetResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TemplateRemoveUserRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(TemplateRemoveUserRequest.class.getSimpleName()); TemplateRemoveUserRequest request = TemplateRemoveUserRequest.init(requestData.toString()); @@ -108,13 +123,17 @@ public void templateRemoveUserTest() throws Exception { public void templateUpdateFilesTest() throws Exception { String templateId = "f57db65d3f933b5316d398057a36176831451a35"; - JsonNode expectedResponseData = TestHelper.getJsonContents(TemplateUpdateFilesResponse.class.getSimpleName()); - TemplateUpdateFilesResponse expectedResponse = TemplateUpdateFilesResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(TemplateUpdateFilesResponse.class.getSimpleName()); + TemplateUpdateFilesResponse expectedResponse = + TemplateUpdateFilesResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(TemplateUpdateFilesRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(TemplateUpdateFilesRequest.class.getSimpleName()); - TemplateUpdateFilesRequest request = TemplateUpdateFilesRequest.init(requestData.toString()); + TemplateUpdateFilesRequest request = + TemplateUpdateFilesRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); TemplateApi api = new TemplateApi(apiClient); diff --git a/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java b/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java index 5d92e30..a09f1b9 100644 --- a/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java +++ b/src/test/java/com/dropbox/sign/api/UnclaimedDraftApiTest.java @@ -1,25 +1,28 @@ package com.dropbox.sign.api; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.dropbox.sign.ApiClient; import com.dropbox.sign.TestHelper; import com.dropbox.sign.model.*; import com.fasterxml.jackson.databind.JsonNode; -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; +import org.junit.jupiter.api.Test; public class UnclaimedDraftApiTest { @Test public void unclaimedDraftCreateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); - UnclaimedDraftCreateResponse expectedResponse = UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); + UnclaimedDraftCreateResponse expectedResponse = + UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(UnclaimedDraftCreateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents(UnclaimedDraftCreateRequest.class.getSimpleName()); - UnclaimedDraftCreateRequest request = UnclaimedDraftCreateRequest.init(requestData.toString()); + UnclaimedDraftCreateRequest request = + UnclaimedDraftCreateRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); @@ -30,13 +33,18 @@ public void unclaimedDraftCreateTest() throws Exception { @Test public void unclaimedDraftCreateEmbeddedTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); - UnclaimedDraftCreateResponse expectedResponse = UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); + UnclaimedDraftCreateResponse expectedResponse = + UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(UnclaimedDraftCreateEmbeddedRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + UnclaimedDraftCreateEmbeddedRequest.class.getSimpleName()); - UnclaimedDraftCreateEmbeddedRequest request = UnclaimedDraftCreateEmbeddedRequest.init(requestData.toString()); + UnclaimedDraftCreateEmbeddedRequest request = + UnclaimedDraftCreateEmbeddedRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); @@ -47,17 +55,23 @@ public void unclaimedDraftCreateEmbeddedTest() throws Exception { @Test public void unclaimedDraftCreateEmbeddedWithTemplateTest() throws Exception { - JsonNode expectedResponseData = TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); - UnclaimedDraftCreateResponse expectedResponse = UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); + UnclaimedDraftCreateResponse expectedResponse = + UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(UnclaimedDraftCreateEmbeddedWithTemplateRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + UnclaimedDraftCreateEmbeddedWithTemplateRequest.class.getSimpleName()); - UnclaimedDraftCreateEmbeddedWithTemplateRequest request = UnclaimedDraftCreateEmbeddedWithTemplateRequest.init(requestData.toString()); + UnclaimedDraftCreateEmbeddedWithTemplateRequest request = + UnclaimedDraftCreateEmbeddedWithTemplateRequest.init(requestData.toString()); request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); - UnclaimedDraftCreateResponse response = api.unclaimedDraftCreateEmbeddedWithTemplate(request); + UnclaimedDraftCreateResponse response = + api.unclaimedDraftCreateEmbeddedWithTemplate(request); assertEquals(expectedResponse, response); } @@ -66,16 +80,22 @@ public void unclaimedDraftCreateEmbeddedWithTemplateTest() throws Exception { public void unclaimedDraftEditAndResendTest() throws Exception { String signatureRequestId = "2f9781e1a83jdja934d808c153c2e1d3df6f8f2f"; - JsonNode expectedResponseData = TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); - UnclaimedDraftCreateResponse expectedResponse = UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); + JsonNode expectedResponseData = + TestHelper.getJsonContents(UnclaimedDraftCreateResponse.class.getSimpleName()); + UnclaimedDraftCreateResponse expectedResponse = + UnclaimedDraftCreateResponse.init(expectedResponseData.toString()); ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); - JsonNode requestData = TestHelper.getJsonContents(UnclaimedDraftEditAndResendRequest.class.getSimpleName()); + JsonNode requestData = + TestHelper.getJsonContents( + UnclaimedDraftEditAndResendRequest.class.getSimpleName()); - UnclaimedDraftEditAndResendRequest request = UnclaimedDraftEditAndResendRequest.init(requestData.toString()); + UnclaimedDraftEditAndResendRequest request = + UnclaimedDraftEditAndResendRequest.init(requestData.toString()); UnclaimedDraftApi api = new UnclaimedDraftApi(apiClient); - UnclaimedDraftCreateResponse response = api.unclaimedDraftEditAndResend(signatureRequestId, request); + UnclaimedDraftCreateResponse response = + api.unclaimedDraftEditAndResend(signatureRequestId, request); assertEquals(expectedResponse, response); } diff --git a/templates/EventCallbackHelper.mustache b/templates/dropbox-EventCallbackHelper.mustache similarity index 100% rename from templates/EventCallbackHelper.mustache rename to templates/dropbox-EventCallbackHelper.mustache diff --git a/templates/dropbox-LICENSE.mustache b/templates/dropbox-LICENSE.mustache new file mode 100644 index 0000000..22039a6 --- /dev/null +++ b/templates/dropbox-LICENSE.mustache @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) {{licenseCopyrightYear}} 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/templates/VERSION.mustache b/templates/dropbox-VERSION.mustache similarity index 100% rename from templates/VERSION.mustache rename to templates/dropbox-VERSION.mustache diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache index 05e10a1..69e0703 100644 --- a/templates/gitignore.mustache +++ b/templates/gitignore.mustache @@ -21,9 +21,9 @@ target build {{#useCustomTemplateCode}} -/.composer -/vendor -/.idea/ -/.openapi-generator -/.github/workflows/maven.yml +.composer +vendor +.idea/ +.openapi-generator +.github/workflows/maven.yml {{/useCustomTemplateCode}} diff --git a/templates/libraries/jersey2/api.mustache b/templates/libraries/jersey2/api.mustache index 6290978..b39d00d 100644 --- a/templates/libraries/jersey2/api.mustache +++ b/templates/libraries/jersey2/api.mustache @@ -56,7 +56,12 @@ public class {{classname}} { {{#operation}} {{^vendorExtensions.x-group-parameters}} /** +{{^useCustomTemplateCode}} * {{summary}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * {{summary}}. +{{/useCustomTemplateCode}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} @@ -96,7 +101,12 @@ public class {{classname}} { {{/useCustomTemplateCode}} {{^vendorExtensions.x-group-parameters}} /** +{{^useCustomTemplateCode}} * {{summary}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * {{summary}}. +{{/useCustomTemplateCode}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} @@ -311,7 +321,12 @@ public class {{classname}} { } /** +{{^useCustomTemplateCode}} * {{summary}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + * {{summary}}. +{{/useCustomTemplateCode}} * {{notes}}{{#pathParams}} * @param {{paramName}} {{description}} (required){{/pathParams}} * @return {{operationId}}Request diff --git a/templates/libraries/jersey2/build.gradle.mustache b/templates/libraries/jersey2/build.gradle.mustache index 7b991eb..39aa192 100644 --- a/templates/libraries/jersey2/build.gradle.mustache +++ b/templates/libraries/jersey2/build.gradle.mustache @@ -14,18 +14,23 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' +{{^useCustomTemplateCode}} classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' +{{/useCustomTemplateCode}} } } {{#useCustomTemplateCode}} plugins { id 'com.vanniktech.maven.publish' version '0.24.0' + id 'com.diffplug.spotless' version '6.25.0' } apply plugin: 'java' apply plugin: 'maven-publish' -apply plugin: 'com.diffplug.spotless' apply plugin: 'signing' group = '{{groupId}}' @@ -293,7 +298,13 @@ spotless { java { // don't need to set target, it is inferred from java // apply a specific flavor of google-java-format +{{^useCustomTemplateCode}} googleJavaFormat('1.8').aosp().reflowLongStrings() +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + googleJavaFormat('1.23.0').aosp().reflowLongStrings() + formatAnnotations() +{{/useCustomTemplateCode}} removeUnusedImports() importOrder() }