├── .swagger-codegen └── VERSION ├── settings.gradle ├── src ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── docusign │ │ └── webforms │ │ ├── client │ │ ├── auth │ │ │ ├── AccessTokenListener.java │ │ │ ├── OAuthFlow.java │ │ │ ├── Authentication.java │ │ │ ├── HttpBasicAuth.java │ │ │ ├── ApiKeyAuth.java │ │ │ └── JWTUtils.java │ │ ├── RFC3339DateFormat.java │ │ ├── Configuration.java │ │ ├── Pair.java │ │ ├── ApiResponse.java │ │ ├── StringUtil.java │ │ ├── JSON.java │ │ └── ApiException.java │ │ ├── model │ │ ├── WebFormState.java │ │ ├── UserFilter.java │ │ ├── WebFormType.java │ │ ├── SendOption.java │ │ ├── Source.java │ │ ├── WebFormSource.java │ │ ├── InstanceRecipientStatus.java │ │ ├── InstanceSource.java │ │ ├── WebFormComponentType.java │ │ ├── InstanceStatus.java │ │ ├── WebFormAdmType.java │ │ ├── Tags.java │ │ ├── WebFormComponentsMap.java │ │ ├── WebFormPublishedNames.java │ │ ├── AuthenticationMethod.java │ │ ├── WebFormValues.java │ │ ├── HttpSuccess.java │ │ ├── UpdateInstanceRequestBody.java │ │ ├── WebFormInstanceList.java │ │ ├── WebFormInstanceEnvelopes.java │ │ ├── WebFormUserInfo.java │ │ ├── PhoneNumber.java │ │ ├── HttpError.java │ │ ├── WebForm.java │ │ ├── WebFormProperties.java │ │ ├── WebFormComponent.java │ │ ├── WebFormInstanceRecipients.java │ │ ├── CreateInstanceRequestBodyRecipients.java │ │ ├── TemplateProperties.java │ │ ├── WebFormContent.java │ │ ├── WebFormSummaryList.java │ │ ├── WebFormInstanceMetadata.java │ │ ├── WebFormSummary.java │ │ └── CreateInstanceRequestBody.java │ │ └── api │ │ └── FormManagementApi.java └── test │ └── java │ └── FormManagementUnitTests.java ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── LICENSE ├── .swagger-codegen-ignore ├── CHANGELOG.md ├── stylesheets ├── github-light.css ├── stylesheet.css └── normalize.css └── README.md /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 2.4.21 -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "docusign-webforms-java" -------------------------------------------------------------------------------- /src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/AccessTokenListener.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.client.auth; 2 | 3 | import com.docusign.webforms.client.auth.OAuth.OAuthToken; 4 | 5 | public interface AccessTokenListener { 6 | void notify(OAuthToken token); 7 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/OAuthFlow.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client.auth; 4 | 5 | /** 6 | * enum. 7 | * 8 | */ 9 | 10 | public enum OAuthFlow { 11 | accessCode, implicit, password, application, jwt 12 | } 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 17 23:08:05 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | replay_pid* 25 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/Authentication.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client.auth; 4 | 5 | import com.docusign.webforms.client.Pair; 6 | 7 | import java.util.Map; 8 | import java.util.List; 9 | 10 | public interface Authentication { 11 | /** 12 | * Apply authentication settings to header and query params. 13 | * 14 | * @param queryParams List of query parameters 15 | * @param headerParams Map of header parameters 16 | */ 17 | void applyToParams(List queryParams, Map headerParams); 18 | } 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | install: true 4 | 5 | branches: 6 | only: 7 | - master 8 | 9 | language: java 10 | 11 | notifications: 12 | email: 13 | recipients: 14 | - devcenter@docusign.com 15 | on_success: never 16 | on_failure: change 17 | 18 | jdk: 19 | - oraclejdk11 20 | - oraclejdk12 21 | - oraclejdk13 22 | 23 | script: mvn -X clean test 24 | 25 | after_failure: "cat /home/travis/build/docusign/docusign-java-client/target/surefire-reports/SdkUnitTests.txt && cat /home/travis/build/docusign/docusign-java-client/target/surefire-reports/TEST-SdkUnitTests.xml" 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/RFC3339DateFormat.java: -------------------------------------------------------------------------------- 1 | 2 | package com.docusign.webforms.client; 3 | 4 | import com.fasterxml.jackson.databind.util.ISO8601DateFormat; 5 | import com.fasterxml.jackson.databind.util.ISO8601Utils; 6 | 7 | import java.text.FieldPosition; 8 | import java.util.Date; 9 | 10 | /** 11 | * RFC3339DateFormat class. 12 | * 13 | **/ 14 | public class RFC3339DateFormat extends ISO8601DateFormat { 15 | 16 | // Same as ISO8601DateFormat but serializing milliseconds. 17 | @Override 18 | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { 19 | String value = ISO8601Utils.format(date, true); 20 | toAppendTo.append(value); 21 | return toAppendTo; 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/Configuration.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client; 4 | 5 | 6 | /** 7 | * Configuration class. 8 | * 9 | **/ 10 | public class Configuration { 11 | private static ApiClient defaultApiClient = new ApiClient(); 12 | 13 | /** 14 | * Get the default API client, which would be used when creating API 15 | * instances without providing an API client. 16 | * 17 | * @return Default API client 18 | */ 19 | public static ApiClient getDefaultApiClient() { 20 | return defaultApiClient; 21 | } 22 | 23 | /** 24 | * Set the default API client, which would be used when creating API 25 | * instances without providing an API client. 26 | * 27 | * @param apiClient API client 28 | */ 29 | public static void setDefaultApiClient(ApiClient apiClient) { 30 | defaultApiClient = apiClient; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormState.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The state of the form content 13 | */ 14 | public enum WebFormState { 15 | 16 | ACTIVE("active"), 17 | 18 | DRAFT("draft"); 19 | 20 | private String value; 21 | 22 | WebFormState(String value) { 23 | this.value = value; 24 | } 25 | 26 | @JsonValue 27 | public String getValue() { 28 | return value; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return String.valueOf(value); 34 | } 35 | 36 | @JsonCreator 37 | public static WebFormState fromValue(String value) { 38 | for (WebFormState b : WebFormState.values()) { 39 | if (b.value.equals(value)) { 40 | return b; 41 | } 42 | } 43 | return null; 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/UserFilter.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | 10 | /** 11 | * Filter which forms are returned 12 | */ 13 | public enum UserFilter { 14 | 15 | OWNED_BY_ME("owned_by_me"), 16 | 17 | SHARED_WITH_ME("shared_with_me"), 18 | 19 | ALL("all"); 20 | 21 | private String value; 22 | 23 | UserFilter(String value) { 24 | this.value = value; 25 | } 26 | 27 | @JsonValue 28 | public String getValue() { 29 | return value; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return String.valueOf(value); 35 | } 36 | 37 | @JsonCreator 38 | public static UserFilter fromValue(String value) { 39 | for (UserFilter b : UserFilter.values()) { 40 | if (b.value.equals(value)) { 41 | return b; 42 | } 43 | } 44 | return null; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormType.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The field indicates webform type. 13 | */ 14 | public enum WebFormType { 15 | 16 | STANDALONE("standalone"), 17 | 18 | HASESIGNTEMPLATE("hasEsignTemplate"); 19 | 20 | private String value; 21 | 22 | WebFormType(String value) { 23 | this.value = value; 24 | } 25 | 26 | @JsonValue 27 | public String getValue() { 28 | return value; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return String.valueOf(value); 34 | } 35 | 36 | @JsonCreator 37 | public static WebFormType fromValue(String value) { 38 | for (WebFormType b : WebFormType.values()) { 39 | if (b.value.equals(value)) { 40 | return b; 41 | } 42 | } 43 | return null; 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/SendOption.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * Specifies the delivery behavior of the web form. - `now`: The web form will be sent immediately. 13 | */ 14 | public enum SendOption { 15 | 16 | NOW("now"); 17 | 18 | private String value; 19 | 20 | SendOption(String value) { 21 | this.value = value; 22 | } 23 | 24 | @JsonValue 25 | public String getValue() { 26 | return value; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return String.valueOf(value); 32 | } 33 | 34 | @JsonCreator 35 | public static SendOption fromValue(String value) { 36 | for (SendOption b : SendOption.values()) { 37 | if (b.value.equals(value)) { 38 | return b; 39 | } 40 | } 41 | return null; 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/Source.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | 10 | /** 11 | * The method through which form instance is created. 12 | */ 13 | public enum Source { 14 | 15 | PUBLIC_URL("PUBLIC_URL"), 16 | 17 | API_EMBEDDED("API_EMBEDDED"), 18 | 19 | API_REMOTE("API_REMOTE"), 20 | 21 | UI_REMOTE("UI_REMOTE"); 22 | 23 | private String value; 24 | 25 | Source(String value) { 26 | this.value = value; 27 | } 28 | 29 | @JsonValue 30 | public String getValue() { 31 | return value; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return String.valueOf(value); 37 | } 38 | 39 | @JsonCreator 40 | public static Source fromValue(String value) { 41 | for (Source b : Source.values()) { 42 | if (b.value.equals(value)) { 43 | return b; 44 | } 45 | } 46 | return null; 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormSource.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The source from which the web form is created. 13 | */ 14 | public enum WebFormSource { 15 | 16 | TEMPLATES("templates"), 17 | 18 | BLANK("blank"), 19 | 20 | FORM("form"); 21 | 22 | private String value; 23 | 24 | WebFormSource(String value) { 25 | this.value = value; 26 | } 27 | 28 | @JsonValue 29 | public String getValue() { 30 | return value; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.valueOf(value); 36 | } 37 | 38 | @JsonCreator 39 | public static WebFormSource fromValue(String value) { 40 | for (WebFormSource b : WebFormSource.values()) { 41 | if (b.value.equals(value)) { 42 | return b; 43 | } 44 | } 45 | return null; 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2023- DocuSign, Inc. (https://www.docusign.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.swagger-codegen-ignore: -------------------------------------------------------------------------------- 1 | # Swagger Codegen Ignore 2 | 3 | # Use this file to prevent files from being overwritten by the generator. 4 | # The patterns follow closely to .gitignore or .dockerignore. 5 | 6 | # As an example, the C# client generator defines ApiClient.cs. 7 | # You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: 8 | #ApiClient.cs 9 | 10 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 11 | #foo/*/qux 12 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 13 | 14 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 15 | #foo/**/qux 16 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 17 | 18 | # You can also negate patterns with an exclamation (!). 19 | # For example, you can ignore all files in a docs folder with the file extension .md: 20 | #docs/*.md 21 | # Then explicitly reverse the ignore rule for a single file: 22 | #!docs/README.md 23 | 24 | # Swagger and Git files 25 | .swagger-codegen-ignore 26 | git_push.sh 27 | 28 | # Project files 29 | LICENSE 30 | gradle* 31 | build.sbt 32 | .travis.yml 33 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/InstanceRecipientStatus.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The current status of the instance for the recipient 13 | */ 14 | public enum InstanceRecipientStatus { 15 | 16 | INITIATED("INITIATED"), 17 | 18 | IN_PROGRESS("IN_PROGRESS"), 19 | 20 | SUBMITTED("SUBMITTED"); 21 | 22 | private String value; 23 | 24 | InstanceRecipientStatus(String value) { 25 | this.value = value; 26 | } 27 | 28 | @JsonValue 29 | public String getValue() { 30 | return value; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.valueOf(value); 36 | } 37 | 38 | @JsonCreator 39 | public static InstanceRecipientStatus fromValue(String value) { 40 | for (InstanceRecipientStatus b : InstanceRecipientStatus.values()) { 41 | if (b.value.equals(value)) { 42 | return b; 43 | } 44 | } 45 | return null; 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/InstanceSource.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The method through which form instance is created. 13 | */ 14 | public enum InstanceSource { 15 | 16 | PUBLIC_URL("PUBLIC_URL"), 17 | 18 | API_EMBEDDED("API_EMBEDDED"), 19 | 20 | API_REMOTE("API_REMOTE"), 21 | 22 | UI_REMOTE("UI_REMOTE"), 23 | 24 | WORKFLOW("WORKFLOW"); 25 | 26 | private String value; 27 | 28 | InstanceSource(String value) { 29 | this.value = value; 30 | } 31 | 32 | @JsonValue 33 | public String getValue() { 34 | return value; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return String.valueOf(value); 40 | } 41 | 42 | @JsonCreator 43 | public static InstanceSource fromValue(String value) { 44 | for (InstanceSource b : InstanceSource.values()) { 45 | if (b.value.equals(value)) { 46 | return b; 47 | } 48 | } 49 | return null; 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormComponentType.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * Type of components used in the web form 13 | */ 14 | public enum WebFormComponentType { 15 | 16 | CHECKBOXGROUP("CheckboxGroup"), 17 | 18 | DATE("Date"), 19 | 20 | EMAIL("Email"), 21 | 22 | NUMBER("Number"), 23 | 24 | RADIOBUTTONGROUP("RadioButtonGroup"), 25 | 26 | SELECT("Select"), 27 | 28 | TEXTBOX("TextBox"), 29 | 30 | FILEINPUT("FileInput"); 31 | 32 | private String value; 33 | 34 | WebFormComponentType(String value) { 35 | this.value = value; 36 | } 37 | 38 | @JsonValue 39 | public String getValue() { 40 | return value; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return String.valueOf(value); 46 | } 47 | 48 | @JsonCreator 49 | public static WebFormComponentType fromValue(String value) { 50 | for (WebFormComponentType b : WebFormComponentType.values()) { 51 | if (b.value.equals(value)) { 52 | return b; 53 | } 54 | } 55 | return null; 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/InstanceStatus.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * The status of Web Form Instance. If the form status is INITIATED, it means the form is accessible until it is submitted or expired. If the form status is SUBMITTED, it means the form is submitted already and hence, cannot be opened again. 13 | */ 14 | public enum InstanceStatus { 15 | 16 | INITIATED("INITIATED"), 17 | 18 | IN_PROGRESS("IN_PROGRESS"), 19 | 20 | SUBMITTED("SUBMITTED"), 21 | 22 | EXPIRED("EXPIRED"), 23 | 24 | FAILED("FAILED"); 25 | 26 | private String value; 27 | 28 | InstanceStatus(String value) { 29 | this.value = value; 30 | } 31 | 32 | @JsonValue 33 | public String getValue() { 34 | return value; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return String.valueOf(value); 40 | } 41 | 42 | @JsonCreator 43 | public static InstanceStatus fromValue(String value) { 44 | for (InstanceStatus b : InstanceStatus.values()) { 45 | if (b.value.equals(value)) { 46 | return b; 47 | } 48 | } 49 | return null; 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/Pair.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client; 4 | 5 | 6 | 7 | /** 8 | * Pair class. 9 | */ 10 | public class Pair { 11 | private String name = ""; 12 | private String value = ""; 13 | 14 | /** 15 | * Pair constructor. 16 | * 17 | * @param name The pair name 18 | * @param value The pair value 19 | */ 20 | public Pair (String name, String value) { 21 | setName(name); 22 | setValue(value); 23 | } 24 | 25 | private void setName(String name) { 26 | if (!isValidString(name)) { 27 | return; 28 | } 29 | 30 | this.name = name; 31 | } 32 | 33 | private void setValue(String value) { 34 | if (!isValidString(value)) { 35 | return; 36 | } 37 | 38 | this.value = value; 39 | } 40 | 41 | /** 42 | * getName method. 43 | * 44 | * @return String 45 | */ 46 | public String getName() { 47 | return this.name; 48 | } 49 | 50 | /** 51 | * getValue method. 52 | * 53 | * @return String 54 | */ 55 | public String getValue() { 56 | return this.value; 57 | } 58 | 59 | private boolean isValidString(String arg) { 60 | if (arg == null) { 61 | return false; 62 | } 63 | 64 | if (arg.trim().isEmpty()) { 65 | return false; 66 | } 67 | 68 | return true; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/ApiResponse.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | /** 9 | * API response returned by API call. 10 | * 11 | * @param The type of data that is deserialized from response body 12 | */ 13 | public class ApiResponse { 14 | private final int statusCode; 15 | private final Map> headers; 16 | private final T data; 17 | 18 | /** 19 | * ApiResponse method. 20 | * 21 | * @param statusCode The status code of HTTP response 22 | * @param headers The headers of HTTP response 23 | */ 24 | public ApiResponse(int statusCode, Map> headers) { 25 | this(statusCode, headers, null); 26 | } 27 | 28 | /** 29 | * ApiResponse method. 30 | * 31 | * @param statusCode The status code of HTTP response 32 | * @param headers The headers of HTTP response 33 | * @param data The object deserialized from response bod 34 | */ 35 | public ApiResponse(int statusCode, Map> headers, T data) { 36 | this.statusCode = statusCode; 37 | this.headers = headers; 38 | this.data = data; 39 | } 40 | 41 | public int getStatusCode() { 42 | return statusCode; 43 | } 44 | 45 | public Map> getHeaders() { 46 | return headers; 47 | } 48 | 49 | public T getData() { 50 | return data; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/StringUtil.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client; 4 | 5 | 6 | /** 7 | * StringUtil class. 8 | * 9 | **/ 10 | public class StringUtil { 11 | /** 12 | * Check if the given array contains the given value (with case-insensitive comparison). 13 | * 14 | * @param array The array 15 | * @param value The value to search 16 | * @return true if the array contains the value 17 | */ 18 | public static boolean containsIgnoreCase(String[] array, String value) { 19 | for (String str : array) { 20 | if (value == null && str == null) { 21 | return true; 22 | } 23 | 24 | if (value != null && value.equalsIgnoreCase(str)) { 25 | return true; 26 | } 27 | } 28 | return false; 29 | } 30 | 31 | /** 32 | * Join an array of strings with the given separator. 33 | *

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

37 | * 38 | * @param array The array of strings 39 | * @param separator The separator 40 | * @return the resulting string 41 | */ 42 | public static String join(String[] array, String separator) { 43 | int len = array.length; 44 | if (len == 0) { 45 | return ""; 46 | } 47 | 48 | StringBuilder out = new StringBuilder(); 49 | out.append(array[0]); 50 | for (int i = 1; i < len; i++) { 51 | out.append(separator).append(array[i]); 52 | } 53 | return out.toString(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormAdmType.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | 10 | /** 11 | * Type used at ADM model as ComponentType decorator. \"String\", \"Boolean\", \"Double\", \"DateTime\", ArrayOfString\" are deprecated. 12 | */ 13 | public enum WebFormAdmType { 14 | 15 | STRING("String"), 16 | 17 | BOOLEAN("Boolean"), 18 | 19 | DOUBLE("Double"), 20 | 21 | DATETIME("DateTime"), 22 | 23 | ARRAYOFSTRING("ArrayOfString"), 24 | 25 | CHECKBOXGROUP("CheckboxGroup"), 26 | 27 | DATE("Date"), 28 | 29 | EMAIL("Email"), 30 | 31 | NUMBER("Number"), 32 | 33 | RADIOBUTTONGROUP("RadioButtonGroup"), 34 | 35 | SELECT("Select"), 36 | 37 | TEXTBOX("TextBox"); 38 | 39 | private String value; 40 | 41 | WebFormAdmType(String value) { 42 | this.value = value; 43 | } 44 | 45 | @JsonValue 46 | public String getValue() { 47 | return value; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return String.valueOf(value); 53 | } 54 | 55 | @JsonCreator 56 | public static WebFormAdmType fromValue(String value) { 57 | for (WebFormAdmType b : WebFormAdmType.values()) { 58 | if (b.value.equals(value)) { 59 | return b; 60 | } 61 | } 62 | return null; 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/Tags.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | 7 | /** 8 | * List of tags provided by the user with each request. This field is optional.. 9 | * 10 | */ 11 | @Schema(description = "List of tags provided by the user with each request. This field is optional.") 12 | 13 | public class Tags extends java.util.ArrayList { 14 | 15 | /** 16 | * Compares objects. 17 | * 18 | * @return true or false depending on comparison result. 19 | */ 20 | @Override 21 | public boolean equals(java.lang.Object o) { 22 | if (this == o) { 23 | return true; 24 | } 25 | if (o == null || getClass() != o.getClass()) { 26 | return false; 27 | } 28 | return super.equals(o); 29 | } 30 | 31 | /** 32 | * Returns the HashCode. 33 | */ 34 | @Override 35 | public int hashCode() { 36 | return Objects.hash(super.hashCode()); 37 | } 38 | 39 | 40 | /** 41 | * Converts the given object to string. 42 | */ 43 | @Override 44 | public String toString() { 45 | StringBuilder sb = new StringBuilder(); 46 | sb.append("class Tags {\n"); 47 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 48 | sb.append("}"); 49 | return sb.toString(); 50 | } 51 | 52 | /** 53 | * Convert the given object to string with each line indented by 4 spaces 54 | * (except the first line). 55 | */ 56 | private String toIndentedString(java.lang.Object o) { 57 | if (o == null) { 58 | return "null"; 59 | } 60 | return o.toString().replace("\n", "\n "); 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormComponentsMap.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormComponent; 6 | import io.swagger.v3.oas.annotations.media.Schema; 7 | 8 | /** 9 | * The components map for the web form. 10 | * 11 | */ 12 | @Schema(description = "The components map for the web form") 13 | 14 | public class WebFormComponentsMap extends java.util.HashMap { 15 | 16 | /** 17 | * Compares objects. 18 | * 19 | * @return true or false depending on comparison result. 20 | */ 21 | @Override 22 | public boolean equals(java.lang.Object o) { 23 | if (this == o) { 24 | return true; 25 | } 26 | if (o == null || getClass() != o.getClass()) { 27 | return false; 28 | } 29 | return super.equals(o); 30 | } 31 | 32 | /** 33 | * Returns the HashCode. 34 | */ 35 | @Override 36 | public int hashCode() { 37 | return Objects.hash(super.hashCode()); 38 | } 39 | 40 | 41 | /** 42 | * Converts the given object to string. 43 | */ 44 | @Override 45 | public String toString() { 46 | StringBuilder sb = new StringBuilder(); 47 | sb.append("class WebFormComponentsMap {\n"); 48 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 49 | sb.append("}"); 50 | return sb.toString(); 51 | } 52 | 53 | /** 54 | * Convert the given object to string with each line indented by 4 spaces 55 | * (except the first line). 56 | */ 57 | private String toIndentedString(java.lang.Object o) { 58 | if (o == null) { 59 | return "null"; 60 | } 61 | return o.toString().replace("\n", "\n "); 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormPublishedNames.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | 7 | /** 8 | * A collection of the published component name and its corresponding type. 9 | * 10 | */ 11 | @Schema(description = "A collection of the published component name and its corresponding type") 12 | 13 | public class WebFormPublishedNames extends java.util.HashMap { 14 | 15 | /** 16 | * Compares objects. 17 | * 18 | * @return true or false depending on comparison result. 19 | */ 20 | @Override 21 | public boolean equals(java.lang.Object o) { 22 | if (this == o) { 23 | return true; 24 | } 25 | if (o == null || getClass() != o.getClass()) { 26 | return false; 27 | } 28 | return super.equals(o); 29 | } 30 | 31 | /** 32 | * Returns the HashCode. 33 | */ 34 | @Override 35 | public int hashCode() { 36 | return Objects.hash(super.hashCode()); 37 | } 38 | 39 | 40 | /** 41 | * Converts the given object to string. 42 | */ 43 | @Override 44 | public String toString() { 45 | StringBuilder sb = new StringBuilder(); 46 | sb.append("class WebFormPublishedNames {\n"); 47 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 48 | sb.append("}"); 49 | return sb.toString(); 50 | } 51 | 52 | /** 53 | * Convert the given object to string with each line indented by 4 spaces 54 | * (except the first line). 55 | */ 56 | private String toIndentedString(java.lang.Object o) { 57 | if (o == null) { 58 | return "null"; 59 | } 60 | return o.toString().replace("\n", "\n "); 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client.auth; 4 | 5 | import com.docusign.webforms.client.Pair; 6 | 7 | import java.util.Base64; 8 | import java.nio.charset.StandardCharsets; 9 | 10 | import java.util.Map; 11 | import java.util.List; 12 | 13 | 14 | 15 | 16 | /** 17 | * HttpBasicAuth class. 18 | * 19 | */ 20 | public class HttpBasicAuth implements Authentication { 21 | private String username; 22 | private String password; 23 | 24 | /** 25 | * getUsername method. 26 | * 27 | * @return String 28 | */ 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | /** 34 | * setUsername method. 35 | * 36 | * @param username Sets username 37 | */ 38 | public void setUsername(String username) { 39 | this.username = username; 40 | } 41 | 42 | /** 43 | * getPassword method. 44 | * 45 | * @return String 46 | */ 47 | public String getPassword() { 48 | return password; 49 | } 50 | 51 | /** 52 | * setPassword method. 53 | * 54 | * @param password Sets password 55 | */ 56 | public void setPassword(String password) { 57 | this.password = password; 58 | } 59 | 60 | /** 61 | * applyToParams method. 62 | * 63 | * @param queryParams The query params 64 | * @param headerParams The header params 65 | */ 66 | @Override 67 | public void applyToParams(List queryParams, Map headerParams) { 68 | if (username == null && password == null) { 69 | return; 70 | } 71 | String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); 72 | headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/JSON.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.client; 2 | 3 | import com.fasterxml.jackson.annotation.*; 4 | import com.fasterxml.jackson.databind.*; 5 | 6 | import java.text.DateFormat; 7 | 8 | import jakarta.ws.rs.ext.ContextResolver; 9 | 10 | 11 | 12 | /** 13 | * JSON Class. 14 | * 15 | **/ 16 | 17 | public class JSON implements ContextResolver { 18 | private ObjectMapper mapper; 19 | 20 | /** 21 | * JSON Class constructor doc. 22 | * 23 | **/ 24 | public JSON() { 25 | mapper = new ObjectMapper(); 26 | mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); 27 | mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); 28 | mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); 29 | mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); 30 | mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); 31 | mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); 32 | mapper.setDateFormat(new RFC3339DateFormat()); 33 | } 34 | 35 | /** 36 | * Returns the current object mapper used for JSON serialization/deserialization. 37 | *

38 | * Note: If you make changes to the object mapper, remember to set it back via 39 | * setObjectMapper in order to trigger HTTP client rebuilding. 40 | *

41 | * @return Object mapper 42 | */ 43 | public ObjectMapper getObjectMapper() { 44 | return mapper; 45 | } 46 | 47 | public JSON setObjectMapper(ObjectMapper mapper) { 48 | this.mapper = mapper; 49 | return this; 50 | } 51 | 52 | /** 53 | * Set the date format for JSON (de)serialization with Date properties. 54 | * @param dateFormat Date format 55 | */ 56 | public void setDateFormat(DateFormat dateFormat) { 57 | mapper.setDateFormat(dateFormat); 58 | } 59 | 60 | @Override 61 | public ObjectMapper getContext(Class type) { 62 | return mapper; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/AuthenticationMethod.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | 11 | /** 12 | * A value that most closely matches the technique your application used to authenticate the recipient / signer. 13 | */ 14 | public enum AuthenticationMethod { 15 | 16 | BIOMETRIC("Biometric"), 17 | 18 | EMAIL("Email"), 19 | 20 | HTTPBASICAUTH("HTTPBasicAuth"), 21 | 22 | KERBEROS("Kerberos"), 23 | 24 | KNOWLEDGEBASEDAUTH("KnowledgeBasedAuth"), 25 | 26 | NONE("None"), 27 | 28 | PAPERDOCUMENTS("PaperDocuments"), 29 | 30 | PASSWORD("Password"), 31 | 32 | RSASECUREID("RSASecureID"), 33 | 34 | SINGLESIGNON_CASITEMINDER("SingleSignOn_CASiteminder"), 35 | 36 | SINGLESIGNON_INFOCARD("SingleSignOn_InfoCard"), 37 | 38 | SINGLESIGNON_MICROSOFTACTIVEDIRECTORY("SingleSignOn_MicrosoftActiveDirectory"), 39 | 40 | SINGLESIGNON_OTHER("SingleSignOn_Other"), 41 | 42 | SINGLESIGNON_PASSPORT("SingleSignOn_Passport"), 43 | 44 | SINGLESIGNON_SAML("SingleSignOn_SAML"), 45 | 46 | SMARTCARD("Smartcard"), 47 | 48 | SSLMUTUALAUTH("SSLMutualAuth"), 49 | 50 | X509CERTIFICATE("X509Certificate"); 51 | 52 | private String value; 53 | 54 | AuthenticationMethod(String value) { 55 | this.value = value; 56 | } 57 | 58 | @JsonValue 59 | public String getValue() { 60 | return value; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | return String.valueOf(value); 66 | } 67 | 68 | @JsonCreator 69 | public static AuthenticationMethod fromValue(String value) { 70 | for (AuthenticationMethod b : AuthenticationMethod.values()) { 71 | if (b.value.equals(value)) { 72 | return b; 73 | } 74 | } 75 | return null; 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormValues.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import io.swagger.v3.oas.annotations.media.Schema; 6 | import java.io.Serializable; 7 | 8 | /** 9 | * Key-value pairs (where key is the component name and value is the form value) used to create a form instance. For key of type TextBox, Email, Date, Select and RadioButtonGroup the value is of string type. For key of type Number, the value is of number type. For key of type of CheckboxGroup, the value is of type array of string.. 10 | * 11 | */ 12 | @Schema(description = "Key-value pairs (where key is the component name and value is the form value) used to create a form instance. For key of type TextBox, Email, Date, Select and RadioButtonGroup the value is of string type. For key of type Number, the value is of number type. For key of type of CheckboxGroup, the value is of type array of string.") 13 | 14 | public class WebFormValues extends java.util.HashMap implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | 18 | /** 19 | * Compares objects. 20 | * 21 | * @return true or false depending on comparison result. 22 | */ 23 | @Override 24 | public boolean equals(java.lang.Object o) { 25 | if (this == o) { 26 | return true; 27 | } 28 | if (o == null || getClass() != o.getClass()) { 29 | return false; 30 | } 31 | return super.equals(o); 32 | } 33 | 34 | /** 35 | * Returns the HashCode. 36 | */ 37 | @Override 38 | public int hashCode() { 39 | return Objects.hash(super.hashCode()); 40 | } 41 | 42 | 43 | /** 44 | * Converts the given object to string. 45 | */ 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class WebFormValues {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(java.lang.Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/ApiKeyAuth.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client.auth; 4 | 5 | import com.docusign.webforms.client.Pair; 6 | 7 | import java.util.Map; 8 | import java.util.List; 9 | 10 | 11 | /** 12 | * ApiKeyAuth class. 13 | * 14 | */ 15 | public class ApiKeyAuth implements Authentication { 16 | private final String location; 17 | private final String paramName; 18 | 19 | private String apiKey; 20 | private String apiKeyPrefix; 21 | 22 | /** 23 | * ApiKeyAuth constructor. 24 | * 25 | * @param location Sets location 26 | * @param paramName Sets paramName 27 | */ 28 | public ApiKeyAuth(String location, String paramName) { 29 | this.location = location; 30 | this.paramName = paramName; 31 | } 32 | 33 | /** 34 | * getLocation method. 35 | * 36 | * @return String 37 | */ 38 | public String getLocation() { 39 | return location; 40 | } 41 | 42 | /** 43 | * getParamName method. 44 | * 45 | * @return String 46 | */ 47 | public String getParamName() { 48 | return paramName; 49 | } 50 | 51 | /** 52 | * getApiKey method. 53 | * 54 | * @return String 55 | */ 56 | public String getApiKey() { 57 | return apiKey; 58 | } 59 | 60 | /** 61 | * setApiKey method. 62 | * 63 | * @param apiKey The apiKey 64 | */ 65 | public void setApiKey(String apiKey) { 66 | this.apiKey = apiKey; 67 | } 68 | 69 | /** 70 | * getApiKeyPrefix method. 71 | * 72 | * @return String 73 | */ 74 | public String getApiKeyPrefix() { 75 | return apiKeyPrefix; 76 | } 77 | 78 | /** 79 | * setApiKeyPrefix method. 80 | * 81 | * @param apiKeyPrefix The apiKeyPrefix 82 | */ 83 | public void setApiKeyPrefix(String apiKeyPrefix) { 84 | this.apiKeyPrefix = apiKeyPrefix; 85 | } 86 | 87 | /** 88 | * applyToParams method. 89 | * 90 | * @param queryParams The query params 91 | * @param headerParams The header params 92 | */ 93 | @Override 94 | public void applyToParams(List queryParams, Map headerParams) { 95 | if (apiKey == null) { 96 | return; 97 | } 98 | String value; 99 | if (apiKeyPrefix != null) { 100 | value = apiKeyPrefix + " " + apiKey; 101 | } else { 102 | value = apiKey; 103 | } 104 | if ("query".equals(location)) { 105 | queryParams.add(new Pair(paramName, value)); 106 | } else if ("header".equals(location)) { 107 | headerParams.put(paramName, value); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/HttpSuccess.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * A simple response indicating success when no extra data is needed. 13 | * 14 | */ 15 | @Schema(description = "A simple response indicating success when no extra data is needed") 16 | 17 | public class HttpSuccess implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("status") 21 | private String status = null; 22 | 23 | 24 | /** 25 | * status. 26 | * 27 | * @return HttpSuccess 28 | **/ 29 | public HttpSuccess status(String status) { 30 | this.status = status; 31 | return this; 32 | } 33 | 34 | /** 35 | * Get status. 36 | * @return status 37 | **/ 38 | @Schema(description = "") 39 | public String getStatus() { 40 | return status; 41 | } 42 | 43 | /** 44 | * setStatus. 45 | **/ 46 | public void setStatus(String status) { 47 | this.status = status; 48 | } 49 | 50 | 51 | /** 52 | * Compares objects. 53 | * 54 | * @return true or false depending on comparison result. 55 | */ 56 | @Override 57 | public boolean equals(java.lang.Object o) { 58 | if (this == o) { 59 | return true; 60 | } 61 | if (o == null || getClass() != o.getClass()) { 62 | return false; 63 | } 64 | HttpSuccess httpSuccess = (HttpSuccess) o; 65 | return Objects.equals(this.status, httpSuccess.status); 66 | } 67 | 68 | /** 69 | * Returns the HashCode. 70 | */ 71 | @Override 72 | public int hashCode() { 73 | return Objects.hash(status); 74 | } 75 | 76 | 77 | /** 78 | * Converts the given object to string. 79 | */ 80 | @Override 81 | public String toString() { 82 | StringBuilder sb = new StringBuilder(); 83 | sb.append("class HttpSuccess {\n"); 84 | 85 | sb.append(" status: ").append(toIndentedString(status)).append("\n"); 86 | sb.append("}"); 87 | return sb.toString(); 88 | } 89 | 90 | /** 91 | * Convert the given object to string with each line indented by 4 spaces 92 | * (except the first line). 93 | */ 94 | private String toIndentedString(java.lang.Object o) { 95 | if (o == null) { 96 | return "null"; 97 | } 98 | return o.toString().replace("\n", "\n "); 99 | } 100 | 101 | } 102 | 103 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/UpdateInstanceRequestBody.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormValues; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | 11 | /** 12 | * Request body containing properties that needs to be updated.. 13 | * 14 | */ 15 | @Schema(description = "Request body containing properties that needs to be updated.") 16 | 17 | public class UpdateInstanceRequestBody { 18 | @JsonProperty("formValues") 19 | private WebFormValues formValues = null; 20 | 21 | 22 | /** 23 | * formValues. 24 | * 25 | * @return UpdateInstanceRequestBody 26 | **/ 27 | public UpdateInstanceRequestBody formValues(WebFormValues formValues) { 28 | this.formValues = formValues; 29 | return this; 30 | } 31 | 32 | /** 33 | * Get formValues. 34 | * @return formValues 35 | **/ 36 | @Schema(description = "") 37 | public WebFormValues getFormValues() { 38 | return formValues; 39 | } 40 | 41 | /** 42 | * setFormValues. 43 | **/ 44 | public void setFormValues(WebFormValues formValues) { 45 | this.formValues = formValues; 46 | } 47 | 48 | 49 | /** 50 | * Compares objects. 51 | * 52 | * @return true or false depending on comparison result. 53 | */ 54 | @Override 55 | public boolean equals(java.lang.Object o) { 56 | if (this == o) { 57 | return true; 58 | } 59 | if (o == null || getClass() != o.getClass()) { 60 | return false; 61 | } 62 | UpdateInstanceRequestBody updateInstanceRequestBody = (UpdateInstanceRequestBody) o; 63 | return Objects.equals(this.formValues, updateInstanceRequestBody.formValues); 64 | } 65 | 66 | /** 67 | * Returns the HashCode. 68 | */ 69 | @Override 70 | public int hashCode() { 71 | return Objects.hash(formValues); 72 | } 73 | 74 | 75 | /** 76 | * Converts the given object to string. 77 | */ 78 | @Override 79 | public String toString() { 80 | StringBuilder sb = new StringBuilder(); 81 | sb.append("class UpdateInstanceRequestBody {\n"); 82 | 83 | sb.append(" formValues: ").append(toIndentedString(formValues)).append("\n"); 84 | sb.append("}"); 85 | return sb.toString(); 86 | } 87 | 88 | /** 89 | * Convert the given object to string with each line indented by 4 spaces 90 | * (except the first line). 91 | */ 92 | private String toIndentedString(java.lang.Object o) { 93 | if (o == null) { 94 | return "null"; 95 | } 96 | return o.toString().replace("\n", "\n "); 97 | } 98 | 99 | } 100 | 101 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormInstanceList.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormInstance; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * A list of web form instance items.. 14 | * 15 | */ 16 | @Schema(description = "A list of web form instance items.") 17 | 18 | public class WebFormInstanceList implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | @JsonProperty("items") 22 | private java.util.List items = null; 23 | 24 | 25 | /** 26 | * items. 27 | * 28 | * @return WebFormInstanceList 29 | **/ 30 | public WebFormInstanceList items(java.util.List items) { 31 | this.items = items; 32 | return this; 33 | } 34 | 35 | /** 36 | * addItemsItem. 37 | * 38 | * @return WebFormInstanceList 39 | **/ 40 | public WebFormInstanceList addItemsItem(WebFormInstance itemsItem) { 41 | if (this.items == null) { 42 | this.items = new java.util.ArrayList<>(); 43 | } 44 | this.items.add(itemsItem); 45 | return this; 46 | } 47 | 48 | /** 49 | * Array of web form instance items.. 50 | * @return items 51 | **/ 52 | @Schema(description = "Array of web form instance items.") 53 | public java.util.List getItems() { 54 | return items; 55 | } 56 | 57 | /** 58 | * setItems. 59 | **/ 60 | public void setItems(java.util.List items) { 61 | this.items = items; 62 | } 63 | 64 | 65 | /** 66 | * Compares objects. 67 | * 68 | * @return true or false depending on comparison result. 69 | */ 70 | @Override 71 | public boolean equals(java.lang.Object o) { 72 | if (this == o) { 73 | return true; 74 | } 75 | if (o == null || getClass() != o.getClass()) { 76 | return false; 77 | } 78 | WebFormInstanceList webFormInstanceList = (WebFormInstanceList) o; 79 | return Objects.equals(this.items, webFormInstanceList.items); 80 | } 81 | 82 | /** 83 | * Returns the HashCode. 84 | */ 85 | @Override 86 | public int hashCode() { 87 | return Objects.hash(items); 88 | } 89 | 90 | 91 | /** 92 | * Converts the given object to string. 93 | */ 94 | @Override 95 | public String toString() { 96 | StringBuilder sb = new StringBuilder(); 97 | sb.append("class WebFormInstanceList {\n"); 98 | 99 | sb.append(" items: ").append(toIndentedString(items)).append("\n"); 100 | sb.append("}"); 101 | return sb.toString(); 102 | } 103 | 104 | /** 105 | * Convert the given object to string with each line indented by 4 spaces 106 | * (except the first line). 107 | */ 108 | private String toIndentedString(java.lang.Object o) { 109 | if (o == null) { 110 | return "null"; 111 | } 112 | return o.toString().replace("\n", "\n "); 113 | } 114 | 115 | } 116 | 117 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormInstanceEnvelopes.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.time.OffsetDateTime; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * WebFormInstanceEnvelopes. 14 | * 15 | */ 16 | 17 | public class WebFormInstanceEnvelopes implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("id") 21 | private String id = null; 22 | 23 | @JsonProperty("createdDateTime") 24 | private String createdDateTime = null; 25 | 26 | 27 | /** 28 | * id. 29 | * 30 | * @return WebFormInstanceEnvelopes 31 | **/ 32 | public WebFormInstanceEnvelopes id(String id) { 33 | this.id = id; 34 | return this; 35 | } 36 | 37 | /** 38 | * Get id. 39 | * @return id 40 | **/ 41 | @Schema(description = "") 42 | public String getId() { 43 | return id; 44 | } 45 | 46 | /** 47 | * setId. 48 | **/ 49 | public void setId(String id) { 50 | this.id = id; 51 | } 52 | 53 | 54 | /** 55 | * createdDateTime. 56 | * 57 | * @return WebFormInstanceEnvelopes 58 | **/ 59 | public WebFormInstanceEnvelopes createdDateTime(String createdDateTime) { 60 | this.createdDateTime = createdDateTime; 61 | return this; 62 | } 63 | 64 | /** 65 | * The dateTime when an envelope is created.. 66 | * @return createdDateTime 67 | **/ 68 | @Schema(description = "The dateTime when an envelope is created.") 69 | public String getCreatedDateTime() { 70 | return createdDateTime; 71 | } 72 | 73 | /** 74 | * setCreatedDateTime. 75 | **/ 76 | public void setCreatedDateTime(String createdDateTime) { 77 | this.createdDateTime = createdDateTime; 78 | } 79 | 80 | 81 | /** 82 | * Compares objects. 83 | * 84 | * @return true or false depending on comparison result. 85 | */ 86 | @Override 87 | public boolean equals(java.lang.Object o) { 88 | if (this == o) { 89 | return true; 90 | } 91 | if (o == null || getClass() != o.getClass()) { 92 | return false; 93 | } 94 | WebFormInstanceEnvelopes webFormInstanceEnvelopes = (WebFormInstanceEnvelopes) o; 95 | return Objects.equals(this.id, webFormInstanceEnvelopes.id) && 96 | Objects.equals(this.createdDateTime, webFormInstanceEnvelopes.createdDateTime); 97 | } 98 | 99 | /** 100 | * Returns the HashCode. 101 | */ 102 | @Override 103 | public int hashCode() { 104 | return Objects.hash(id, createdDateTime); 105 | } 106 | 107 | 108 | /** 109 | * Converts the given object to string. 110 | */ 111 | @Override 112 | public String toString() { 113 | StringBuilder sb = new StringBuilder(); 114 | sb.append("class WebFormInstanceEnvelopes {\n"); 115 | 116 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 117 | sb.append(" createdDateTime: ").append(toIndentedString(createdDateTime)).append("\n"); 118 | sb.append("}"); 119 | return sb.toString(); 120 | } 121 | 122 | /** 123 | * Convert the given object to string with each line indented by 4 spaces 124 | * (except the first line). 125 | */ 126 | private String toIndentedString(java.lang.Object o) { 127 | if (o == null) { 128 | return "null"; 129 | } 130 | return o.toString().replace("\n", "\n "); 131 | } 132 | 133 | } 134 | 135 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [v2.1.0] - WebForms API v1.1.0-1.0.6 - 2025-09-09 2 | ### Changed 3 | - Added support for version v1.1.0-1.0.6 of the DocuSign WebForms API. 4 | - Updated the SDK release version. 5 | 6 | ## [v2.0.0] - WebForms API v1.1.0-1.0.4 - 2024-11-20 7 | ### Changed 8 | - Added support for version v1.1.0-1.0.4 of the DocuSign WebForms API. 9 | - Updated the SDK release version. 10 | - Model classes are now serializable. 11 | - Resolved an issue where setting a default SSL socket for the entire JVM caused unintended side effects. 12 | - Fixed a memory leak related to the class loader. 13 | - Addressed dependency vulnerabilities in the following libraries: 14 | - bcprov-jdk18on updated to version 1.78.1 15 | - com.fasterxml.jackson.core updated to version 2.17.1 16 | - org.json updated to version 20240303 17 | - jersey updated to version 3.1.6 18 | - Modified the default basePath to DEMO_REST_BASEPATH. 19 | 20 | ### Breaking changes 21 | - Deprecation of OLTU library: The OLTU library for handling OAuth is no longer used. 22 | ### Other Changes 23 | - Upgradation of OWASP for vulnerability check of dependencies. 24 | 25 | ## Important Action Required 26 | - User needs to update the base URL in your codebase (if passing to SDK explicitly) and remove the /v1.1 component at the end of the URL for the SDK to work properly with this release. 27 | 28 | ## [v2.0.0-RC1] - WebForms API v1.1.0-1.0.4 - 2024-09-24 29 | ### Changed 30 | - Added support for version v1.1.0-1.0.4 of the DocuSign WebForms API. 31 | - Updated the SDK release version. 32 | - Model classes are now serializable. 33 | - Resolved an issue where setting a default SSL socket for the entire JVM caused unintended side effects. 34 | - Fixed a memory leak related to the class loader. 35 | - Addressed dependency vulnerabilities in the following libraries: 36 | - bcprov-jdk18on updated to version 1.78.1 37 | - com.fasterxml.jackson.core updated to version 2.17.1 38 | - org.json updated to version 20240303 39 | - jersey updated to version 3.1.6 40 | - Modified the default basePath to DEMO_REST_BASEPATH. 41 | 42 | ### Breaking changes 43 | - Deprecation of OLTU library: The OLTU library for handling OAuth is no longer used. 44 | ### Other Changes 45 | - Upgradation of OWASP for vulnerability check of dependencies. 46 | 47 | ## Important Action Required 48 | - User needs to update the base URL in your codebase (if passing to SDK explicitly) and remove the /v1.1 component at the end of the URL for the SDK to work properly with this release. 49 | 50 | ## [v1.0.0] - WebForms API v1.1.0-1.0.2 - 2024-02-14 51 | ## Version 1.0.0 (Initial Release) 52 | - Introducing the SDK based on the OpenAPI specification of DocuSign WebForms APIs. 53 | - This release marks the initial availability of the SDK, providing developers with the necessary tools to interact with DocuSign WebForms APIs seamlessly. 54 | ## [v1.0.2-RC12] - WebForms API v1.1.0-1.0.2 - 2024-02-09 55 | ### Breaking Changes 56 | 57 | - **`baseUrl` Defaulting to DEMO URL:** 58 | - The `baseUrl` now defaults to the DEMO URL if not provided. Please update your configurations accordingly. 59 | 60 | ### Other Changes 61 | 62 | - Updated the SDK release version 63 | ## [v1.0.2-RC11] - WebForms API v1.1.0-1.0.2 - 2024-02-08 64 | ### Changed 65 | - Added support for version v1.1.0-1.0.2 of the DocuSign WebForms API. 66 | - Updated the SDK release version. 67 | 68 | ## [v1.0.1-RC9] - WebForms API v1.1.0-1.0.1 - 2024-02-05 69 | ### Changed 70 | - Added support for version v1.1.0-1.0.1 of the DocuSign WebForms API. 71 | - Updated the SDK release version. 72 | 73 | ## [v1.0.0] - WebForms API v1.1-1.1.1 - 2023-11-27 74 | ### Changed 75 | - Added support for version v1.1-1.1.1 of the DocuSign WebForms API. 76 | - Updated the SDK release version. 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormUserInfo.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * Information about a DocuSign system user. The user exists within the account associated with the form.. 13 | * 14 | */ 15 | @Schema(description = "Information about a DocuSign system user. The user exists within the account associated with the form.") 16 | 17 | public class WebFormUserInfo implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("userId") 21 | private String userId = null; 22 | 23 | @JsonProperty("userName") 24 | private String userName = null; 25 | 26 | 27 | /** 28 | * userId. 29 | * 30 | * @return WebFormUserInfo 31 | **/ 32 | public WebFormUserInfo userId(String userId) { 33 | this.userId = userId; 34 | return this; 35 | } 36 | 37 | /** 38 | * Get userId. 39 | * @return userId 40 | **/ 41 | @Schema(description = "") 42 | public String getUserId() { 43 | return userId; 44 | } 45 | 46 | /** 47 | * setUserId. 48 | **/ 49 | public void setUserId(String userId) { 50 | this.userId = userId; 51 | } 52 | 53 | 54 | /** 55 | * userName. 56 | * 57 | * @return WebFormUserInfo 58 | **/ 59 | public WebFormUserInfo userName(String userName) { 60 | this.userName = userName; 61 | return this; 62 | } 63 | 64 | /** 65 | * Name of the user that can be displayed in the user interface.. 66 | * @return userName 67 | **/ 68 | @Schema(example = "John Doe", description = "Name of the user that can be displayed in the user interface.") 69 | public String getUserName() { 70 | return userName; 71 | } 72 | 73 | /** 74 | * setUserName. 75 | **/ 76 | public void setUserName(String userName) { 77 | this.userName = userName; 78 | } 79 | 80 | 81 | /** 82 | * Compares objects. 83 | * 84 | * @return true or false depending on comparison result. 85 | */ 86 | @Override 87 | public boolean equals(java.lang.Object o) { 88 | if (this == o) { 89 | return true; 90 | } 91 | if (o == null || getClass() != o.getClass()) { 92 | return false; 93 | } 94 | WebFormUserInfo webFormUserInfo = (WebFormUserInfo) o; 95 | return Objects.equals(this.userId, webFormUserInfo.userId) && 96 | Objects.equals(this.userName, webFormUserInfo.userName); 97 | } 98 | 99 | /** 100 | * Returns the HashCode. 101 | */ 102 | @Override 103 | public int hashCode() { 104 | return Objects.hash(userId, userName); 105 | } 106 | 107 | 108 | /** 109 | * Converts the given object to string. 110 | */ 111 | @Override 112 | public String toString() { 113 | StringBuilder sb = new StringBuilder(); 114 | sb.append("class WebFormUserInfo {\n"); 115 | 116 | sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); 117 | sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); 118 | sb.append("}"); 119 | return sb.toString(); 120 | } 121 | 122 | /** 123 | * Convert the given object to string with each line indented by 4 spaces 124 | * (except the first line). 125 | */ 126 | private String toIndentedString(java.lang.Object o) { 127 | if (o == null) { 128 | return "null"; 129 | } 130 | return o.toString().replace("\n", "\n "); 131 | } 132 | 133 | } 134 | 135 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/PhoneNumber.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * Phone number of the user.. 13 | * 14 | */ 15 | @Schema(description = "Phone number of the user.") 16 | 17 | public class PhoneNumber implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("countryCode") 21 | private String countryCode = null; 22 | 23 | @JsonProperty("nationalNumber") 24 | private String nationalNumber = null; 25 | 26 | 27 | /** 28 | * countryCode. 29 | * 30 | * @return PhoneNumber 31 | **/ 32 | public PhoneNumber countryCode(String countryCode) { 33 | this.countryCode = countryCode; 34 | return this; 35 | } 36 | 37 | /** 38 | * country code of the registered phone number.. 39 | * @return countryCode 40 | **/ 41 | @Schema(example = "1", description = "country code of the registered phone number.") 42 | public String getCountryCode() { 43 | return countryCode; 44 | } 45 | 46 | /** 47 | * setCountryCode. 48 | **/ 49 | public void setCountryCode(String countryCode) { 50 | this.countryCode = countryCode; 51 | } 52 | 53 | 54 | /** 55 | * nationalNumber. 56 | * 57 | * @return PhoneNumber 58 | **/ 59 | public PhoneNumber nationalNumber(String nationalNumber) { 60 | this.nationalNumber = nationalNumber; 61 | return this; 62 | } 63 | 64 | /** 65 | * Phone number of the user (without country code).. 66 | * @return nationalNumber 67 | **/ 68 | @Schema(example = "4151112222", description = "Phone number of the user (without country code).") 69 | public String getNationalNumber() { 70 | return nationalNumber; 71 | } 72 | 73 | /** 74 | * setNationalNumber. 75 | **/ 76 | public void setNationalNumber(String nationalNumber) { 77 | this.nationalNumber = nationalNumber; 78 | } 79 | 80 | 81 | /** 82 | * Compares objects. 83 | * 84 | * @return true or false depending on comparison result. 85 | */ 86 | @Override 87 | public boolean equals(java.lang.Object o) { 88 | if (this == o) { 89 | return true; 90 | } 91 | if (o == null || getClass() != o.getClass()) { 92 | return false; 93 | } 94 | PhoneNumber phoneNumber = (PhoneNumber) o; 95 | return Objects.equals(this.countryCode, phoneNumber.countryCode) && 96 | Objects.equals(this.nationalNumber, phoneNumber.nationalNumber); 97 | } 98 | 99 | /** 100 | * Returns the HashCode. 101 | */ 102 | @Override 103 | public int hashCode() { 104 | return Objects.hash(countryCode, nationalNumber); 105 | } 106 | 107 | 108 | /** 109 | * Converts the given object to string. 110 | */ 111 | @Override 112 | public String toString() { 113 | StringBuilder sb = new StringBuilder(); 114 | sb.append("class PhoneNumber {\n"); 115 | 116 | sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); 117 | sb.append(" nationalNumber: ").append(toIndentedString(nationalNumber)).append("\n"); 118 | sb.append("}"); 119 | return sb.toString(); 120 | } 121 | 122 | /** 123 | * Convert the given object to string with each line indented by 4 spaces 124 | * (except the first line). 125 | */ 126 | private String toIndentedString(java.lang.Object o) { 127 | if (o == null) { 128 | return "null"; 129 | } 130 | return o.toString().replace("\n", "\n "); 131 | } 132 | 133 | } 134 | 135 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/HttpError.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * An error occurred while processing a request. Source - https://www.baeldung.com/rest-api-error-handling-best-practices. 13 | * 14 | */ 15 | @Schema(description = "An error occurred while processing a request. Source - https://www.baeldung.com/rest-api-error-handling-best-practices") 16 | 17 | public class HttpError implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("errorCode") 21 | private String errorCode = null; 22 | 23 | @JsonProperty("message") 24 | private String message = null; 25 | 26 | 27 | /** 28 | * errorCode. 29 | * 30 | * @return HttpError 31 | **/ 32 | public HttpError errorCode(String errorCode) { 33 | this.errorCode = errorCode; 34 | return this; 35 | } 36 | 37 | /** 38 | * A granular, human and computer readable code indicating more deeply what error occurred.. 39 | * @return errorCode 40 | **/ 41 | @Schema(description = "A granular, human and computer readable code indicating more deeply what error occurred.") 42 | public String getErrorCode() { 43 | return errorCode; 44 | } 45 | 46 | /** 47 | * setErrorCode. 48 | **/ 49 | public void setErrorCode(String errorCode) { 50 | this.errorCode = errorCode; 51 | } 52 | 53 | 54 | /** 55 | * message. 56 | * 57 | * @return HttpError 58 | **/ 59 | public HttpError message(String message) { 60 | this.message = message; 61 | return this; 62 | } 63 | 64 | /** 65 | * A human-readable description of the error, meant for developers to store for their review.. 66 | * @return message 67 | **/ 68 | @Schema(description = "A human-readable description of the error, meant for developers to store for their review.") 69 | public String getMessage() { 70 | return message; 71 | } 72 | 73 | /** 74 | * setMessage. 75 | **/ 76 | public void setMessage(String message) { 77 | this.message = message; 78 | } 79 | 80 | 81 | /** 82 | * Compares objects. 83 | * 84 | * @return true or false depending on comparison result. 85 | */ 86 | @Override 87 | public boolean equals(java.lang.Object o) { 88 | if (this == o) { 89 | return true; 90 | } 91 | if (o == null || getClass() != o.getClass()) { 92 | return false; 93 | } 94 | HttpError httpError = (HttpError) o; 95 | return Objects.equals(this.errorCode, httpError.errorCode) && 96 | Objects.equals(this.message, httpError.message); 97 | } 98 | 99 | /** 100 | * Returns the HashCode. 101 | */ 102 | @Override 103 | public int hashCode() { 104 | return Objects.hash(errorCode, message); 105 | } 106 | 107 | 108 | /** 109 | * Converts the given object to string. 110 | */ 111 | @Override 112 | public String toString() { 113 | StringBuilder sb = new StringBuilder(); 114 | sb.append("class HttpError {\n"); 115 | 116 | sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); 117 | sb.append(" message: ").append(toIndentedString(message)).append("\n"); 118 | sb.append("}"); 119 | return sb.toString(); 120 | } 121 | 122 | /** 123 | * Convert the given object to string with each line indented by 4 spaces 124 | * (except the first line). 125 | */ 126 | private String toIndentedString(java.lang.Object o) { 127 | if (o == null) { 128 | return "null"; 129 | } 130 | return o.toString().replace("\n", "\n "); 131 | } 132 | 133 | } 134 | 135 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebForm.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormContent; 6 | import com.docusign.webforms.model.WebFormMetadata; 7 | import com.docusign.webforms.model.WebFormProperties; 8 | import com.docusign.webforms.model.WebFormState; 9 | import com.docusign.webforms.model.WebFormSummary; 10 | import com.fasterxml.jackson.annotation.JsonProperty; 11 | import com.fasterxml.jackson.annotation.JsonCreator; 12 | import com.fasterxml.jackson.annotation.JsonValue; 13 | import io.swagger.v3.oas.annotations.media.Schema; 14 | import java.io.Serializable; 15 | 16 | /** 17 | * An object that fully describes an instance of a form. 18 | * 19 | */ 20 | @Schema(description = "An object that fully describes an instance of a form") 21 | 22 | public class WebForm extends WebFormSummary implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | @JsonProperty("versionId") 26 | private Integer versionId = null; 27 | 28 | @JsonProperty("formContent") 29 | private WebFormContent formContent = null; 30 | 31 | 32 | /** 33 | * versionId. 34 | * 35 | * @return WebForm 36 | **/ 37 | public WebForm versionId(Integer versionId) { 38 | this.versionId = versionId; 39 | return this; 40 | } 41 | 42 | /** 43 | * Get versionId. 44 | * @return versionId 45 | **/ 46 | @Schema(description = "") 47 | public Integer getVersionId() { 48 | return versionId; 49 | } 50 | 51 | /** 52 | * setVersionId. 53 | **/ 54 | public void setVersionId(Integer versionId) { 55 | this.versionId = versionId; 56 | } 57 | 58 | 59 | /** 60 | * formContent. 61 | * 62 | * @return WebForm 63 | **/ 64 | public WebForm formContent(WebFormContent formContent) { 65 | this.formContent = formContent; 66 | return this; 67 | } 68 | 69 | /** 70 | * Get formContent. 71 | * @return formContent 72 | **/ 73 | @Schema(description = "") 74 | public WebFormContent getFormContent() { 75 | return formContent; 76 | } 77 | 78 | /** 79 | * setFormContent. 80 | **/ 81 | public void setFormContent(WebFormContent formContent) { 82 | this.formContent = formContent; 83 | } 84 | 85 | 86 | /** 87 | * Compares objects. 88 | * 89 | * @return true or false depending on comparison result. 90 | */ 91 | @Override 92 | public boolean equals(java.lang.Object o) { 93 | if (this == o) { 94 | return true; 95 | } 96 | if (o == null || getClass() != o.getClass()) { 97 | return false; 98 | } 99 | WebForm webForm = (WebForm) o; 100 | return Objects.equals(this.versionId, webForm.versionId) && 101 | Objects.equals(this.formContent, webForm.formContent) && 102 | super.equals(o); 103 | } 104 | 105 | /** 106 | * Returns the HashCode. 107 | */ 108 | @Override 109 | public int hashCode() { 110 | return Objects.hash(versionId, formContent, super.hashCode()); 111 | } 112 | 113 | 114 | /** 115 | * Converts the given object to string. 116 | */ 117 | @Override 118 | public String toString() { 119 | StringBuilder sb = new StringBuilder(); 120 | sb.append("class WebForm {\n"); 121 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 122 | sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); 123 | sb.append(" formContent: ").append(toIndentedString(formContent)).append("\n"); 124 | sb.append("}"); 125 | return sb.toString(); 126 | } 127 | 128 | /** 129 | * Convert the given object to string with each line indented by 4 spaces 130 | * (except the first line). 131 | */ 132 | private String toIndentedString(java.lang.Object o) { 133 | if (o == null) { 134 | return "null"; 135 | } 136 | return o.toString().replace("\n", "\n "); 137 | } 138 | 139 | } 140 | 141 | -------------------------------------------------------------------------------- /stylesheets/github-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2016 GitHub, Inc. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | */ 25 | 26 | .pl-c /* comment */ { 27 | color: #969896; 28 | } 29 | 30 | .pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */, 31 | .pl-s .pl-v /* string variable */ { 32 | color: #0086b3; 33 | } 34 | 35 | .pl-e /* entity */, 36 | .pl-en /* entity.name */ { 37 | color: #795da3; 38 | } 39 | 40 | .pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */, 41 | .pl-s .pl-s1 /* string source */ { 42 | color: #333; 43 | } 44 | 45 | .pl-ent /* entity.name.tag */ { 46 | color: #63a35c; 47 | } 48 | 49 | .pl-k /* keyword, storage, storage.type */ { 50 | color: #a71d5d; 51 | } 52 | 53 | .pl-s /* string */, 54 | .pl-pds /* punctuation.definition.string, string.regexp.character-class */, 55 | .pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, 56 | .pl-sr /* string.regexp */, 57 | .pl-sr .pl-cce /* string.regexp constant.character.escape */, 58 | .pl-sr .pl-sre /* string.regexp source.ruby.embedded */, 59 | .pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ { 60 | color: #183691; 61 | } 62 | 63 | .pl-v /* variable */ { 64 | color: #ed6a43; 65 | } 66 | 67 | .pl-id /* invalid.deprecated */ { 68 | color: #b52a1d; 69 | } 70 | 71 | .pl-ii /* invalid.illegal */ { 72 | color: #f8f8f8; 73 | background-color: #b52a1d; 74 | } 75 | 76 | .pl-sr .pl-cce /* string.regexp constant.character.escape */ { 77 | font-weight: bold; 78 | color: #63a35c; 79 | } 80 | 81 | .pl-ml /* markup.list */ { 82 | color: #693a17; 83 | } 84 | 85 | .pl-mh /* markup.heading */, 86 | .pl-mh .pl-en /* markup.heading entity.name */, 87 | .pl-ms /* meta.separator */ { 88 | font-weight: bold; 89 | color: #1d3e81; 90 | } 91 | 92 | .pl-mq /* markup.quote */ { 93 | color: #008080; 94 | } 95 | 96 | .pl-mi /* markup.italic */ { 97 | font-style: italic; 98 | color: #333; 99 | } 100 | 101 | .pl-mb /* markup.bold */ { 102 | font-weight: bold; 103 | color: #333; 104 | } 105 | 106 | .pl-md /* markup.deleted, meta.diff.header.from-file */ { 107 | color: #bd2c00; 108 | background-color: #ffecec; 109 | } 110 | 111 | .pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { 112 | color: #55a532; 113 | background-color: #eaffea; 114 | } 115 | 116 | .pl-mdr /* meta.diff.range */ { 117 | font-weight: bold; 118 | color: #795da3; 119 | } 120 | 121 | .pl-mo /* meta.output */ { 122 | color: #1d3e81; 123 | } 124 | 125 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/ApiException.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.webforms.client; 4 | 5 | import java.util.Map; 6 | import java.util.List; 7 | 8 | 9 | 10 | /** 11 | * ApiException class. 12 | */ 13 | public class ApiException extends Exception { 14 | private int code = 0; 15 | private Map> responseHeaders = null; 16 | private String responseBody = null; 17 | 18 | /** 19 | * ApiException constructor. 20 | */ 21 | public ApiException() {} 22 | 23 | /** 24 | * ApiException constructor. 25 | * 26 | * @param throwable The Throwable type 27 | */ 28 | public ApiException(Throwable throwable) { 29 | super(throwable); 30 | } 31 | 32 | /** 33 | * ApiException constructor. 34 | * 35 | * @param message The string message 36 | */ 37 | public ApiException(String message) { 38 | super(message); 39 | } 40 | 41 | /** 42 | * ApiException constructor. 43 | * 44 | * @param message The string message 45 | * @param throwable The Throwable type 46 | * @param code The error code 47 | * @param responseHeaders The response headers 48 | * @param responseBody The body of response 49 | */ 50 | public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { 51 | super(message, throwable); 52 | this.code = code; 53 | this.responseHeaders = responseHeaders; 54 | this.responseBody = responseBody; 55 | } 56 | 57 | /** 58 | * ApiException constructor. 59 | * 60 | * @param message The string message 61 | * @param code The error code 62 | * @param responseHeaders The response headers 63 | * @param responseBody The body of response 64 | */ 65 | public ApiException(String message, int code, Map> responseHeaders, String responseBody) { 66 | this(message, (Throwable) null, code, responseHeaders, responseBody); 67 | } 68 | 69 | /** 70 | * ApiException constructor. 71 | * 72 | * @param message The string message 73 | * @param throwable The Throwable type 74 | * @param code The error code 75 | * @param responseHeaders The response headers 76 | */ 77 | public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { 78 | this(message, throwable, code, responseHeaders, null); 79 | } 80 | 81 | /** 82 | * ApiException constructor. 83 | * 84 | * @param code The error code 85 | * @param responseHeaders The response headers 86 | * @param responseBody The body of response 87 | */ 88 | public ApiException(int code, Map> responseHeaders, String responseBody) { 89 | this((String) null, (Throwable) null, code, responseHeaders, responseBody); 90 | } 91 | 92 | /** 93 | * ApiException constructor. 94 | * 95 | * @param code The error code 96 | * @param message The string message 97 | */ 98 | public ApiException(int code, String message) { 99 | super(message); 100 | this.code = code; 101 | } 102 | 103 | /** 104 | * ApiException constructor. 105 | * 106 | * @param code The error code 107 | * @param message The string message 108 | * @param responseHeaders The response headers 109 | * @param responseBody The body of response 110 | */ 111 | public ApiException(int code, String message, Map> responseHeaders, String responseBody) { 112 | this(code, message); 113 | this.responseHeaders = responseHeaders; 114 | this.responseBody = responseBody; 115 | } 116 | 117 | /** 118 | * Get the HTTP status code. 119 | * 120 | * @return HTTP status code 121 | */ 122 | public int getCode() { 123 | return code; 124 | } 125 | 126 | /** 127 | * Get the HTTP response headers. 128 | * 129 | * @return A map of list of string 130 | */ 131 | public Map> getResponseHeaders() { 132 | return responseHeaders; 133 | } 134 | 135 | /** 136 | * Get the HTTP response body. 137 | * 138 | * @return Response body in the form of string 139 | */ 140 | public String getResponseBody() { 141 | return responseBody; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormProperties.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.io.Serializable; 10 | 11 | /** 12 | * General information about the web form that is consistent across versions. 13 | * 14 | */ 15 | @Schema(description = "General information about the web form that is consistent across versions") 16 | 17 | public class WebFormProperties implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("name") 21 | private String name = null; 22 | 23 | @JsonProperty("isPrivateAccess") 24 | private Boolean isPrivateAccess = null; 25 | 26 | @JsonProperty("allowSending") 27 | private Boolean allowSending = null; 28 | 29 | 30 | /** 31 | * name. 32 | * 33 | * @return WebFormProperties 34 | **/ 35 | public WebFormProperties name(String name) { 36 | this.name = name; 37 | return this; 38 | } 39 | 40 | /** 41 | * Get name. 42 | * @return name 43 | **/ 44 | @Schema(description = "") 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | /** 50 | * setName. 51 | **/ 52 | public void setName(String name) { 53 | this.name = name; 54 | } 55 | 56 | 57 | /** 58 | * isPrivateAccess. 59 | * 60 | * @return WebFormProperties 61 | **/ 62 | public WebFormProperties isPrivateAccess(Boolean isPrivateAccess) { 63 | this.isPrivateAccess = isPrivateAccess; 64 | return this; 65 | } 66 | 67 | /** 68 | * Get isPrivateAccess. 69 | * @return isPrivateAccess 70 | **/ 71 | @Schema(description = "") 72 | public Boolean getIsPrivateAccess() { 73 | return isPrivateAccess; 74 | } 75 | 76 | /** 77 | * setIsPrivateAccess. 78 | **/ 79 | public void setIsPrivateAccess(Boolean isPrivateAccess) { 80 | this.isPrivateAccess = isPrivateAccess; 81 | } 82 | 83 | 84 | /** 85 | * allowSending. 86 | * 87 | * @return WebFormProperties 88 | **/ 89 | public WebFormProperties allowSending(Boolean allowSending) { 90 | this.allowSending = allowSending; 91 | return this; 92 | } 93 | 94 | /** 95 | * When this property is true, form can be used for remote signing.. 96 | * @return allowSending 97 | **/ 98 | @Schema(example = "true", description = "When this property is true, form can be used for remote signing.") 99 | public Boolean isAllowSending() { 100 | return allowSending; 101 | } 102 | 103 | /** 104 | * setAllowSending. 105 | **/ 106 | public void setAllowSending(Boolean allowSending) { 107 | this.allowSending = allowSending; 108 | } 109 | 110 | 111 | /** 112 | * Compares objects. 113 | * 114 | * @return true or false depending on comparison result. 115 | */ 116 | @Override 117 | public boolean equals(java.lang.Object o) { 118 | if (this == o) { 119 | return true; 120 | } 121 | if (o == null || getClass() != o.getClass()) { 122 | return false; 123 | } 124 | WebFormProperties webFormProperties = (WebFormProperties) o; 125 | return Objects.equals(this.name, webFormProperties.name) && 126 | Objects.equals(this.isPrivateAccess, webFormProperties.isPrivateAccess) && 127 | Objects.equals(this.allowSending, webFormProperties.allowSending); 128 | } 129 | 130 | /** 131 | * Returns the HashCode. 132 | */ 133 | @Override 134 | public int hashCode() { 135 | return Objects.hash(name, isPrivateAccess, allowSending); 136 | } 137 | 138 | 139 | /** 140 | * Converts the given object to string. 141 | */ 142 | @Override 143 | public String toString() { 144 | StringBuilder sb = new StringBuilder(); 145 | sb.append("class WebFormProperties {\n"); 146 | 147 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 148 | sb.append(" isPrivateAccess: ").append(toIndentedString(isPrivateAccess)).append("\n"); 149 | sb.append(" allowSending: ").append(toIndentedString(allowSending)).append("\n"); 150 | sb.append("}"); 151 | return sb.toString(); 152 | } 153 | 154 | /** 155 | * Convert the given object to string with each line indented by 4 spaces 156 | * (except the first line). 157 | */ 158 | private String toIndentedString(java.lang.Object o) { 159 | if (o == null) { 160 | return "null"; 161 | } 162 | return o.toString().replace("\n", "\n "); 163 | } 164 | 165 | } 166 | 167 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormComponent.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | 10 | /** 11 | * Each component type contains additional properties. 12 | * 13 | */ 14 | @Schema(description = "Each component type contains additional properties") 15 | 16 | public class WebFormComponent extends java.util.HashMap { 17 | @JsonProperty("componentKey") 18 | private String componentKey = null; 19 | 20 | @JsonProperty("componentType") 21 | private String componentType = null; 22 | 23 | @JsonProperty("componentName") 24 | private String componentName = null; 25 | 26 | 27 | /** 28 | * componentKey. 29 | * 30 | * @return WebFormComponent 31 | **/ 32 | public WebFormComponent componentKey(String componentKey) { 33 | this.componentKey = componentKey; 34 | return this; 35 | } 36 | 37 | /** 38 | * Get componentKey. 39 | * @return componentKey 40 | **/ 41 | @Schema(required = true, description = "") 42 | public String getComponentKey() { 43 | return componentKey; 44 | } 45 | 46 | /** 47 | * setComponentKey. 48 | **/ 49 | public void setComponentKey(String componentKey) { 50 | this.componentKey = componentKey; 51 | } 52 | 53 | 54 | /** 55 | * componentType. 56 | * 57 | * @return WebFormComponent 58 | **/ 59 | public WebFormComponent componentType(String componentType) { 60 | this.componentType = componentType; 61 | return this; 62 | } 63 | 64 | /** 65 | * The type of component this object represents. 66 | * @return componentType 67 | **/ 68 | @Schema(example = "Checkbox", required = true, description = "The type of component this object represents") 69 | public String getComponentType() { 70 | return componentType; 71 | } 72 | 73 | /** 74 | * setComponentType. 75 | **/ 76 | public void setComponentType(String componentType) { 77 | this.componentType = componentType; 78 | } 79 | 80 | 81 | /** 82 | * componentName. 83 | * 84 | * @return WebFormComponent 85 | **/ 86 | public WebFormComponent componentName(String componentName) { 87 | this.componentName = componentName; 88 | return this; 89 | } 90 | 91 | /** 92 | * Name value that is used for mapping components to external sources. 93 | * @return componentName 94 | **/ 95 | @Schema(example = "Country_Code", description = "Name value that is used for mapping components to external sources") 96 | public String getComponentName() { 97 | return componentName; 98 | } 99 | 100 | /** 101 | * setComponentName. 102 | **/ 103 | public void setComponentName(String componentName) { 104 | this.componentName = componentName; 105 | } 106 | 107 | 108 | /** 109 | * Compares objects. 110 | * 111 | * @return true or false depending on comparison result. 112 | */ 113 | @Override 114 | public boolean equals(java.lang.Object o) { 115 | if (this == o) { 116 | return true; 117 | } 118 | if (o == null || getClass() != o.getClass()) { 119 | return false; 120 | } 121 | WebFormComponent webFormComponent = (WebFormComponent) o; 122 | return Objects.equals(this.componentKey, webFormComponent.componentKey) && 123 | Objects.equals(this.componentType, webFormComponent.componentType) && 124 | Objects.equals(this.componentName, webFormComponent.componentName) && 125 | super.equals(o); 126 | } 127 | 128 | /** 129 | * Returns the HashCode. 130 | */ 131 | @Override 132 | public int hashCode() { 133 | return Objects.hash(componentKey, componentType, componentName, super.hashCode()); 134 | } 135 | 136 | 137 | /** 138 | * Converts the given object to string. 139 | */ 140 | @Override 141 | public String toString() { 142 | StringBuilder sb = new StringBuilder(); 143 | sb.append("class WebFormComponent {\n"); 144 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 145 | sb.append(" componentKey: ").append(toIndentedString(componentKey)).append("\n"); 146 | sb.append(" componentType: ").append(toIndentedString(componentType)).append("\n"); 147 | sb.append(" componentName: ").append(toIndentedString(componentName)).append("\n"); 148 | sb.append("}"); 149 | return sb.toString(); 150 | } 151 | 152 | /** 153 | * Convert the given object to string with each line indented by 4 spaces 154 | * (except the first line). 155 | */ 156 | private String toIndentedString(java.lang.Object o) { 157 | if (o == null) { 158 | return "null"; 159 | } 160 | return o.toString().replace("\n", "\n "); 161 | } 162 | 163 | } 164 | 165 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormInstanceRecipients.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.InstanceRecipientStatus; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * WebFormInstanceRecipients. 14 | * 15 | */ 16 | 17 | public class WebFormInstanceRecipients implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("recipientViewId") 21 | private String recipientViewId = null; 22 | 23 | @JsonProperty("instanceRecipientStatus") 24 | private InstanceRecipientStatus instanceRecipientStatus = null; 25 | 26 | @JsonProperty("roleName") 27 | private String roleName = null; 28 | 29 | 30 | /** 31 | * recipientViewId. 32 | * 33 | * @return WebFormInstanceRecipients 34 | **/ 35 | public WebFormInstanceRecipients recipientViewId(String recipientViewId) { 36 | this.recipientViewId = recipientViewId; 37 | return this; 38 | } 39 | 40 | /** 41 | * Get recipientViewId. 42 | * @return recipientViewId 43 | **/ 44 | @Schema(description = "") 45 | public String getRecipientViewId() { 46 | return recipientViewId; 47 | } 48 | 49 | /** 50 | * setRecipientViewId. 51 | **/ 52 | public void setRecipientViewId(String recipientViewId) { 53 | this.recipientViewId = recipientViewId; 54 | } 55 | 56 | 57 | /** 58 | * instanceRecipientStatus. 59 | * 60 | * @return WebFormInstanceRecipients 61 | **/ 62 | public WebFormInstanceRecipients instanceRecipientStatus(InstanceRecipientStatus instanceRecipientStatus) { 63 | this.instanceRecipientStatus = instanceRecipientStatus; 64 | return this; 65 | } 66 | 67 | /** 68 | * Get instanceRecipientStatus. 69 | * @return instanceRecipientStatus 70 | **/ 71 | @Schema(description = "") 72 | public InstanceRecipientStatus getInstanceRecipientStatus() { 73 | return instanceRecipientStatus; 74 | } 75 | 76 | /** 77 | * setInstanceRecipientStatus. 78 | **/ 79 | public void setInstanceRecipientStatus(InstanceRecipientStatus instanceRecipientStatus) { 80 | this.instanceRecipientStatus = instanceRecipientStatus; 81 | } 82 | 83 | 84 | /** 85 | * roleName. 86 | * 87 | * @return WebFormInstanceRecipients 88 | **/ 89 | public WebFormInstanceRecipients roleName(String roleName) { 90 | this.roleName = roleName; 91 | return this; 92 | } 93 | 94 | /** 95 | * Get roleName. 96 | * @return roleName 97 | **/ 98 | @Schema(description = "") 99 | public String getRoleName() { 100 | return roleName; 101 | } 102 | 103 | /** 104 | * setRoleName. 105 | **/ 106 | public void setRoleName(String roleName) { 107 | this.roleName = roleName; 108 | } 109 | 110 | 111 | /** 112 | * Compares objects. 113 | * 114 | * @return true or false depending on comparison result. 115 | */ 116 | @Override 117 | public boolean equals(java.lang.Object o) { 118 | if (this == o) { 119 | return true; 120 | } 121 | if (o == null || getClass() != o.getClass()) { 122 | return false; 123 | } 124 | WebFormInstanceRecipients webFormInstanceRecipients = (WebFormInstanceRecipients) o; 125 | return Objects.equals(this.recipientViewId, webFormInstanceRecipients.recipientViewId) && 126 | Objects.equals(this.instanceRecipientStatus, webFormInstanceRecipients.instanceRecipientStatus) && 127 | Objects.equals(this.roleName, webFormInstanceRecipients.roleName); 128 | } 129 | 130 | /** 131 | * Returns the HashCode. 132 | */ 133 | @Override 134 | public int hashCode() { 135 | return Objects.hash(recipientViewId, instanceRecipientStatus, roleName); 136 | } 137 | 138 | 139 | /** 140 | * Converts the given object to string. 141 | */ 142 | @Override 143 | public String toString() { 144 | StringBuilder sb = new StringBuilder(); 145 | sb.append("class WebFormInstanceRecipients {\n"); 146 | 147 | sb.append(" recipientViewId: ").append(toIndentedString(recipientViewId)).append("\n"); 148 | sb.append(" instanceRecipientStatus: ").append(toIndentedString(instanceRecipientStatus)).append("\n"); 149 | sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); 150 | sb.append("}"); 151 | return sb.toString(); 152 | } 153 | 154 | /** 155 | * Convert the given object to string with each line indented by 4 spaces 156 | * (except the first line). 157 | */ 158 | private String toIndentedString(java.lang.Object o) { 159 | if (o == null) { 160 | return "null"; 161 | } 162 | return o.toString().replace("\n", "\n "); 163 | } 164 | 165 | } 166 | 167 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/CreateInstanceRequestBodyRecipients.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.PhoneNumber; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * CreateInstanceRequestBodyRecipients. 14 | * 15 | */ 16 | 17 | public class CreateInstanceRequestBodyRecipients implements Serializable { 18 | private static final long serialVersionUID = 1L; 19 | 20 | @JsonProperty("roleName") 21 | private String roleName = null; 22 | 23 | @JsonProperty("name") 24 | private String name = null; 25 | 26 | @JsonProperty("email") 27 | private String email = null; 28 | 29 | @JsonProperty("phoneNumber") 30 | private PhoneNumber phoneNumber = null; 31 | 32 | 33 | /** 34 | * roleName. 35 | * 36 | * @return CreateInstanceRequestBodyRecipients 37 | **/ 38 | public CreateInstanceRequestBodyRecipients roleName(String roleName) { 39 | this.roleName = roleName; 40 | return this; 41 | } 42 | 43 | /** 44 | * Get roleName. 45 | * @return roleName 46 | **/ 47 | @Schema(required = true, description = "") 48 | public String getRoleName() { 49 | return roleName; 50 | } 51 | 52 | /** 53 | * setRoleName. 54 | **/ 55 | public void setRoleName(String roleName) { 56 | this.roleName = roleName; 57 | } 58 | 59 | 60 | /** 61 | * name. 62 | * 63 | * @return CreateInstanceRequestBodyRecipients 64 | **/ 65 | public CreateInstanceRequestBodyRecipients name(String name) { 66 | this.name = name; 67 | return this; 68 | } 69 | 70 | /** 71 | * Get name. 72 | * @return name 73 | **/ 74 | @Schema(required = true, description = "") 75 | public String getName() { 76 | return name; 77 | } 78 | 79 | /** 80 | * setName. 81 | **/ 82 | public void setName(String name) { 83 | this.name = name; 84 | } 85 | 86 | 87 | /** 88 | * email. 89 | * 90 | * @return CreateInstanceRequestBodyRecipients 91 | **/ 92 | public CreateInstanceRequestBodyRecipients email(String email) { 93 | this.email = email; 94 | return this; 95 | } 96 | 97 | /** 98 | * Get email. 99 | * @return email 100 | **/ 101 | @Schema(required = true, description = "") 102 | public String getEmail() { 103 | return email; 104 | } 105 | 106 | /** 107 | * setEmail. 108 | **/ 109 | public void setEmail(String email) { 110 | this.email = email; 111 | } 112 | 113 | 114 | /** 115 | * phoneNumber. 116 | * 117 | * @return CreateInstanceRequestBodyRecipients 118 | **/ 119 | public CreateInstanceRequestBodyRecipients phoneNumber(PhoneNumber phoneNumber) { 120 | this.phoneNumber = phoneNumber; 121 | return this; 122 | } 123 | 124 | /** 125 | * Get phoneNumber. 126 | * @return phoneNumber 127 | **/ 128 | @Schema(description = "") 129 | public PhoneNumber getPhoneNumber() { 130 | return phoneNumber; 131 | } 132 | 133 | /** 134 | * setPhoneNumber. 135 | **/ 136 | public void setPhoneNumber(PhoneNumber phoneNumber) { 137 | this.phoneNumber = phoneNumber; 138 | } 139 | 140 | 141 | /** 142 | * Compares objects. 143 | * 144 | * @return true or false depending on comparison result. 145 | */ 146 | @Override 147 | public boolean equals(java.lang.Object o) { 148 | if (this == o) { 149 | return true; 150 | } 151 | if (o == null || getClass() != o.getClass()) { 152 | return false; 153 | } 154 | CreateInstanceRequestBodyRecipients createInstanceRequestBodyRecipients = (CreateInstanceRequestBodyRecipients) o; 155 | return Objects.equals(this.roleName, createInstanceRequestBodyRecipients.roleName) && 156 | Objects.equals(this.name, createInstanceRequestBodyRecipients.name) && 157 | Objects.equals(this.email, createInstanceRequestBodyRecipients.email) && 158 | Objects.equals(this.phoneNumber, createInstanceRequestBodyRecipients.phoneNumber); 159 | } 160 | 161 | /** 162 | * Returns the HashCode. 163 | */ 164 | @Override 165 | public int hashCode() { 166 | return Objects.hash(roleName, name, email, phoneNumber); 167 | } 168 | 169 | 170 | /** 171 | * Converts the given object to string. 172 | */ 173 | @Override 174 | public String toString() { 175 | StringBuilder sb = new StringBuilder(); 176 | sb.append("class CreateInstanceRequestBodyRecipients {\n"); 177 | 178 | sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); 179 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 180 | sb.append(" email: ").append(toIndentedString(email)).append("\n"); 181 | sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); 182 | sb.append("}"); 183 | return sb.toString(); 184 | } 185 | 186 | /** 187 | * Convert the given object to string with each line indented by 4 spaces 188 | * (except the first line). 189 | */ 190 | private String toIndentedString(java.lang.Object o) { 191 | if (o == null) { 192 | return "null"; 193 | } 194 | return o.toString().replace("\n", "\n "); 195 | } 196 | 197 | } 198 | 199 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Official Docusign WebForms Java Client SDK 2 | 3 | [![Build status][travis-image]][travis-url] 4 | [![Maven Central status][maven-image]][maven-url] 5 | 6 | The Docusign SDK makes integrating Docusign into your apps and websites a seamless experience. 7 | 8 | ## Table of Contents 9 | - [Introduction](#introduction) 10 | - [Installation](#installation) 11 | * [Version Information](#versionInformation) 12 | * [Requirements](#requirements) 13 | * [Compatibility](#compatibility) 14 | * [Maven](#maven) 15 | - [Dependencies](#dependencies) 16 | - [API Reference](#apiReference) 17 | - [Code Examples](#codeExamples) 18 | - [OAuth Implementations](#oauthImplementations) 19 | - [Changelog](#changeLog) 20 | - [Support](#support) 21 | - [License](#license) 22 | - [Additional Resources](#additionalResources) 23 | 24 | 25 | ## Introduction 26 | Leverage the power of Web Forms in your agreement processes. Enjoy greater flexibility to manage forms using your own code including the creation and management of form instances with prefilled data. This API works with Docusign JS to enable the embedding of a web form instance in your web application. 27 | 28 | 29 | ## Installation 30 | This client SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our [code examples](https://developers.docusign.com/docs/web-forms-api/how-to/) from the [Docusign Developer Center](https://developers.docusign.com/), you merely need to install it by following the instructions below. 31 | 32 | 33 | ### Version Information 34 | - **API version**: 1.1.0 35 | - **Latest SDK version (Including prerelease)**: 36 | 37 | 38 | ## Requirements 39 | * Java 1.9+ 40 | * Free [developer account](https://go.docusign.com/o/sandbox/?postActivateUrl=https://developers.docusign.com/) 41 | 42 | 43 | ## Compatibility 44 | * Java 1.9+ 45 | 46 | 47 | **Note:** Docusign uses Eclipse with Maven for testing purposes. 48 | ### Maven: 49 | 1. In Eclipse, create a new project by selecting **File > New > Project**. 50 | 2. In the New Project Wizard, expand **Maven,** then select **Maven Project.** 51 | 3. Leave **Create a simple project** unchecked. 52 | 4. Select **Next,** then provide a unique **groupId** and **artifactId.** 53 | 5. In the directory where you've saved your project, open the pom.xml file. 54 | 6. In the pom.xml file, locate the `dependencies` node. 55 | 7. Add: 56 | ``` 57 | 58 | com.docusign 59 | docusign-webforms-java 60 | 2.1.0 61 | 62 | ``` 63 | 8. If your project is still open, restart Eclipse. 64 | 65 | 66 | ## SDK Dependencies 67 | This client has the following external dependencies: 68 | * io.swagger.core.v3:swagger-annotations:2.2.8 69 | * org.glassfish.jersey.core:jersey-client:3.1.6 70 | * org.glassfish.jersey.media:jersey-media-multipart:3.1.6 71 | * org.glassfish.jersey.media:jersey-media-json-jackson:3.1.6 72 | * org.glassfish.jersey.inject:jersey-hk2:3.1.6 73 | * com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base:2.14.2 74 | * com.auth0:java-jwt:3.4.1 75 | * org.bouncycastle:bcprov-jdk18on:1.78.1 76 | * com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.14.2 77 | * com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.2 78 | * com.brsanthu:migbase64:2.2 79 | * com.fasterxml.jackson.core:jackson-core:2.17.1 80 | * org.json:json:20240303 81 | 82 | 83 | 84 | ## API Reference 85 | You can refer to the API reference [here](https://developers.docusign.com/docs/web-forms-api/reference/). 86 | 87 | 88 | ## Code examples 89 | Explore our GitHub repository for the [Launcher](https://github.com/docusign/code-examples-java/), a self-executing package housing code examples for the WebForms Java SDK. This package showcases several common use cases and their respective source files. Additionally, you can download a version preconfigured for your Docusign developer account from [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/). These examples support both the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) and [JSON Web Token (JWT)](https://developers.docusign.com/platform/auth/jwt/) authentication workflows. 90 | 91 | 92 | ## OAuth implementations 93 | For details regarding which type of OAuth grant will work best for your Docusign integration, see [Choose OAuth Type](https://developers.docusign.com/platform/auth/choose/) in the [Docusign Developer Center](https://developers.docusign.com/). 94 | 95 | For security purposes, Docusign recommends using the [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) flow. 96 | 97 | 98 | ## Changelog 99 | You can refer to the complete changelog [here](https://github.com/docusign/docusign-webforms-java-client/blob/master/CHANGELOG.md). 100 | 101 | 102 | ## Support 103 | Log issues against this client SDK through GitHub. You can also reach out to us through [Docusign Community](https://community.docusign.com/developer-59) and [Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi). 104 | 105 | 106 | ## License 107 | The Docusign WebForms Java Client SDK is licensed under the [MIT License](https://github.com/docusign/docusign-webforms-java-client/blob/master/LICENSE). 108 | 109 | 110 | ### Additional resources 111 | * [Docusign Developer Center](https://developers.docusign.com/) 112 | * [Docusign API on Twitter](https://twitter.com/docusignapi) 113 | * [Docusign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/) 114 | * [Docusign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ) 115 | 116 | [travis-image]: https://api.travis-ci.com/docusign/docusign-webforms-java-client.svg?branch=master 117 | [travis-url]: https://app.travis-ci.com/github/docusign/docusign-webforms-java-client 118 | [maven-image]: https://img.shields.io/maven-central/v/com.docusign/.svg?style=flat 119 | [maven-url]: https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.docusign%22 120 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/TemplateProperties.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | import io.swagger.v3.oas.annotations.media.Schema; 9 | import java.time.OffsetDateTime; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * Information about a DocuSign template that will be used to seed a web form.. 14 | * 15 | */ 16 | @Schema(description = "Information about a DocuSign template that will be used to seed a web form.") 17 | 18 | public class TemplateProperties implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | @JsonProperty("originalTemplateId") 22 | private String originalTemplateId = null; 23 | 24 | @JsonProperty("clonedTemplateId") 25 | private String clonedTemplateId = null; 26 | 27 | @JsonProperty("importedDateTime") 28 | private String importedDateTime = null; 29 | 30 | @JsonProperty("recipientIds") 31 | private java.util.List recipientIds = null; 32 | 33 | 34 | /** 35 | * originalTemplateId. 36 | * 37 | * @return TemplateProperties 38 | **/ 39 | public TemplateProperties originalTemplateId(String originalTemplateId) { 40 | this.originalTemplateId = originalTemplateId; 41 | return this; 42 | } 43 | 44 | /** 45 | * Template identifier for original Template that is used by the DocuSign Template API.. 46 | * @return originalTemplateId 47 | **/ 48 | @Schema(description = "Template identifier for original Template that is used by the DocuSign Template API.") 49 | public String getOriginalTemplateId() { 50 | return originalTemplateId; 51 | } 52 | 53 | /** 54 | * setOriginalTemplateId. 55 | **/ 56 | public void setOriginalTemplateId(String originalTemplateId) { 57 | this.originalTemplateId = originalTemplateId; 58 | } 59 | 60 | 61 | /** 62 | * clonedTemplateId. 63 | * 64 | * @return TemplateProperties 65 | **/ 66 | public TemplateProperties clonedTemplateId(String clonedTemplateId) { 67 | this.clonedTemplateId = clonedTemplateId; 68 | return this; 69 | } 70 | 71 | /** 72 | * Template identifier for cloned Template that is used by the DocuSign Template API.. 73 | * @return clonedTemplateId 74 | **/ 75 | @Schema(description = "Template identifier for cloned Template that is used by the DocuSign Template API.") 76 | public String getClonedTemplateId() { 77 | return clonedTemplateId; 78 | } 79 | 80 | /** 81 | * setClonedTemplateId. 82 | **/ 83 | public void setClonedTemplateId(String clonedTemplateId) { 84 | this.clonedTemplateId = clonedTemplateId; 85 | } 86 | 87 | 88 | /** 89 | * importedDateTime. 90 | * 91 | * @return TemplateProperties 92 | **/ 93 | public TemplateProperties importedDateTime(String importedDateTime) { 94 | this.importedDateTime = importedDateTime; 95 | return this; 96 | } 97 | 98 | /** 99 | * Track the time of assignment of Template information to the Form.. 100 | * @return importedDateTime 101 | **/ 102 | @Schema(description = "Track the time of assignment of Template information to the Form.") 103 | public String getImportedDateTime() { 104 | return importedDateTime; 105 | } 106 | 107 | /** 108 | * setImportedDateTime. 109 | **/ 110 | public void setImportedDateTime(String importedDateTime) { 111 | this.importedDateTime = importedDateTime; 112 | } 113 | 114 | 115 | /** 116 | * recipientIds. 117 | * 118 | * @return TemplateProperties 119 | **/ 120 | public TemplateProperties recipientIds(java.util.List recipientIds) { 121 | this.recipientIds = recipientIds; 122 | return this; 123 | } 124 | 125 | /** 126 | * addRecipientIdsItem. 127 | * 128 | * @return TemplateProperties 129 | **/ 130 | public TemplateProperties addRecipientIdsItem(String recipientIdsItem) { 131 | if (this.recipientIds == null) { 132 | this.recipientIds = new java.util.ArrayList<>(); 133 | } 134 | this.recipientIds.add(recipientIdsItem); 135 | return this; 136 | } 137 | 138 | /** 139 | * Track mapped recipients on Template.. 140 | * @return recipientIds 141 | **/ 142 | @Schema(description = "Track mapped recipients on Template.") 143 | public java.util.List getRecipientIds() { 144 | return recipientIds; 145 | } 146 | 147 | /** 148 | * setRecipientIds. 149 | **/ 150 | public void setRecipientIds(java.util.List recipientIds) { 151 | this.recipientIds = recipientIds; 152 | } 153 | 154 | 155 | /** 156 | * Compares objects. 157 | * 158 | * @return true or false depending on comparison result. 159 | */ 160 | @Override 161 | public boolean equals(java.lang.Object o) { 162 | if (this == o) { 163 | return true; 164 | } 165 | if (o == null || getClass() != o.getClass()) { 166 | return false; 167 | } 168 | TemplateProperties templateProperties = (TemplateProperties) o; 169 | return Objects.equals(this.originalTemplateId, templateProperties.originalTemplateId) && 170 | Objects.equals(this.clonedTemplateId, templateProperties.clonedTemplateId) && 171 | Objects.equals(this.importedDateTime, templateProperties.importedDateTime) && 172 | Objects.equals(this.recipientIds, templateProperties.recipientIds); 173 | } 174 | 175 | /** 176 | * Returns the HashCode. 177 | */ 178 | @Override 179 | public int hashCode() { 180 | return Objects.hash(originalTemplateId, clonedTemplateId, importedDateTime, recipientIds); 181 | } 182 | 183 | 184 | /** 185 | * Converts the given object to string. 186 | */ 187 | @Override 188 | public String toString() { 189 | StringBuilder sb = new StringBuilder(); 190 | sb.append("class TemplateProperties {\n"); 191 | 192 | sb.append(" originalTemplateId: ").append(toIndentedString(originalTemplateId)).append("\n"); 193 | sb.append(" clonedTemplateId: ").append(toIndentedString(clonedTemplateId)).append("\n"); 194 | sb.append(" importedDateTime: ").append(toIndentedString(importedDateTime)).append("\n"); 195 | sb.append(" recipientIds: ").append(toIndentedString(recipientIds)).append("\n"); 196 | sb.append("}"); 197 | return sb.toString(); 198 | } 199 | 200 | /** 201 | * Convert the given object to string with each line indented by 4 spaces 202 | * (except the first line). 203 | */ 204 | private String toIndentedString(java.lang.Object o) { 205 | if (o == null) { 206 | return "null"; 207 | } 208 | return o.toString().replace("\n", "\n "); 209 | } 210 | 211 | } 212 | 213 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormContent.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.TemplateProperties; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | import java.io.Serializable; 11 | 12 | /** 13 | * Container for the components map used during configuration and data collection. 14 | * 15 | */ 16 | @Schema(description = "Container for the components map used during configuration and data collection") 17 | 18 | public class WebFormContent implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | @JsonProperty("components") 22 | private java.util.Map> components = null; 23 | 24 | @JsonProperty("isStandalone") 25 | private Boolean isStandalone = null; 26 | 27 | @JsonProperty("brandId") 28 | private String brandId = null; 29 | 30 | @JsonProperty("templates") 31 | private java.util.List templates = null; 32 | 33 | 34 | /** 35 | * components. 36 | * 37 | * @return WebFormContent 38 | **/ 39 | public WebFormContent components(java.util.Map> components) { 40 | this.components = components; 41 | return this; 42 | } 43 | 44 | /** 45 | * putComponentsItem. 46 | * 47 | * @return WebFormContent 48 | **/ 49 | public WebFormContent putComponentsItem(String key, java.util.Map componentsItem) { 50 | if (this.components == null) { 51 | this.components = new java.util.HashMap<>(); 52 | } 53 | this.components.put(key, componentsItem); 54 | return this; 55 | } 56 | 57 | /** 58 | * Key/value dictionary of components that represent the form. 59 | * @return components 60 | **/ 61 | @Schema(example = "{\"Root_Of_Journey\":{\"componentKey\":\"Root_Of_Journey\",\"componentType\":\"Root\",\"children\":[\"Step_abc123\"]},\"TextBox_ABC123\":{\"componentKey\":\"TextBox_ABC123\",\"componentType\":\"TextBox\",\"componentName\":\"Full_Name\",\"label\":\"Full Name\",\"maxLength\":100,\"multiLine\":false,\"placeholder\":\"John Adams\",\"required\":true},\"Step_abc123\":{\"componentKey\":\"Step_abc123\",\"componentType\":\"Step\",\"componentName\":\"Step_abc123\",\"text\":\"Patient Demographics\"}}", description = "Key/value dictionary of components that represent the form") 62 | public java.util.Map> getComponents() { 63 | return components; 64 | } 65 | 66 | /** 67 | * setComponents. 68 | **/ 69 | public void setComponents(java.util.Map> components) { 70 | this.components = components; 71 | } 72 | 73 | 74 | /** 75 | * isStandalone. 76 | * 77 | * @return WebFormContent 78 | **/ 79 | public WebFormContent isStandalone(Boolean isStandalone) { 80 | this.isStandalone = isStandalone; 81 | return this; 82 | } 83 | 84 | /** 85 | * Get isStandalone. 86 | * @return isStandalone 87 | **/ 88 | @Schema(description = "") 89 | public Boolean getIsStandalone() { 90 | return isStandalone; 91 | } 92 | 93 | /** 94 | * setIsStandalone. 95 | **/ 96 | public void setIsStandalone(Boolean isStandalone) { 97 | this.isStandalone = isStandalone; 98 | } 99 | 100 | 101 | /** 102 | * brandId. 103 | * 104 | * @return WebFormContent 105 | **/ 106 | public WebFormContent brandId(String brandId) { 107 | this.brandId = brandId; 108 | return this; 109 | } 110 | 111 | /** 112 | * Get brandId. 113 | * @return brandId 114 | **/ 115 | @Schema(description = "") 116 | public String getBrandId() { 117 | return brandId; 118 | } 119 | 120 | /** 121 | * setBrandId. 122 | **/ 123 | public void setBrandId(String brandId) { 124 | this.brandId = brandId; 125 | } 126 | 127 | 128 | /** 129 | * templates. 130 | * 131 | * @return WebFormContent 132 | **/ 133 | public WebFormContent templates(java.util.List templates) { 134 | this.templates = templates; 135 | return this; 136 | } 137 | 138 | /** 139 | * addTemplatesItem. 140 | * 141 | * @return WebFormContent 142 | **/ 143 | public WebFormContent addTemplatesItem(TemplateProperties templatesItem) { 144 | if (this.templates == null) { 145 | this.templates = new java.util.ArrayList<>(); 146 | } 147 | this.templates.add(templatesItem); 148 | return this; 149 | } 150 | 151 | /** 152 | * Optional template information that will be used to seed the form.. 153 | * @return templates 154 | **/ 155 | @Schema(description = "Optional template information that will be used to seed the form.") 156 | public java.util.List getTemplates() { 157 | return templates; 158 | } 159 | 160 | /** 161 | * setTemplates. 162 | **/ 163 | public void setTemplates(java.util.List templates) { 164 | this.templates = templates; 165 | } 166 | 167 | 168 | /** 169 | * Compares objects. 170 | * 171 | * @return true or false depending on comparison result. 172 | */ 173 | @Override 174 | public boolean equals(java.lang.Object o) { 175 | if (this == o) { 176 | return true; 177 | } 178 | if (o == null || getClass() != o.getClass()) { 179 | return false; 180 | } 181 | WebFormContent webFormContent = (WebFormContent) o; 182 | return Objects.equals(this.components, webFormContent.components) && 183 | Objects.equals(this.isStandalone, webFormContent.isStandalone) && 184 | Objects.equals(this.brandId, webFormContent.brandId) && 185 | Objects.equals(this.templates, webFormContent.templates); 186 | } 187 | 188 | /** 189 | * Returns the HashCode. 190 | */ 191 | @Override 192 | public int hashCode() { 193 | return Objects.hash(components, isStandalone, brandId, templates); 194 | } 195 | 196 | 197 | /** 198 | * Converts the given object to string. 199 | */ 200 | @Override 201 | public String toString() { 202 | StringBuilder sb = new StringBuilder(); 203 | sb.append("class WebFormContent {\n"); 204 | 205 | sb.append(" components: ").append(toIndentedString(components)).append("\n"); 206 | sb.append(" isStandalone: ").append(toIndentedString(isStandalone)).append("\n"); 207 | sb.append(" brandId: ").append(toIndentedString(brandId)).append("\n"); 208 | sb.append(" templates: ").append(toIndentedString(templates)).append("\n"); 209 | sb.append("}"); 210 | return sb.toString(); 211 | } 212 | 213 | /** 214 | * Convert the given object to string with each line indented by 4 spaces 215 | * (except the first line). 216 | */ 217 | private String toIndentedString(java.lang.Object o) { 218 | if (o == null) { 219 | return "null"; 220 | } 221 | return o.toString().replace("\n", "\n "); 222 | } 223 | 224 | } 225 | 226 | -------------------------------------------------------------------------------- /src/test/java/FormManagementUnitTests.java: -------------------------------------------------------------------------------- 1 | import static org.junit.jupiter.api.Assertions.assertThrows; 2 | 3 | import com.docusign.webforms.api.*; 4 | import com.docusign.webforms.client.*; 5 | import com.docusign.webforms.client.auth.OAuth; 6 | import com.docusign.webforms.model.*; 7 | import java.util.*; 8 | import org.junit.*; 9 | import org.junit.runners.MethodSorters; 10 | 11 | /** @author avinash.rai */ 12 | @FixMethodOrder(MethodSorters.NAME_ASCENDING) 13 | public class FormManagementUnitTests { 14 | 15 | private static final String userId = System.getenv("USER_ID"); 16 | private static final String integratorKey = System.getenv("INTEGRATOR_KEY_JWT"); 17 | private static final byte[] privateKeyBytes = 18 | Base64.getDecoder().decode(System.getenv("PRIVATE_KEY")); 19 | private static final long expiresInHours = 3600; 20 | private static String accountId; 21 | private static String formId; 22 | 23 | public FormManagementUnitTests() {} 24 | 25 | @BeforeClass 26 | public static void setUpClass() { 27 | try { 28 | 29 | ApiClient apiClient = new ApiClient(); 30 | 31 | java.util.List scopes = new ArrayList(); 32 | scopes.add(OAuth.Scope_SIGNATURE); 33 | scopes.add(OAuth.Scope_IMPERSONATION); 34 | scopes.add("webforms_instance_write"); 35 | scopes.add("webforms_instance_read"); 36 | scopes.add("webforms_read"); 37 | scopes.add("webforms_write"); 38 | 39 | OAuth.OAuthToken tokenInfo = 40 | apiClient.requestJWTUserToken( 41 | integratorKey, userId, scopes, privateKeyBytes, expiresInHours); 42 | 43 | OAuth.UserInfo userInfo = apiClient.getUserInfo(tokenInfo.getAccessToken()); 44 | Assert.assertNotNull(userInfo.getAccounts()); 45 | accountId = 46 | userInfo.getAccounts().stream() 47 | .filter(x -> x.getIsDefault() == "true") 48 | .findFirst() 49 | .get() 50 | .getAccountId(); 51 | 52 | apiClient.setAccessToken(tokenInfo.getAccessToken(), tokenInfo.getExpiresIn()); 53 | Configuration.setDefaultApiClient(apiClient); 54 | 55 | FormManagementApi formManagementApi = 56 | new FormManagementApi(Configuration.getDefaultApiClient()); 57 | WebFormSummaryList webforms = formManagementApi.listForms(accountId); 58 | WebFormSummary publishedWebForm = 59 | webforms.getItems().stream().filter(x -> !x.isIsPublished()).findAny().get(); 60 | 61 | formId = publishedWebForm.getId(); 62 | 63 | } catch (ApiException ex) { 64 | Assert.fail("Exception: " + ex); 65 | } catch (Exception e) { 66 | Assert.fail("Exception: " + e.getLocalizedMessage()); 67 | } 68 | } 69 | 70 | @AfterClass 71 | public static void tearDownClass() { 72 | Configuration.setDefaultApiClient(null); 73 | } 74 | 75 | @Before 76 | public void setUp() {} 77 | 78 | @After 79 | public void tearDown() {} 80 | 81 | @Test 82 | public void listForms_ShouldReturnForms_WithValidAccountId() { 83 | // Arrange 84 | FormManagementApi formManagementApi = 85 | new FormManagementApi(Configuration.getDefaultApiClient()); 86 | WebFormSummaryList formSummaryList = null; 87 | 88 | // Act 89 | try { 90 | formSummaryList = formManagementApi.listForms(accountId); 91 | 92 | } catch (ApiException ex) { 93 | Assert.fail("Exception: " + ex); 94 | } catch (Exception e) { 95 | Assert.fail("Exception: " + e.getLocalizedMessage()); 96 | } 97 | 98 | // Assert 99 | Assert.assertNotNull("The list of forms should not be null.", formSummaryList); 100 | Assert.assertTrue( 101 | "The list of forms should not be empty.", formSummaryList.getItems().size() != 0); 102 | } 103 | 104 | @Test 105 | public void listForms_ShouldThrowApiException_WithInvalidAccountId() { 106 | // Arrange 107 | String invalidAccountId = UUID.randomUUID().toString(); 108 | FormManagementApi formManagementApi = 109 | new FormManagementApi(Configuration.getDefaultApiClient()); 110 | 111 | assertThrows( 112 | ApiException.class, 113 | () -> { 114 | formManagementApi.listForms(invalidAccountId); 115 | }); 116 | } 117 | 118 | @Test 119 | public void listFormsWithHttpInfo_ShouldReturnForms_WithValidAccountId() { 120 | // Arrange 121 | FormManagementApi formManagementApi = 122 | new FormManagementApi(Configuration.getDefaultApiClient()); 123 | ApiResponse formSummaryResponse = null; 124 | 125 | // Act 126 | try { 127 | formSummaryResponse = formManagementApi.listFormsWithHttpInfo(accountId, null); 128 | 129 | } catch (ApiException ex) { 130 | Assert.fail("Exception: " + ex); 131 | } catch (Exception e) { 132 | Assert.fail("Exception: " + e.getLocalizedMessage()); 133 | } 134 | 135 | // Assert 136 | Assert.assertTrue(formSummaryResponse.getStatusCode() == 200); 137 | Assert.assertNotNull("The list of forms should not be null.", formSummaryResponse.getData()); 138 | Assert.assertTrue( 139 | "The list of forms should not be empty.", 140 | formSummaryResponse.getData().getItems().size() != 0); 141 | } 142 | 143 | @Test 144 | public void getForm_ShouldReturnForm_WithValidAccountId_FormId() { 145 | // Arrange 146 | FormManagementApi formManagementApi = 147 | new FormManagementApi(Configuration.getDefaultApiClient()); 148 | WebForm webForm = null; 149 | 150 | // Act 151 | try { 152 | webForm = formManagementApi.getForm(accountId, formId); 153 | } catch (ApiException ex) { 154 | Assert.fail("Exception: " + ex); 155 | } catch (Exception e) { 156 | Assert.fail("Exception: " + e.getLocalizedMessage()); 157 | } 158 | 159 | // Assert 160 | Assert.assertNotNull("Form Object cannot be null", webForm); 161 | Assert.assertTrue( 162 | "WebformId in request and response should match", 163 | formId.toString().equals(webForm.getId())); 164 | } 165 | 166 | @Test 167 | public void getForm_ShouldThrowApiException_WithInvalidAccountId() { 168 | // Arrange 169 | String invalidAccountId = UUID.randomUUID().toString(); 170 | FormManagementApi formManagementApi = 171 | new FormManagementApi(Configuration.getDefaultApiClient()); 172 | 173 | assertThrows( 174 | ApiException.class, 175 | () -> { 176 | formManagementApi.getForm(invalidAccountId, formId); 177 | }); 178 | } 179 | 180 | @Test 181 | public void getFormsWithHttpInfo_ShouldReturnForm_WithValidAccountId() { 182 | // Arrange 183 | FormManagementApi formManagementApi = 184 | new FormManagementApi(Configuration.getDefaultApiClient()); 185 | ApiResponse formResponse = null; 186 | 187 | // Act 188 | try { 189 | formResponse = formManagementApi.getFormWithHttpInfo(accountId, formId, null); 190 | 191 | } catch (ApiException ex) { 192 | Assert.fail("Exception: " + ex); 193 | } catch (Exception e) { 194 | Assert.fail("Exception: " + e.getLocalizedMessage()); 195 | } 196 | 197 | // Assert 198 | Assert.assertTrue(formResponse.getStatusCode() == 200); 199 | Assert.assertNotNull("The list of forms should not be null.", formResponse.getData()); 200 | Assert.assertTrue( 201 | "WebformId in request and response should match", 202 | formId.toString().equals(formResponse.getData().getId())); 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /stylesheets/stylesheet.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; } 3 | 4 | body { 5 | padding: 0; 6 | margin: 0; 7 | font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; 8 | font-size: 16px; 9 | line-height: 1.5; 10 | color: #606c71; } 11 | 12 | a { 13 | color: #1e6bb8; 14 | text-decoration: none; } 15 | a:hover { 16 | text-decoration: underline; } 17 | 18 | .btn { 19 | display: inline-block; 20 | margin-bottom: 1rem; 21 | color: rgba(255, 255, 255, 0.7); 22 | background-color: rgba(255, 255, 255, 0.08); 23 | border-color: rgba(255, 255, 255, 0.2); 24 | border-style: solid; 25 | border-width: 1px; 26 | border-radius: 0.3rem; 27 | transition: color 0.2s, background-color 0.2s, border-color 0.2s; } 28 | .btn + .btn { 29 | margin-left: 1rem; } 30 | 31 | .btn:hover { 32 | color: rgba(255, 255, 255, 0.8); 33 | text-decoration: none; 34 | background-color: rgba(255, 255, 255, 0.2); 35 | border-color: rgba(255, 255, 255, 0.3); } 36 | 37 | @media screen and (min-width: 64em) { 38 | .btn { 39 | padding: 0.75rem 1rem; } } 40 | 41 | @media screen and (min-width: 42em) and (max-width: 64em) { 42 | .btn { 43 | padding: 0.6rem 0.9rem; 44 | font-size: 0.9rem; } } 45 | 46 | @media screen and (max-width: 42em) { 47 | .btn { 48 | display: block; 49 | width: 100%; 50 | padding: 0.75rem; 51 | font-size: 0.9rem; } 52 | .btn + .btn { 53 | margin-top: 1rem; 54 | margin-left: 0; } } 55 | 56 | .page-header { 57 | color: #fff; 58 | text-align: center; 59 | background-color: #159957; 60 | background-image: linear-gradient(120deg, #155799, #159957); } 61 | 62 | @media screen and (min-width: 64em) { 63 | .page-header { 64 | padding: 5rem 6rem; } } 65 | 66 | @media screen and (min-width: 42em) and (max-width: 64em) { 67 | .page-header { 68 | padding: 3rem 4rem; } } 69 | 70 | @media screen and (max-width: 42em) { 71 | .page-header { 72 | padding: 2rem 1rem; } } 73 | 74 | .project-name { 75 | margin-top: 0; 76 | margin-bottom: 0.1rem; } 77 | 78 | @media screen and (min-width: 64em) { 79 | .project-name { 80 | font-size: 3.25rem; } } 81 | 82 | @media screen and (min-width: 42em) and (max-width: 64em) { 83 | .project-name { 84 | font-size: 2.25rem; } } 85 | 86 | @media screen and (max-width: 42em) { 87 | .project-name { 88 | font-size: 1.75rem; } } 89 | 90 | .project-tagline { 91 | margin-bottom: 2rem; 92 | font-weight: normal; 93 | opacity: 0.7; } 94 | 95 | @media screen and (min-width: 64em) { 96 | .project-tagline { 97 | font-size: 1.25rem; } } 98 | 99 | @media screen and (min-width: 42em) and (max-width: 64em) { 100 | .project-tagline { 101 | font-size: 1.15rem; } } 102 | 103 | @media screen and (max-width: 42em) { 104 | .project-tagline { 105 | font-size: 1rem; } } 106 | 107 | .main-content :first-child { 108 | margin-top: 0; } 109 | .main-content img { 110 | max-width: 100%; } 111 | .main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 { 112 | margin-top: 2rem; 113 | margin-bottom: 1rem; 114 | font-weight: normal; 115 | color: #159957; } 116 | .main-content p { 117 | margin-bottom: 1em; } 118 | .main-content code { 119 | padding: 2px 4px; 120 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 121 | font-size: 0.9rem; 122 | color: #383e41; 123 | background-color: #f3f6fa; 124 | border-radius: 0.3rem; } 125 | .main-content pre { 126 | padding: 0.8rem; 127 | margin-top: 0; 128 | margin-bottom: 1rem; 129 | font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace; 130 | color: #567482; 131 | word-wrap: normal; 132 | background-color: #f3f6fa; 133 | border: solid 1px #dce6f0; 134 | border-radius: 0.3rem; } 135 | .main-content pre > code { 136 | padding: 0; 137 | margin: 0; 138 | font-size: 0.9rem; 139 | color: #567482; 140 | word-break: normal; 141 | white-space: pre; 142 | background: transparent; 143 | border: 0; } 144 | .main-content .highlight { 145 | margin-bottom: 1rem; } 146 | .main-content .highlight pre { 147 | margin-bottom: 0; 148 | word-break: normal; } 149 | .main-content .highlight pre, .main-content pre { 150 | padding: 0.8rem; 151 | overflow: auto; 152 | font-size: 0.9rem; 153 | line-height: 1.45; 154 | border-radius: 0.3rem; } 155 | .main-content pre code, .main-content pre tt { 156 | display: inline; 157 | max-width: initial; 158 | padding: 0; 159 | margin: 0; 160 | overflow: initial; 161 | line-height: inherit; 162 | word-wrap: normal; 163 | background-color: transparent; 164 | border: 0; } 165 | .main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after { 166 | content: normal; } 167 | .main-content ul, .main-content ol { 168 | margin-top: 0; } 169 | .main-content blockquote { 170 | padding: 0 1rem; 171 | margin-left: 0; 172 | color: #819198; 173 | border-left: 0.3rem solid #dce6f0; } 174 | .main-content blockquote > :first-child { 175 | margin-top: 0; } 176 | .main-content blockquote > :last-child { 177 | margin-bottom: 0; } 178 | .main-content table { 179 | display: block; 180 | width: 100%; 181 | overflow: auto; 182 | word-break: normal; 183 | word-break: keep-all; } 184 | .main-content table th { 185 | font-weight: bold; } 186 | .main-content table th, .main-content table td { 187 | padding: 0.5rem 1rem; 188 | border: 1px solid #e9ebec; } 189 | .main-content dl { 190 | padding: 0; } 191 | .main-content dl dt { 192 | padding: 0; 193 | margin-top: 1rem; 194 | font-size: 1rem; 195 | font-weight: bold; } 196 | .main-content dl dd { 197 | padding: 0; 198 | margin-bottom: 1rem; } 199 | .main-content hr { 200 | height: 2px; 201 | padding: 0; 202 | margin: 1rem 0; 203 | background-color: #eff0f1; 204 | border: 0; } 205 | 206 | @media screen and (min-width: 64em) { 207 | .main-content { 208 | max-width: 64rem; 209 | padding: 2rem 6rem; 210 | margin: 0 auto; 211 | font-size: 1.1rem; } } 212 | 213 | @media screen and (min-width: 42em) and (max-width: 64em) { 214 | .main-content { 215 | padding: 2rem 4rem; 216 | font-size: 1.1rem; } } 217 | 218 | @media screen and (max-width: 42em) { 219 | .main-content { 220 | padding: 2rem 1rem; 221 | font-size: 1rem; } } 222 | 223 | .site-footer { 224 | padding-top: 2rem; 225 | margin-top: 2rem; 226 | border-top: solid 1px #eff0f1; } 227 | 228 | .site-footer-owner { 229 | display: block; 230 | font-weight: bold; } 231 | 232 | .site-footer-credits { 233 | color: #819198; } 234 | 235 | @media screen and (min-width: 64em) { 236 | .site-footer { 237 | font-size: 1rem; } } 238 | 239 | @media screen and (min-width: 42em) and (max-width: 64em) { 240 | .site-footer { 241 | font-size: 1rem; } } 242 | 243 | @media screen and (max-width: 42em) { 244 | .site-footer { 245 | font-size: 0.9rem; } } 246 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormSummaryList.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormSummary; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonCreator; 8 | import com.fasterxml.jackson.annotation.JsonValue; 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | import java.math.BigDecimal; 11 | import java.io.Serializable; 12 | 13 | /** 14 | * A list of web form summary items.. 15 | * 16 | */ 17 | @Schema(description = "A list of web form summary items.") 18 | 19 | public class WebFormSummaryList implements Serializable { 20 | private static final long serialVersionUID = 1L; 21 | 22 | @JsonProperty("items") 23 | private java.util.List items = null; 24 | 25 | @JsonProperty("resultSetSize") 26 | private BigDecimal resultSetSize = null; 27 | 28 | @JsonProperty("totalSetSize") 29 | private BigDecimal totalSetSize = null; 30 | 31 | @JsonProperty("startPosition") 32 | private BigDecimal startPosition = null; 33 | 34 | @JsonProperty("endPosition") 35 | private BigDecimal endPosition = null; 36 | 37 | @JsonProperty("nextUrl") 38 | private String nextUrl = null; 39 | 40 | @JsonProperty("previousUrl") 41 | private String previousUrl = null; 42 | 43 | 44 | /** 45 | * items. 46 | * 47 | * @return WebFormSummaryList 48 | **/ 49 | public WebFormSummaryList items(java.util.List items) { 50 | this.items = items; 51 | return this; 52 | } 53 | 54 | /** 55 | * addItemsItem. 56 | * 57 | * @return WebFormSummaryList 58 | **/ 59 | public WebFormSummaryList addItemsItem(WebFormSummary itemsItem) { 60 | if (this.items == null) { 61 | this.items = new java.util.ArrayList<>(); 62 | } 63 | this.items.add(itemsItem); 64 | return this; 65 | } 66 | 67 | /** 68 | * Array of web form items with each containing summary.. 69 | * @return items 70 | **/ 71 | @Schema(description = "Array of web form items with each containing summary.") 72 | public java.util.List getItems() { 73 | return items; 74 | } 75 | 76 | /** 77 | * setItems. 78 | **/ 79 | public void setItems(java.util.List items) { 80 | this.items = items; 81 | } 82 | 83 | 84 | /** 85 | * resultSetSize. 86 | * 87 | * @return WebFormSummaryList 88 | **/ 89 | public WebFormSummaryList resultSetSize(BigDecimal resultSetSize) { 90 | this.resultSetSize = resultSetSize; 91 | return this; 92 | } 93 | 94 | /** 95 | * Result set size for current page. 96 | * @return resultSetSize 97 | **/ 98 | @Schema(example = "1.0", description = "Result set size for current page") 99 | public BigDecimal getResultSetSize() { 100 | return resultSetSize; 101 | } 102 | 103 | /** 104 | * setResultSetSize. 105 | **/ 106 | public void setResultSetSize(BigDecimal resultSetSize) { 107 | this.resultSetSize = resultSetSize; 108 | } 109 | 110 | 111 | /** 112 | * totalSetSize. 113 | * 114 | * @return WebFormSummaryList 115 | **/ 116 | public WebFormSummaryList totalSetSize(BigDecimal totalSetSize) { 117 | this.totalSetSize = totalSetSize; 118 | return this; 119 | } 120 | 121 | /** 122 | * Total result set size. 123 | * @return totalSetSize 124 | **/ 125 | @Schema(example = "1.0", description = "Total result set size") 126 | public BigDecimal getTotalSetSize() { 127 | return totalSetSize; 128 | } 129 | 130 | /** 131 | * setTotalSetSize. 132 | **/ 133 | public void setTotalSetSize(BigDecimal totalSetSize) { 134 | this.totalSetSize = totalSetSize; 135 | } 136 | 137 | 138 | /** 139 | * startPosition. 140 | * 141 | * @return WebFormSummaryList 142 | **/ 143 | public WebFormSummaryList startPosition(BigDecimal startPosition) { 144 | this.startPosition = startPosition; 145 | return this; 146 | } 147 | 148 | /** 149 | * Starting position of fields returned for the current page. 150 | * @return startPosition 151 | **/ 152 | @Schema(example = "1.0", description = "Starting position of fields returned for the current page") 153 | public BigDecimal getStartPosition() { 154 | return startPosition; 155 | } 156 | 157 | /** 158 | * setStartPosition. 159 | **/ 160 | public void setStartPosition(BigDecimal startPosition) { 161 | this.startPosition = startPosition; 162 | } 163 | 164 | 165 | /** 166 | * endPosition. 167 | * 168 | * @return WebFormSummaryList 169 | **/ 170 | public WebFormSummaryList endPosition(BigDecimal endPosition) { 171 | this.endPosition = endPosition; 172 | return this; 173 | } 174 | 175 | /** 176 | * Ending position of fields returned for the current page. 177 | * @return endPosition 178 | **/ 179 | @Schema(example = "1.0", description = "Ending position of fields returned for the current page") 180 | public BigDecimal getEndPosition() { 181 | return endPosition; 182 | } 183 | 184 | /** 185 | * setEndPosition. 186 | **/ 187 | public void setEndPosition(BigDecimal endPosition) { 188 | this.endPosition = endPosition; 189 | } 190 | 191 | 192 | /** 193 | * nextUrl. 194 | * 195 | * @return WebFormSummaryList 196 | **/ 197 | public WebFormSummaryList nextUrl(String nextUrl) { 198 | this.nextUrl = nextUrl; 199 | return this; 200 | } 201 | 202 | /** 203 | * Url for the next page of results. 204 | * @return nextUrl 205 | **/ 206 | @Schema(description = "Url for the next page of results") 207 | public String getNextUrl() { 208 | return nextUrl; 209 | } 210 | 211 | /** 212 | * setNextUrl. 213 | **/ 214 | public void setNextUrl(String nextUrl) { 215 | this.nextUrl = nextUrl; 216 | } 217 | 218 | 219 | /** 220 | * previousUrl. 221 | * 222 | * @return WebFormSummaryList 223 | **/ 224 | public WebFormSummaryList previousUrl(String previousUrl) { 225 | this.previousUrl = previousUrl; 226 | return this; 227 | } 228 | 229 | /** 230 | * Url for the previous page of results. 231 | * @return previousUrl 232 | **/ 233 | @Schema(description = "Url for the previous page of results") 234 | public String getPreviousUrl() { 235 | return previousUrl; 236 | } 237 | 238 | /** 239 | * setPreviousUrl. 240 | **/ 241 | public void setPreviousUrl(String previousUrl) { 242 | this.previousUrl = previousUrl; 243 | } 244 | 245 | 246 | /** 247 | * Compares objects. 248 | * 249 | * @return true or false depending on comparison result. 250 | */ 251 | @Override 252 | public boolean equals(java.lang.Object o) { 253 | if (this == o) { 254 | return true; 255 | } 256 | if (o == null || getClass() != o.getClass()) { 257 | return false; 258 | } 259 | WebFormSummaryList webFormSummaryList = (WebFormSummaryList) o; 260 | return Objects.equals(this.items, webFormSummaryList.items) && 261 | Objects.equals(this.resultSetSize, webFormSummaryList.resultSetSize) && 262 | Objects.equals(this.totalSetSize, webFormSummaryList.totalSetSize) && 263 | Objects.equals(this.startPosition, webFormSummaryList.startPosition) && 264 | Objects.equals(this.endPosition, webFormSummaryList.endPosition) && 265 | Objects.equals(this.nextUrl, webFormSummaryList.nextUrl) && 266 | Objects.equals(this.previousUrl, webFormSummaryList.previousUrl); 267 | } 268 | 269 | /** 270 | * Returns the HashCode. 271 | */ 272 | @Override 273 | public int hashCode() { 274 | return Objects.hash(items, resultSetSize, totalSetSize, startPosition, endPosition, nextUrl, previousUrl); 275 | } 276 | 277 | 278 | /** 279 | * Converts the given object to string. 280 | */ 281 | @Override 282 | public String toString() { 283 | StringBuilder sb = new StringBuilder(); 284 | sb.append("class WebFormSummaryList {\n"); 285 | 286 | sb.append(" items: ").append(toIndentedString(items)).append("\n"); 287 | sb.append(" resultSetSize: ").append(toIndentedString(resultSetSize)).append("\n"); 288 | sb.append(" totalSetSize: ").append(toIndentedString(totalSetSize)).append("\n"); 289 | sb.append(" startPosition: ").append(toIndentedString(startPosition)).append("\n"); 290 | sb.append(" endPosition: ").append(toIndentedString(endPosition)).append("\n"); 291 | sb.append(" nextUrl: ").append(toIndentedString(nextUrl)).append("\n"); 292 | sb.append(" previousUrl: ").append(toIndentedString(previousUrl)).append("\n"); 293 | sb.append("}"); 294 | return sb.toString(); 295 | } 296 | 297 | /** 298 | * Convert the given object to string with each line indented by 4 spaces 299 | * (except the first line). 300 | */ 301 | private String toIndentedString(java.lang.Object o) { 302 | if (o == null) { 303 | return "null"; 304 | } 305 | return o.toString().replace("\n", "\n "); 306 | } 307 | 308 | } 309 | 310 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormInstanceMetadata.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.InstanceSource; 6 | import com.docusign.webforms.model.WebFormUserInfo; 7 | import com.fasterxml.jackson.annotation.JsonProperty; 8 | import com.fasterxml.jackson.annotation.JsonCreator; 9 | import com.fasterxml.jackson.annotation.JsonValue; 10 | import io.swagger.v3.oas.annotations.media.Schema; 11 | import java.io.Serializable; 12 | 13 | /** 14 | * Web Form Instance metadata containing information like created by, created time, etc.. 15 | * 16 | */ 17 | @Schema(description = "Web Form Instance metadata containing information like created by, created time, etc.") 18 | 19 | public class WebFormInstanceMetadata implements Serializable { 20 | private static final long serialVersionUID = 1L; 21 | 22 | @JsonProperty("expirationDateTime") 23 | private String expirationDateTime = null; 24 | 25 | @JsonProperty("createdDateTime") 26 | private String createdDateTime = null; 27 | 28 | @JsonProperty("createdBy") 29 | private WebFormUserInfo createdBy = null; 30 | 31 | @JsonProperty("lastModifiedDateTime") 32 | private String lastModifiedDateTime = null; 33 | 34 | @JsonProperty("lastModifiedBy") 35 | private WebFormUserInfo lastModifiedBy = null; 36 | 37 | @JsonProperty("submittedDateTime") 38 | private String submittedDateTime = null; 39 | 40 | @JsonProperty("instanceSource") 41 | private InstanceSource instanceSource = null; 42 | 43 | 44 | /** 45 | * expirationDateTime. 46 | * 47 | * @return WebFormInstanceMetadata 48 | **/ 49 | public WebFormInstanceMetadata expirationDateTime(String expirationDateTime) { 50 | this.expirationDateTime = expirationDateTime; 51 | return this; 52 | } 53 | 54 | /** 55 | * Get expirationDateTime. 56 | * @return expirationDateTime 57 | **/ 58 | @Schema(required = true, description = "") 59 | public String getExpirationDateTime() { 60 | return expirationDateTime; 61 | } 62 | 63 | /** 64 | * setExpirationDateTime. 65 | **/ 66 | public void setExpirationDateTime(String expirationDateTime) { 67 | this.expirationDateTime = expirationDateTime; 68 | } 69 | 70 | 71 | /** 72 | * createdDateTime. 73 | * 74 | * @return WebFormInstanceMetadata 75 | **/ 76 | public WebFormInstanceMetadata createdDateTime(String createdDateTime) { 77 | this.createdDateTime = createdDateTime; 78 | return this; 79 | } 80 | 81 | /** 82 | * Get createdDateTime. 83 | * @return createdDateTime 84 | **/ 85 | @Schema(required = true, description = "") 86 | public String getCreatedDateTime() { 87 | return createdDateTime; 88 | } 89 | 90 | /** 91 | * setCreatedDateTime. 92 | **/ 93 | public void setCreatedDateTime(String createdDateTime) { 94 | this.createdDateTime = createdDateTime; 95 | } 96 | 97 | 98 | /** 99 | * createdBy. 100 | * 101 | * @return WebFormInstanceMetadata 102 | **/ 103 | public WebFormInstanceMetadata createdBy(WebFormUserInfo createdBy) { 104 | this.createdBy = createdBy; 105 | return this; 106 | } 107 | 108 | /** 109 | * The user that created the Web Form Instance. 110 | * @return createdBy 111 | **/ 112 | @Schema(required = true, description = "The user that created the Web Form Instance") 113 | public WebFormUserInfo getCreatedBy() { 114 | return createdBy; 115 | } 116 | 117 | /** 118 | * setCreatedBy. 119 | **/ 120 | public void setCreatedBy(WebFormUserInfo createdBy) { 121 | this.createdBy = createdBy; 122 | } 123 | 124 | 125 | /** 126 | * lastModifiedDateTime. 127 | * 128 | * @return WebFormInstanceMetadata 129 | **/ 130 | public WebFormInstanceMetadata lastModifiedDateTime(String lastModifiedDateTime) { 131 | this.lastModifiedDateTime = lastModifiedDateTime; 132 | return this; 133 | } 134 | 135 | /** 136 | * Get lastModifiedDateTime. 137 | * @return lastModifiedDateTime 138 | **/ 139 | @Schema(description = "") 140 | public String getLastModifiedDateTime() { 141 | return lastModifiedDateTime; 142 | } 143 | 144 | /** 145 | * setLastModifiedDateTime. 146 | **/ 147 | public void setLastModifiedDateTime(String lastModifiedDateTime) { 148 | this.lastModifiedDateTime = lastModifiedDateTime; 149 | } 150 | 151 | 152 | /** 153 | * lastModifiedBy. 154 | * 155 | * @return WebFormInstanceMetadata 156 | **/ 157 | public WebFormInstanceMetadata lastModifiedBy(WebFormUserInfo lastModifiedBy) { 158 | this.lastModifiedBy = lastModifiedBy; 159 | return this; 160 | } 161 | 162 | /** 163 | * The user that last modified the Web Form Instance. 164 | * @return lastModifiedBy 165 | **/ 166 | @Schema(description = "The user that last modified the Web Form Instance") 167 | public WebFormUserInfo getLastModifiedBy() { 168 | return lastModifiedBy; 169 | } 170 | 171 | /** 172 | * setLastModifiedBy. 173 | **/ 174 | public void setLastModifiedBy(WebFormUserInfo lastModifiedBy) { 175 | this.lastModifiedBy = lastModifiedBy; 176 | } 177 | 178 | 179 | /** 180 | * submittedDateTime. 181 | * 182 | * @return WebFormInstanceMetadata 183 | **/ 184 | public WebFormInstanceMetadata submittedDateTime(String submittedDateTime) { 185 | this.submittedDateTime = submittedDateTime; 186 | return this; 187 | } 188 | 189 | /** 190 | * Get submittedDateTime. 191 | * @return submittedDateTime 192 | **/ 193 | @Schema(description = "") 194 | public String getSubmittedDateTime() { 195 | return submittedDateTime; 196 | } 197 | 198 | /** 199 | * setSubmittedDateTime. 200 | **/ 201 | public void setSubmittedDateTime(String submittedDateTime) { 202 | this.submittedDateTime = submittedDateTime; 203 | } 204 | 205 | 206 | /** 207 | * instanceSource. 208 | * 209 | * @return WebFormInstanceMetadata 210 | **/ 211 | public WebFormInstanceMetadata instanceSource(InstanceSource instanceSource) { 212 | this.instanceSource = instanceSource; 213 | return this; 214 | } 215 | 216 | /** 217 | * Get instanceSource. 218 | * @return instanceSource 219 | **/ 220 | @Schema(description = "") 221 | public InstanceSource getInstanceSource() { 222 | return instanceSource; 223 | } 224 | 225 | /** 226 | * setInstanceSource. 227 | **/ 228 | public void setInstanceSource(InstanceSource instanceSource) { 229 | this.instanceSource = instanceSource; 230 | } 231 | 232 | 233 | /** 234 | * Compares objects. 235 | * 236 | * @return true or false depending on comparison result. 237 | */ 238 | @Override 239 | public boolean equals(java.lang.Object o) { 240 | if (this == o) { 241 | return true; 242 | } 243 | if (o == null || getClass() != o.getClass()) { 244 | return false; 245 | } 246 | WebFormInstanceMetadata webFormInstanceMetadata = (WebFormInstanceMetadata) o; 247 | return Objects.equals(this.expirationDateTime, webFormInstanceMetadata.expirationDateTime) && 248 | Objects.equals(this.createdDateTime, webFormInstanceMetadata.createdDateTime) && 249 | Objects.equals(this.createdBy, webFormInstanceMetadata.createdBy) && 250 | Objects.equals(this.lastModifiedDateTime, webFormInstanceMetadata.lastModifiedDateTime) && 251 | Objects.equals(this.lastModifiedBy, webFormInstanceMetadata.lastModifiedBy) && 252 | Objects.equals(this.submittedDateTime, webFormInstanceMetadata.submittedDateTime) && 253 | Objects.equals(this.instanceSource, webFormInstanceMetadata.instanceSource); 254 | } 255 | 256 | /** 257 | * Returns the HashCode. 258 | */ 259 | @Override 260 | public int hashCode() { 261 | return Objects.hash(expirationDateTime, createdDateTime, createdBy, lastModifiedDateTime, lastModifiedBy, submittedDateTime, instanceSource); 262 | } 263 | 264 | 265 | /** 266 | * Converts the given object to string. 267 | */ 268 | @Override 269 | public String toString() { 270 | StringBuilder sb = new StringBuilder(); 271 | sb.append("class WebFormInstanceMetadata {\n"); 272 | 273 | sb.append(" expirationDateTime: ").append(toIndentedString(expirationDateTime)).append("\n"); 274 | sb.append(" createdDateTime: ").append(toIndentedString(createdDateTime)).append("\n"); 275 | sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); 276 | sb.append(" lastModifiedDateTime: ").append(toIndentedString(lastModifiedDateTime)).append("\n"); 277 | sb.append(" lastModifiedBy: ").append(toIndentedString(lastModifiedBy)).append("\n"); 278 | sb.append(" submittedDateTime: ").append(toIndentedString(submittedDateTime)).append("\n"); 279 | sb.append(" instanceSource: ").append(toIndentedString(instanceSource)).append("\n"); 280 | sb.append("}"); 281 | return sb.toString(); 282 | } 283 | 284 | /** 285 | * Convert the given object to string with each line indented by 4 spaces 286 | * (except the first line). 287 | */ 288 | private String toIndentedString(java.lang.Object o) { 289 | if (o == null) { 290 | return "null"; 291 | } 292 | return o.toString().replace("\n", "\n "); 293 | } 294 | 295 | } 296 | 297 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/WebFormSummary.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.WebFormMetadata; 6 | import com.docusign.webforms.model.WebFormProperties; 7 | import com.docusign.webforms.model.WebFormState; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | import com.fasterxml.jackson.annotation.JsonCreator; 10 | import com.fasterxml.jackson.annotation.JsonValue; 11 | import io.swagger.v3.oas.annotations.media.Schema; 12 | import java.io.Serializable; 13 | 14 | /** 15 | * An object that summarizes an instance of a form that can be used to display a listing. 16 | * 17 | */ 18 | @Schema(description = "An object that summarizes an instance of a form that can be used to display a listing") 19 | 20 | public class WebFormSummary implements Serializable { 21 | private static final long serialVersionUID = 1L; 22 | 23 | @JsonProperty("id") 24 | private String id = null; 25 | 26 | @JsonProperty("accountId") 27 | private String accountId = null; 28 | 29 | @JsonProperty("isPublished") 30 | private Boolean isPublished = null; 31 | 32 | @JsonProperty("isEnabled") 33 | private Boolean isEnabled = null; 34 | 35 | @JsonProperty("isUploaded") 36 | private Boolean isUploaded = null; 37 | 38 | @JsonProperty("hasDraftChanges") 39 | private Boolean hasDraftChanges = null; 40 | 41 | @JsonProperty("formState") 42 | private WebFormState formState = null; 43 | 44 | @JsonProperty("formProperties") 45 | private WebFormProperties formProperties = null; 46 | 47 | @JsonProperty("formMetadata") 48 | private WebFormMetadata formMetadata = null; 49 | 50 | 51 | /** 52 | * id. 53 | * 54 | * @return WebFormSummary 55 | **/ 56 | public WebFormSummary id(String id) { 57 | this.id = id; 58 | return this; 59 | } 60 | 61 | /** 62 | * Get id. 63 | * @return id 64 | **/ 65 | @Schema(description = "") 66 | public String getId() { 67 | return id; 68 | } 69 | 70 | /** 71 | * setId. 72 | **/ 73 | public void setId(String id) { 74 | this.id = id; 75 | } 76 | 77 | 78 | /** 79 | * accountId. 80 | * 81 | * @return WebFormSummary 82 | **/ 83 | public WebFormSummary accountId(String accountId) { 84 | this.accountId = accountId; 85 | return this; 86 | } 87 | 88 | /** 89 | * Get accountId. 90 | * @return accountId 91 | **/ 92 | @Schema(description = "") 93 | public String getAccountId() { 94 | return accountId; 95 | } 96 | 97 | /** 98 | * setAccountId. 99 | **/ 100 | public void setAccountId(String accountId) { 101 | this.accountId = accountId; 102 | } 103 | 104 | 105 | /** 106 | * isPublished. 107 | * 108 | * @return WebFormSummary 109 | **/ 110 | public WebFormSummary isPublished(Boolean isPublished) { 111 | this.isPublished = isPublished; 112 | return this; 113 | } 114 | 115 | /** 116 | * Has the form been published. 117 | * @return isPublished 118 | **/ 119 | @Schema(example = "true", description = "Has the form been published") 120 | public Boolean isIsPublished() { 121 | return isPublished; 122 | } 123 | 124 | /** 125 | * setIsPublished. 126 | **/ 127 | public void setIsPublished(Boolean isPublished) { 128 | this.isPublished = isPublished; 129 | } 130 | 131 | 132 | /** 133 | * isEnabled. 134 | * 135 | * @return WebFormSummary 136 | **/ 137 | public WebFormSummary isEnabled(Boolean isEnabled) { 138 | this.isEnabled = isEnabled; 139 | return this; 140 | } 141 | 142 | /** 143 | * Is the form currently enabled and available for data collection. 144 | * @return isEnabled 145 | **/ 146 | @Schema(example = "true", description = "Is the form currently enabled and available for data collection") 147 | public Boolean isIsEnabled() { 148 | return isEnabled; 149 | } 150 | 151 | /** 152 | * setIsEnabled. 153 | **/ 154 | public void setIsEnabled(Boolean isEnabled) { 155 | this.isEnabled = isEnabled; 156 | } 157 | 158 | 159 | /** 160 | * isUploaded. 161 | * 162 | * @return WebFormSummary 163 | **/ 164 | public WebFormSummary isUploaded(Boolean isUploaded) { 165 | this.isUploaded = isUploaded; 166 | return this; 167 | } 168 | 169 | /** 170 | * Has the form created through upload. 171 | * @return isUploaded 172 | **/ 173 | @Schema(example = "true", description = "Has the form created through upload") 174 | public Boolean isIsUploaded() { 175 | return isUploaded; 176 | } 177 | 178 | /** 179 | * setIsUploaded. 180 | **/ 181 | public void setIsUploaded(Boolean isUploaded) { 182 | this.isUploaded = isUploaded; 183 | } 184 | 185 | 186 | /** 187 | * hasDraftChanges. 188 | * 189 | * @return WebFormSummary 190 | **/ 191 | public WebFormSummary hasDraftChanges(Boolean hasDraftChanges) { 192 | this.hasDraftChanges = hasDraftChanges; 193 | return this; 194 | } 195 | 196 | /** 197 | * Does the form have draft changes that need to be published?. 198 | * @return hasDraftChanges 199 | **/ 200 | @Schema(example = "true", description = "Does the form have draft changes that need to be published?") 201 | public Boolean isHasDraftChanges() { 202 | return hasDraftChanges; 203 | } 204 | 205 | /** 206 | * setHasDraftChanges. 207 | **/ 208 | public void setHasDraftChanges(Boolean hasDraftChanges) { 209 | this.hasDraftChanges = hasDraftChanges; 210 | } 211 | 212 | 213 | /** 214 | * formState. 215 | * 216 | * @return WebFormSummary 217 | **/ 218 | public WebFormSummary formState(WebFormState formState) { 219 | this.formState = formState; 220 | return this; 221 | } 222 | 223 | /** 224 | * Get formState. 225 | * @return formState 226 | **/ 227 | @Schema(description = "") 228 | public WebFormState getFormState() { 229 | return formState; 230 | } 231 | 232 | /** 233 | * setFormState. 234 | **/ 235 | public void setFormState(WebFormState formState) { 236 | this.formState = formState; 237 | } 238 | 239 | 240 | /** 241 | * formProperties. 242 | * 243 | * @return WebFormSummary 244 | **/ 245 | public WebFormSummary formProperties(WebFormProperties formProperties) { 246 | this.formProperties = formProperties; 247 | return this; 248 | } 249 | 250 | /** 251 | * Get formProperties. 252 | * @return formProperties 253 | **/ 254 | @Schema(description = "") 255 | public WebFormProperties getFormProperties() { 256 | return formProperties; 257 | } 258 | 259 | /** 260 | * setFormProperties. 261 | **/ 262 | public void setFormProperties(WebFormProperties formProperties) { 263 | this.formProperties = formProperties; 264 | } 265 | 266 | 267 | /** 268 | * formMetadata. 269 | * 270 | * @return WebFormSummary 271 | **/ 272 | public WebFormSummary formMetadata(WebFormMetadata formMetadata) { 273 | this.formMetadata = formMetadata; 274 | return this; 275 | } 276 | 277 | /** 278 | * Get formMetadata. 279 | * @return formMetadata 280 | **/ 281 | @Schema(description = "") 282 | public WebFormMetadata getFormMetadata() { 283 | return formMetadata; 284 | } 285 | 286 | /** 287 | * setFormMetadata. 288 | **/ 289 | public void setFormMetadata(WebFormMetadata formMetadata) { 290 | this.formMetadata = formMetadata; 291 | } 292 | 293 | 294 | /** 295 | * Compares objects. 296 | * 297 | * @return true or false depending on comparison result. 298 | */ 299 | @Override 300 | public boolean equals(java.lang.Object o) { 301 | if (this == o) { 302 | return true; 303 | } 304 | if (o == null || getClass() != o.getClass()) { 305 | return false; 306 | } 307 | WebFormSummary webFormSummary = (WebFormSummary) o; 308 | return Objects.equals(this.id, webFormSummary.id) && 309 | Objects.equals(this.accountId, webFormSummary.accountId) && 310 | Objects.equals(this.isPublished, webFormSummary.isPublished) && 311 | Objects.equals(this.isEnabled, webFormSummary.isEnabled) && 312 | Objects.equals(this.isUploaded, webFormSummary.isUploaded) && 313 | Objects.equals(this.hasDraftChanges, webFormSummary.hasDraftChanges) && 314 | Objects.equals(this.formState, webFormSummary.formState) && 315 | Objects.equals(this.formProperties, webFormSummary.formProperties) && 316 | Objects.equals(this.formMetadata, webFormSummary.formMetadata); 317 | } 318 | 319 | /** 320 | * Returns the HashCode. 321 | */ 322 | @Override 323 | public int hashCode() { 324 | return Objects.hash(id, accountId, isPublished, isEnabled, isUploaded, hasDraftChanges, formState, formProperties, formMetadata); 325 | } 326 | 327 | 328 | /** 329 | * Converts the given object to string. 330 | */ 331 | @Override 332 | public String toString() { 333 | StringBuilder sb = new StringBuilder(); 334 | sb.append("class WebFormSummary {\n"); 335 | 336 | sb.append(" id: ").append(toIndentedString(id)).append("\n"); 337 | sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); 338 | sb.append(" isPublished: ").append(toIndentedString(isPublished)).append("\n"); 339 | sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); 340 | sb.append(" isUploaded: ").append(toIndentedString(isUploaded)).append("\n"); 341 | sb.append(" hasDraftChanges: ").append(toIndentedString(hasDraftChanges)).append("\n"); 342 | sb.append(" formState: ").append(toIndentedString(formState)).append("\n"); 343 | sb.append(" formProperties: ").append(toIndentedString(formProperties)).append("\n"); 344 | sb.append(" formMetadata: ").append(toIndentedString(formMetadata)).append("\n"); 345 | sb.append("}"); 346 | return sb.toString(); 347 | } 348 | 349 | /** 350 | * Convert the given object to string with each line indented by 4 spaces 351 | * (except the first line). 352 | */ 353 | private String toIndentedString(java.lang.Object o) { 354 | if (o == null) { 355 | return "null"; 356 | } 357 | return o.toString().replace("\n", "\n "); 358 | } 359 | 360 | } 361 | 362 | -------------------------------------------------------------------------------- /stylesheets/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | box-sizing: content-box; 213 | height: 0; 214 | } 215 | 216 | /** 217 | * Contain overflow in all browsers. 218 | */ 219 | 220 | pre { 221 | overflow: auto; 222 | } 223 | 224 | /** 225 | * Address odd `em`-unit font size rendering in all browsers. 226 | */ 227 | 228 | code, 229 | kbd, 230 | pre, 231 | samp { 232 | font-family: monospace, monospace; 233 | font-size: 1em; 234 | } 235 | 236 | /* Forms 237 | ========================================================================== */ 238 | 239 | /** 240 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 241 | * styling of `select`, unless a `border` property is set. 242 | */ 243 | 244 | /** 245 | * 1. Correct color not being inherited. 246 | * Known issue: affects color of disabled elements. 247 | * 2. Correct font properties not being inherited. 248 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 249 | */ 250 | 251 | button, 252 | input, 253 | optgroup, 254 | select, 255 | textarea { 256 | color: inherit; /* 1 */ 257 | font: inherit; /* 2 */ 258 | margin: 0; /* 3 */ 259 | } 260 | 261 | /** 262 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 263 | */ 264 | 265 | button { 266 | overflow: visible; 267 | } 268 | 269 | /** 270 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 271 | * All other form control elements do not inherit `text-transform` values. 272 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 273 | * Correct `select` style inheritance in Firefox. 274 | */ 275 | 276 | button, 277 | select { 278 | text-transform: none; 279 | } 280 | 281 | /** 282 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 283 | * and `video` controls. 284 | * 2. Correct inability to style clickable `input` types in iOS. 285 | * 3. Improve usability and consistency of cursor style between image-type 286 | * `input` and others. 287 | */ 288 | 289 | button, 290 | html input[type="button"], /* 1 */ 291 | input[type="reset"], 292 | input[type="submit"] { 293 | -webkit-appearance: button; /* 2 */ 294 | cursor: pointer; /* 3 */ 295 | } 296 | 297 | /** 298 | * Re-set default cursor for disabled elements. 299 | */ 300 | 301 | button[disabled], 302 | html input[disabled] { 303 | cursor: default; 304 | } 305 | 306 | /** 307 | * Remove inner padding and border in Firefox 4+. 308 | */ 309 | 310 | button::-moz-focus-inner, 311 | input::-moz-focus-inner { 312 | border: 0; 313 | padding: 0; 314 | } 315 | 316 | /** 317 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 318 | * the UA stylesheet. 319 | */ 320 | 321 | input { 322 | line-height: normal; 323 | } 324 | 325 | /** 326 | * It's recommended that you don't attempt to style these elements. 327 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 328 | * 329 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 330 | * 2. Remove excess padding in IE 8/9/10. 331 | */ 332 | 333 | input[type="checkbox"], 334 | input[type="radio"] { 335 | box-sizing: border-box; /* 1 */ 336 | padding: 0; /* 2 */ 337 | } 338 | 339 | /** 340 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 341 | * `font-size` values of the `input`, it causes the cursor style of the 342 | * decrement button to change from `default` to `text`. 343 | */ 344 | 345 | input[type="number"]::-webkit-inner-spin-button, 346 | input[type="number"]::-webkit-outer-spin-button { 347 | height: auto; 348 | } 349 | 350 | /** 351 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 352 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 353 | * (include `-moz` to future-proof). 354 | */ 355 | 356 | input[type="search"] { 357 | -webkit-appearance: textfield; /* 1 */ /* 2 */ 358 | box-sizing: content-box; 359 | } 360 | 361 | /** 362 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 363 | * Safari (but not Chrome) clips the cancel button when the search input has 364 | * padding (and `textfield` appearance). 365 | */ 366 | 367 | input[type="search"]::-webkit-search-cancel-button, 368 | input[type="search"]::-webkit-search-decoration { 369 | -webkit-appearance: none; 370 | } 371 | 372 | /** 373 | * Define consistent border, margin, and padding. 374 | */ 375 | 376 | fieldset { 377 | border: 1px solid #c0c0c0; 378 | margin: 0 2px; 379 | padding: 0.35em 0.625em 0.75em; 380 | } 381 | 382 | /** 383 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 384 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 385 | */ 386 | 387 | legend { 388 | border: 0; /* 1 */ 389 | padding: 0; /* 2 */ 390 | } 391 | 392 | /** 393 | * Remove default vertical scrollbar in IE 8/9/10/11. 394 | */ 395 | 396 | textarea { 397 | overflow: auto; 398 | } 399 | 400 | /** 401 | * Don't inherit the `font-weight` (applied by a rule above). 402 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 403 | */ 404 | 405 | optgroup { 406 | font-weight: bold; 407 | } 408 | 409 | /* Tables 410 | ========================================================================== */ 411 | 412 | /** 413 | * Remove most spacing between table cells. 414 | */ 415 | 416 | table { 417 | border-collapse: collapse; 418 | border-spacing: 0; 419 | } 420 | 421 | td, 422 | th { 423 | padding: 0; 424 | } 425 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/client/auth/JWTUtils.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.client.auth; 2 | 3 | import com.auth0.jwt.JWT; 4 | import com.auth0.jwt.JWTCreator; 5 | import com.auth0.jwt.algorithms.Algorithm; 6 | import com.auth0.jwt.exceptions.JWTCreationException; 7 | import java.io.File; 8 | import java.io.FileNotFoundException; 9 | import java.io.FileReader; 10 | import java.io.IOException; 11 | import java.io.StringReader; 12 | import java.security.KeyFactory; 13 | import java.security.NoSuchAlgorithmException; 14 | import java.security.NoSuchProviderException; 15 | import java.security.Security; 16 | import java.security.interfaces.RSAPrivateKey; 17 | import java.security.interfaces.RSAPublicKey; 18 | import java.security.spec.EncodedKeySpec; 19 | import java.security.spec.InvalidKeySpecException; 20 | import java.security.spec.PKCS8EncodedKeySpec; 21 | import java.security.spec.X509EncodedKeySpec; 22 | import java.util.Date; 23 | import org.bouncycastle.jce.provider.BouncyCastleProvider; 24 | import org.bouncycastle.util.io.pem.PemObject; 25 | import org.bouncycastle.util.io.pem.PemReader; 26 | 27 | /** 28 | * JWTUtils class. 29 | * 30 | */ 31 | public class JWTUtils { 32 | 33 | /** 34 | * Helper method to create a JWT token for the JWT flow. 35 | * 36 | * @param rsaPrivateKey the byte contents of the RSA private key 37 | * @param oAuthBasePath Docusign OAuth base path (account-d.docusign.com for the developer sandbox 38 | * and account.docusign.com for the production platform) 39 | * @param clientId Docusign OAuth Client Id (AKA Integrator Key) 40 | * @param userId Docusign user Id to be impersonated (This is a UUID) 41 | * @param expiresIn number of seconds remaining before the JWT assertion is considered as invalid 42 | * @param scopes space-separated string that represents the list of scopes to grant to the OAuth 43 | * token. 44 | * @return a fresh JWT token 45 | * @throws IllegalArgumentException if one of the arguments is invalid 46 | * @throws JWTCreationException if not able to create a JWT token from the input parameters 47 | * @throws IOException if there is an issue with either the public or private file 48 | */ 49 | public static String generateJWTAssertionFromByteArray( 50 | byte[] rsaPrivateKey, 51 | String oAuthBasePath, 52 | String clientId, 53 | String userId, 54 | long expiresIn, 55 | String scopes) 56 | throws IllegalArgumentException, JWTCreationException, IOException { 57 | if (expiresIn <= 0L) { 58 | throw new IllegalArgumentException("expiresIn should be a non-negative value"); 59 | } 60 | if (rsaPrivateKey == null || rsaPrivateKey.length == 0) { 61 | throw new IllegalArgumentException("rsaPrivateKey byte array is empty"); 62 | } 63 | if (oAuthBasePath == null 64 | || "".equals(oAuthBasePath) 65 | || clientId == null 66 | || "".equals(clientId)) { 67 | throw new IllegalArgumentException("One of the arguments is null or empty"); 68 | } 69 | 70 | RSAPrivateKey privateKey = readPrivateKeyFromByteArray(rsaPrivateKey, "RSA"); 71 | Algorithm algorithm = Algorithm.RSA256(null, privateKey); 72 | long now = System.currentTimeMillis(); 73 | JWTCreator.Builder builder = 74 | JWT.create() 75 | .withIssuer(clientId) 76 | .withAudience(oAuthBasePath) 77 | .withIssuedAt(new Date(now)) 78 | .withClaim("scope", scopes) 79 | .withExpiresAt(new Date(now + expiresIn * 1000)); 80 | if (userId != null && userId != "") { 81 | builder = builder.withSubject(userId); 82 | } 83 | return builder.sign(algorithm); 84 | } 85 | 86 | /** 87 | * Helper method to create a JWT token for the JWT flow. 88 | * 89 | * @param publicKeyFilename the filename of the RSA public key 90 | * @param privateKeyFilename the filename of the RSA private key 91 | * @param oAuthBasePath Docusign OAuth base path (account-d.docusign.com for the developer sandbox 92 | * and account.docusign.com for the production platform) 93 | * @param clientId Docusign OAuth Client Id (AKA Integrator Key) 94 | * @param userId Docusign user Id to be impersonated (This is a UUID) 95 | * @param expiresIn number of seconds remaining before the JWT assertion is considered as invalid 96 | * @return a fresh JWT token 97 | * @throws JWTCreationException if not able to create a JWT token from the input parameters 98 | * @throws IOException if there is an issue with either the public or private file 99 | */ 100 | public static String generateJWTAssertion( 101 | String publicKeyFilename, 102 | String privateKeyFilename, 103 | String oAuthBasePath, 104 | String clientId, 105 | String userId, 106 | long expiresIn) 107 | throws JWTCreationException, IOException { 108 | return generateJWTAssertion(publicKeyFilename, privateKeyFilename, oAuthBasePath, clientId, userId, expiresIn, "signature"); 109 | } 110 | 111 | /** 112 | * Helper method to create a JWT token for the JWT flow. 113 | * 114 | * @param publicKeyFilename the filename of the RSA public key 115 | * @param privateKeyFilename the filename of the RSA private key 116 | * @param oAuthBasePath Docusign OAuth base path (account-d.docusign.com for the developer sandbox 117 | * and account.docusign.com for the production platform) 118 | * @param clientId Docusign OAuth Client Id (AKA Integrator Key) 119 | * @param userId Docusign user Id to be impersonated (This is a UUID) 120 | * @param expiresIn number of seconds remaining before the JWT assertion is considered as invalid 121 | * @param scopes space-separated string that represents the list of scopes to grant to the OAuth 122 | * token. 123 | * @return a fresh JWT token 124 | * @throws JWTCreationException if not able to create a JWT token from the input parameters 125 | * @throws IOException if there is an issue with either the public or private file 126 | */ 127 | public static String generateJWTAssertion( 128 | String publicKeyFilename, 129 | String privateKeyFilename, 130 | String oAuthBasePath, 131 | String clientId, 132 | String userId, 133 | long expiresIn, 134 | String scopes) 135 | throws JWTCreationException, IOException { 136 | String token = null; 137 | if (expiresIn <= 0L) { 138 | throw new IllegalArgumentException("expiresIn should be a non-negative value"); 139 | } 140 | if (publicKeyFilename == null 141 | || "".equals(publicKeyFilename) 142 | || privateKeyFilename == null 143 | || "".equals(privateKeyFilename) 144 | || oAuthBasePath == null 145 | || "".equals(oAuthBasePath) 146 | || clientId == null 147 | || "".equals(clientId) 148 | || userId == null 149 | || "".equals(userId)) { 150 | throw new IllegalArgumentException("One of the arguments is null or empty"); 151 | } 152 | 153 | try { 154 | RSAPublicKey publicKey = readPublicKeyFromFile(publicKeyFilename, "RSA"); 155 | RSAPrivateKey privateKey = readPrivateKeyFromFile(privateKeyFilename, "RSA"); 156 | Algorithm algorithm = Algorithm.RSA256(publicKey, privateKey); 157 | long now = System.currentTimeMillis(); 158 | token = 159 | JWT.create() 160 | .withIssuer(clientId) 161 | .withSubject(userId) 162 | .withAudience(oAuthBasePath) 163 | .withNotBefore(new Date(now)) 164 | .withExpiresAt(new Date(now + expiresIn * 1000)) 165 | .withClaim("scope", scopes) 166 | .sign(algorithm); 167 | } catch (JWTCreationException e) { 168 | throw e; 169 | } catch (IOException e) { 170 | throw e; 171 | } 172 | 173 | return token; 174 | } 175 | 176 | private static RSAPublicKey readPublicKeyFromFile(String filepath, String algorithm) 177 | throws IOException { 178 | File pemFile = new File(filepath); 179 | if (!pemFile.isFile() || !pemFile.exists()) { 180 | throw new FileNotFoundException( 181 | String.format("The file '%s' doesn't exist.", pemFile.getAbsolutePath())); 182 | } 183 | PemReader reader = new PemReader(new FileReader(pemFile)); 184 | try { 185 | PemObject pemObject = reader.readPemObject(); 186 | byte[] bytes = pemObject.getContent(); 187 | RSAPublicKey publicKey = null; 188 | try { 189 | KeyFactory kf = KeyFactory.getInstance(algorithm); 190 | EncodedKeySpec keySpec = new X509EncodedKeySpec(bytes); 191 | publicKey = (RSAPublicKey) kf.generatePublic(keySpec); 192 | } catch (NoSuchAlgorithmException e) { 193 | System.out.println( 194 | "Could not reconstruct the public key, the given algorithm could not be found."); 195 | } catch (InvalidKeySpecException e) { 196 | System.out.println("Could not reconstruct the public key"); 197 | } 198 | 199 | return publicKey; 200 | } finally { 201 | reader.close(); 202 | } 203 | } 204 | 205 | private static RSAPrivateKey readPrivateKeyFromFile(String filepath, String algorithm) 206 | throws IOException { 207 | File pemFile = new File(filepath); 208 | if (!pemFile.isFile() || !pemFile.exists()) { 209 | throw new FileNotFoundException( 210 | String.format("The file '%s' doesn't exist.", pemFile.getAbsolutePath())); 211 | } 212 | PemReader reader = new PemReader(new FileReader(pemFile)); 213 | try { 214 | PemObject pemObject = reader.readPemObject(); 215 | byte[] bytes = pemObject.getContent(); 216 | RSAPrivateKey privateKey = null; 217 | try { 218 | Security.addProvider(new BouncyCastleProvider()); 219 | KeyFactory kf = KeyFactory.getInstance(algorithm, "BC"); 220 | EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); 221 | privateKey = (RSAPrivateKey) kf.generatePrivate(keySpec); 222 | } catch (NoSuchAlgorithmException e) { 223 | System.out.println( 224 | "Could not reconstruct the private key, the given algorithm could not be found."); 225 | } catch (InvalidKeySpecException e) { 226 | System.out.println("Could not reconstruct the private key"); 227 | } catch (NoSuchProviderException e) { 228 | System.out.println("Could not reconstruct the private key, invalid provider."); 229 | } 230 | 231 | return privateKey; 232 | } finally { 233 | reader.close(); 234 | } 235 | } 236 | 237 | private static RSAPrivateKey readPrivateKeyFromByteArray(byte[] privateKeyBytes, String algorithm) 238 | throws IOException { 239 | PemReader reader = new PemReader(new StringReader(new String(privateKeyBytes))); 240 | try { 241 | PemObject pemObject = reader.readPemObject(); 242 | byte[] bytes = pemObject.getContent(); 243 | RSAPrivateKey privateKey = null; 244 | try { 245 | Security.addProvider(new BouncyCastleProvider()); 246 | KeyFactory kf = KeyFactory.getInstance(algorithm, "BC"); 247 | EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); 248 | privateKey = (RSAPrivateKey) kf.generatePrivate(keySpec); 249 | } catch (NoSuchAlgorithmException e) { 250 | System.out.println( 251 | "Could not reconstruct the private key, the given algorithm could not be found."); 252 | } catch (InvalidKeySpecException e) { 253 | System.out.println("Could not reconstruct the private key"); 254 | } catch (NoSuchProviderException e) { 255 | System.out.println("Could not reconstruct the private key, invalid provider."); 256 | } 257 | 258 | return privateKey; 259 | } finally { 260 | reader.close(); 261 | } 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/api/FormManagementApi.java: -------------------------------------------------------------------------------- 1 | 2 | package com.docusign.webforms.api; 3 | 4 | import jakarta.ws.rs.core.GenericType; 5 | 6 | import com.docusign.webforms.client.ApiException; 7 | import com.docusign.webforms.client.ApiClient; 8 | import com.docusign.webforms.client.Configuration; 9 | import com.docusign.webforms.model.*; 10 | import com.docusign.webforms.client.Pair; 11 | import com.docusign.webforms.client.ApiResponse; 12 | 13 | 14 | 15 | 16 | /** 17 | * FormManagementApi class. 18 | * 19 | **/ 20 | public class FormManagementApi { 21 | private ApiClient apiClient; 22 | 23 | /** 24 | * FormManagementApi. 25 | * 26 | **/ 27 | public FormManagementApi() { 28 | this(Configuration.getDefaultApiClient()); 29 | } 30 | 31 | /** 32 | * FormManagementApi. 33 | * 34 | **/ 35 | public FormManagementApi(ApiClient apiClient) { 36 | this.apiClient = apiClient; 37 | } 38 | 39 | /** 40 | * getApiClient Method. 41 | * 42 | * @return ApiClient 43 | **/ 44 | public ApiClient getApiClient() { 45 | return apiClient; 46 | } 47 | 48 | /** 49 | * setApiClient Method. 50 | * 51 | **/ 52 | public void setApiClient(ApiClient apiClient) { 53 | this.apiClient = apiClient; 54 | } 55 | 56 | /// 57 | /// Get Form Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 58 | /// 59 | 60 | /** 61 | * GetFormOptions Class. 62 | * 63 | **/ 64 | public class GetFormOptions 65 | { 66 | private String state = null; 67 | 68 | /** 69 | * setState method. 70 | */ 71 | public void setState(String state) { 72 | this.state = state; 73 | } 74 | 75 | /** 76 | * getState method. 77 | * 78 | * @return String 79 | */ 80 | public String getState() { 81 | return this.state; 82 | } 83 | } 84 | 85 | /** 86 | * Get Form. 87 | * Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 88 | * @param accountId Account identifier in which the web form resides (required) 89 | * @param formId Unique identifier for a web form that is consistent for it's lifetime (required) 90 | * @return WebForm 91 | */ 92 | public WebForm getForm(String accountId, String formId) throws ApiException { 93 | return getForm(accountId, formId, null); 94 | } 95 | 96 | /** 97 | * Get Form. 98 | * Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 99 | * @param accountId Account identifier in which the web form resides (required) 100 | * @param formId Unique identifier for a web form that is consistent for it's lifetime (required) 101 | * @param options for modifying the method behavior. 102 | * @return WebForm 103 | * @throws ApiException if fails to make API call 104 | */ 105 | public WebForm getForm(String accountId, String formId, FormManagementApi.GetFormOptions options) throws ApiException { 106 | ApiResponse localVarResponse = getFormWithHttpInfo(accountId, formId, options); 107 | return localVarResponse.getData(); 108 | } 109 | 110 | /** 111 | * Get Form 112 | * Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`. 113 | * @param accountId Account identifier in which the web form resides (required) 114 | * @param formId Unique identifier for a web form that is consistent for it's lifetime (required) 115 | * @param options for modifying the method behavior. 116 | * @return WebForm 117 | * @throws ApiException if fails to make API call 118 | */ 119 | public ApiResponse getFormWithHttpInfo(String accountId, String formId, FormManagementApi.GetFormOptions options) throws ApiException { 120 | Object localVarPostBody = "{}"; 121 | 122 | // verify the required parameter 'accountId' is set 123 | if (accountId == null) { 124 | throw new ApiException(400, "Missing the required parameter 'accountId' when calling getForm"); 125 | } 126 | 127 | // verify the required parameter 'formId' is set 128 | if (formId == null) { 129 | throw new ApiException(400, "Missing the required parameter 'formId' when calling getForm"); 130 | } 131 | 132 | // create path and map variables 133 | String localVarPath = "/v1.1/accounts/{accountId}/forms/{formId}" 134 | .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString())) 135 | .replaceAll("\\{" + "formId" + "\\}", apiClient.escapeString(formId.toString())); 136 | 137 | // query params 138 | java.util.List localVarQueryParams = new java.util.ArrayList(); 139 | java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); 140 | java.util.Map localVarHeaderParams = new java.util.HashMap(); 141 | java.util.Map localVarFormParams = new java.util.HashMap(); 142 | 143 | if (options != null) { 144 | localVarQueryParams.addAll(apiClient.parameterToPair("state", options.state)); 145 | } 146 | 147 | 148 | 149 | 150 | 151 | final String[] localVarAccepts = { 152 | "application/json" 153 | }; 154 | final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 155 | 156 | final String[] localVarContentTypes = { 157 | "application/json" 158 | }; 159 | final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); 160 | 161 | String[] localVarAuthNames = new String[] { "docusignAccessCode" }; 162 | 163 | GenericType localVarReturnType = new GenericType() {}; 164 | WebForm localVarResponse = apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); 165 | return new ApiResponse(apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse); 166 | } 167 | /// 168 | /// List Forms List all the forms for the active user that can be in an active or draft state 169 | /// 170 | 171 | /** 172 | * ListFormsOptions Class. 173 | * 174 | **/ 175 | public class ListFormsOptions 176 | { 177 | private String userFilter = null; 178 | private Boolean isStandalone = null; 179 | private Boolean isPublished = null; 180 | private String sortBy = null; 181 | private String search = null; 182 | private String startPosition = null; 183 | private String count = null; 184 | 185 | /** 186 | * setUserFilter method. 187 | */ 188 | public void setUserFilter(String userFilter) { 189 | this.userFilter = userFilter; 190 | } 191 | 192 | /** 193 | * getUserFilter method. 194 | * 195 | * @return String 196 | */ 197 | public String getUserFilter() { 198 | return this.userFilter; 199 | } 200 | 201 | /** 202 | * setIsStandalone method. 203 | */ 204 | public void setIsStandalone(Boolean isStandalone) { 205 | this.isStandalone = isStandalone; 206 | } 207 | 208 | /** 209 | * getIsStandalone method. 210 | * 211 | * @return Boolean 212 | */ 213 | public Boolean getIsStandalone() { 214 | return this.isStandalone; 215 | } 216 | 217 | /** 218 | * setIsPublished method. 219 | */ 220 | public void setIsPublished(Boolean isPublished) { 221 | this.isPublished = isPublished; 222 | } 223 | 224 | /** 225 | * getIsPublished method. 226 | * 227 | * @return Boolean 228 | */ 229 | public Boolean getIsPublished() { 230 | return this.isPublished; 231 | } 232 | 233 | /** 234 | * setSortBy method. 235 | */ 236 | public void setSortBy(String sortBy) { 237 | this.sortBy = sortBy; 238 | } 239 | 240 | /** 241 | * getSortBy method. 242 | * 243 | * @return String 244 | */ 245 | public String getSortBy() { 246 | return this.sortBy; 247 | } 248 | 249 | /** 250 | * setSearch method. 251 | */ 252 | public void setSearch(String search) { 253 | this.search = search; 254 | } 255 | 256 | /** 257 | * getSearch method. 258 | * 259 | * @return String 260 | */ 261 | public String getSearch() { 262 | return this.search; 263 | } 264 | 265 | /** 266 | * setStartPosition method. 267 | */ 268 | public void setStartPosition(String startPosition) { 269 | this.startPosition = startPosition; 270 | } 271 | 272 | /** 273 | * getStartPosition method. 274 | * 275 | * @return String 276 | */ 277 | public String getStartPosition() { 278 | return this.startPosition; 279 | } 280 | 281 | /** 282 | * setCount method. 283 | */ 284 | public void setCount(String count) { 285 | this.count = count; 286 | } 287 | 288 | /** 289 | * getCount method. 290 | * 291 | * @return String 292 | */ 293 | public String getCount() { 294 | return this.count; 295 | } 296 | } 297 | 298 | /** 299 | * List Forms. 300 | * List all the forms for the active user that can be in an active or draft state 301 | * @param accountId Account identifier in which the webform resides (required) 302 | * @return WebFormSummaryList 303 | */ 304 | public WebFormSummaryList listForms(String accountId) throws ApiException { 305 | return listForms(accountId, null); 306 | } 307 | 308 | /** 309 | * List Forms. 310 | * List all the forms for the active user that can be in an active or draft state 311 | * @param accountId Account identifier in which the webform resides (required) 312 | * @param options for modifying the method behavior. 313 | * @return WebFormSummaryList 314 | * @throws ApiException if fails to make API call 315 | */ 316 | public WebFormSummaryList listForms(String accountId, FormManagementApi.ListFormsOptions options) throws ApiException { 317 | ApiResponse localVarResponse = listFormsWithHttpInfo(accountId, options); 318 | return localVarResponse.getData(); 319 | } 320 | 321 | /** 322 | * List Forms 323 | * List all the forms for the active user that can be in an active or draft state 324 | * @param accountId Account identifier in which the webform resides (required) 325 | * @param options for modifying the method behavior. 326 | * @return WebFormSummaryList 327 | * @throws ApiException if fails to make API call 328 | */ 329 | public ApiResponse listFormsWithHttpInfo(String accountId, FormManagementApi.ListFormsOptions options) throws ApiException { 330 | Object localVarPostBody = "{}"; 331 | 332 | // verify the required parameter 'accountId' is set 333 | if (accountId == null) { 334 | throw new ApiException(400, "Missing the required parameter 'accountId' when calling listForms"); 335 | } 336 | 337 | // create path and map variables 338 | String localVarPath = "/v1.1/accounts/{accountId}/forms" 339 | .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString())); 340 | 341 | // query params 342 | java.util.List localVarQueryParams = new java.util.ArrayList(); 343 | java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); 344 | java.util.Map localVarHeaderParams = new java.util.HashMap(); 345 | java.util.Map localVarFormParams = new java.util.HashMap(); 346 | 347 | if (options != null) { 348 | localVarQueryParams.addAll(apiClient.parameterToPair("user_filter", options.userFilter)); 349 | }if (options != null) { 350 | localVarQueryParams.addAll(apiClient.parameterToPair("is_standalone", options.isStandalone)); 351 | }if (options != null) { 352 | localVarQueryParams.addAll(apiClient.parameterToPair("is_published", options.isPublished)); 353 | }if (options != null) { 354 | localVarQueryParams.addAll(apiClient.parameterToPair("sort_by", options.sortBy)); 355 | }if (options != null) { 356 | localVarQueryParams.addAll(apiClient.parameterToPair("search", options.search)); 357 | }if (options != null) { 358 | localVarQueryParams.addAll(apiClient.parameterToPair("start_position", options.startPosition)); 359 | }if (options != null) { 360 | localVarQueryParams.addAll(apiClient.parameterToPair("count", options.count)); 361 | } 362 | 363 | 364 | 365 | 366 | 367 | final String[] localVarAccepts = { 368 | "application/json" 369 | }; 370 | final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 371 | 372 | final String[] localVarContentTypes = { 373 | "application/json" 374 | }; 375 | final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); 376 | 377 | String[] localVarAuthNames = new String[] { "docusignAccessCode" }; 378 | 379 | GenericType localVarReturnType = new GenericType() {}; 380 | WebFormSummaryList localVarResponse = apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); 381 | return new ApiResponse(apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse); 382 | } 383 | } 384 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/webforms/model/CreateInstanceRequestBody.java: -------------------------------------------------------------------------------- 1 | package com.docusign.webforms.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.webforms.model.AuthenticationMethod; 6 | import com.docusign.webforms.model.CreateInstanceRequestBodyRecipients; 7 | import com.docusign.webforms.model.SendOption; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | import com.fasterxml.jackson.annotation.JsonCreator; 10 | import com.fasterxml.jackson.annotation.JsonValue; 11 | import io.swagger.v3.oas.annotations.media.Schema; 12 | import java.io.Serializable; 13 | 14 | /** 15 | * Request body containing properties that will be used to create instance.. 16 | * 17 | */ 18 | @Schema(description = "Request body containing properties that will be used to create instance.") 19 | 20 | public class CreateInstanceRequestBody implements Serializable { 21 | private static final long serialVersionUID = 1L; 22 | 23 | @JsonProperty("formValues") 24 | private java.util.Map formValues = null; 25 | 26 | @JsonProperty("clientUserId") 27 | private String clientUserId = null; 28 | 29 | @JsonProperty("authenticationInstant") 30 | private String authenticationInstant = null; 31 | 32 | @JsonProperty("authenticationMethod") 33 | private AuthenticationMethod authenticationMethod = null; 34 | 35 | @JsonProperty("assertionId") 36 | private String assertionId = null; 37 | 38 | @JsonProperty("securityDomain") 39 | private String securityDomain = null; 40 | 41 | @JsonProperty("returnUrl") 42 | private String returnUrl = null; 43 | 44 | @JsonProperty("expirationOffset") 45 | private Integer expirationOffset = null; 46 | 47 | @JsonProperty("sendOption") 48 | private SendOption sendOption = null; 49 | 50 | @JsonProperty("brandId") 51 | private String brandId = null; 52 | 53 | @JsonProperty("recipients") 54 | private java.util.List recipients = null; 55 | 56 | @JsonProperty("tags") 57 | private java.util.List tags = null; 58 | 59 | 60 | /** 61 | * formValues. 62 | * 63 | * @return CreateInstanceRequestBody 64 | **/ 65 | public CreateInstanceRequestBody formValues(java.util.Map formValues) { 66 | this.formValues = formValues; 67 | return this; 68 | } 69 | 70 | /** 71 | * putFormValuesItem. 72 | * 73 | * @return CreateInstanceRequestBody 74 | **/ 75 | public CreateInstanceRequestBody putFormValuesItem(String key, Object formValuesItem) { 76 | if (this.formValues == null) { 77 | this.formValues = new java.util.HashMap<>(); 78 | } 79 | this.formValues.put(key, formValuesItem); 80 | return this; 81 | } 82 | 83 | /** 84 | * Key-value pairs (where key is the component name and value is the form value) used to create a form instance. For key of type TextBox, Email, Date, Select and RadioButtonGroup the value is of string type. For key of type Number, the value is of number type. For key of type of CheckboxGroup, the value is of type array of string.. 85 | * @return formValues 86 | **/ 87 | @Schema(example = "{\"Textbox_Name\":\"First Last\",\"Email_primary\":\"example@example.com\",\"Date_birth\":\"2020-01-01\",\"Number_age\":52,\"Select_state\":\"California\",\"Radio_Gender\":\"Female\",\"Checkbox_hobbies\":[\"singing\",\"dancing\"],\"ID_card_attachment\":{\"documentName\":\"id_card.pdf\"}}", description = "Key-value pairs (where key is the component name and value is the form value) used to create a form instance. For key of type TextBox, Email, Date, Select and RadioButtonGroup the value is of string type. For key of type Number, the value is of number type. For key of type of CheckboxGroup, the value is of type array of string.") 88 | public java.util.Map getFormValues() { 89 | return formValues; 90 | } 91 | 92 | /** 93 | * setFormValues. 94 | **/ 95 | public void setFormValues(java.util.Map formValues) { 96 | this.formValues = formValues; 97 | } 98 | 99 | 100 | /** 101 | * clientUserId. 102 | * 103 | * @return CreateInstanceRequestBody 104 | **/ 105 | public CreateInstanceRequestBody clientUserId(String clientUserId) { 106 | this.clientUserId = clientUserId; 107 | return this; 108 | } 109 | 110 | /** 111 | * Get clientUserId. 112 | * @return clientUserId 113 | **/ 114 | @Schema(description = "") 115 | public String getClientUserId() { 116 | return clientUserId; 117 | } 118 | 119 | /** 120 | * setClientUserId. 121 | **/ 122 | public void setClientUserId(String clientUserId) { 123 | this.clientUserId = clientUserId; 124 | } 125 | 126 | 127 | /** 128 | * authenticationInstant. 129 | * 130 | * @return CreateInstanceRequestBody 131 | **/ 132 | public CreateInstanceRequestBody authenticationInstant(String authenticationInstant) { 133 | this.authenticationInstant = authenticationInstant; 134 | return this; 135 | } 136 | 137 | /** 138 | * Get authenticationInstant. 139 | * @return authenticationInstant 140 | **/ 141 | @Schema(description = "") 142 | public String getAuthenticationInstant() { 143 | return authenticationInstant; 144 | } 145 | 146 | /** 147 | * setAuthenticationInstant. 148 | **/ 149 | public void setAuthenticationInstant(String authenticationInstant) { 150 | this.authenticationInstant = authenticationInstant; 151 | } 152 | 153 | 154 | /** 155 | * authenticationMethod. 156 | * 157 | * @return CreateInstanceRequestBody 158 | **/ 159 | public CreateInstanceRequestBody authenticationMethod(AuthenticationMethod authenticationMethod) { 160 | this.authenticationMethod = authenticationMethod; 161 | return this; 162 | } 163 | 164 | /** 165 | * Get authenticationMethod. 166 | * @return authenticationMethod 167 | **/ 168 | @Schema(description = "") 169 | public AuthenticationMethod getAuthenticationMethod() { 170 | return authenticationMethod; 171 | } 172 | 173 | /** 174 | * setAuthenticationMethod. 175 | **/ 176 | public void setAuthenticationMethod(AuthenticationMethod authenticationMethod) { 177 | this.authenticationMethod = authenticationMethod; 178 | } 179 | 180 | 181 | /** 182 | * assertionId. 183 | * 184 | * @return CreateInstanceRequestBody 185 | **/ 186 | public CreateInstanceRequestBody assertionId(String assertionId) { 187 | this.assertionId = assertionId; 188 | return this; 189 | } 190 | 191 | /** 192 | * Get assertionId. 193 | * @return assertionId 194 | **/ 195 | @Schema(description = "") 196 | public String getAssertionId() { 197 | return assertionId; 198 | } 199 | 200 | /** 201 | * setAssertionId. 202 | **/ 203 | public void setAssertionId(String assertionId) { 204 | this.assertionId = assertionId; 205 | } 206 | 207 | 208 | /** 209 | * securityDomain. 210 | * 211 | * @return CreateInstanceRequestBody 212 | **/ 213 | public CreateInstanceRequestBody securityDomain(String securityDomain) { 214 | this.securityDomain = securityDomain; 215 | return this; 216 | } 217 | 218 | /** 219 | * Get securityDomain. 220 | * @return securityDomain 221 | **/ 222 | @Schema(description = "") 223 | public String getSecurityDomain() { 224 | return securityDomain; 225 | } 226 | 227 | /** 228 | * setSecurityDomain. 229 | **/ 230 | public void setSecurityDomain(String securityDomain) { 231 | this.securityDomain = securityDomain; 232 | } 233 | 234 | 235 | /** 236 | * returnUrl. 237 | * 238 | * @return CreateInstanceRequestBody 239 | **/ 240 | public CreateInstanceRequestBody returnUrl(String returnUrl) { 241 | this.returnUrl = returnUrl; 242 | return this; 243 | } 244 | 245 | /** 246 | * Get returnUrl. 247 | * @return returnUrl 248 | **/ 249 | @Schema(description = "") 250 | public String getReturnUrl() { 251 | return returnUrl; 252 | } 253 | 254 | /** 255 | * setReturnUrl. 256 | **/ 257 | public void setReturnUrl(String returnUrl) { 258 | this.returnUrl = returnUrl; 259 | } 260 | 261 | 262 | /** 263 | * expirationOffset. 264 | * 265 | * @return CreateInstanceRequestBody 266 | **/ 267 | public CreateInstanceRequestBody expirationOffset(Integer expirationOffset) { 268 | this.expirationOffset = expirationOffset; 269 | return this; 270 | } 271 | 272 | /** 273 | * Get expirationOffset. 274 | * @return expirationOffset 275 | **/ 276 | @Schema(description = "") 277 | public Integer getExpirationOffset() { 278 | return expirationOffset; 279 | } 280 | 281 | /** 282 | * setExpirationOffset. 283 | **/ 284 | public void setExpirationOffset(Integer expirationOffset) { 285 | this.expirationOffset = expirationOffset; 286 | } 287 | 288 | 289 | /** 290 | * sendOption. 291 | * 292 | * @return CreateInstanceRequestBody 293 | **/ 294 | public CreateInstanceRequestBody sendOption(SendOption sendOption) { 295 | this.sendOption = sendOption; 296 | return this; 297 | } 298 | 299 | /** 300 | * Get sendOption. 301 | * @return sendOption 302 | **/ 303 | @Schema(description = "") 304 | public SendOption getSendOption() { 305 | return sendOption; 306 | } 307 | 308 | /** 309 | * setSendOption. 310 | **/ 311 | public void setSendOption(SendOption sendOption) { 312 | this.sendOption = sendOption; 313 | } 314 | 315 | 316 | /** 317 | * brandId. 318 | * 319 | * @return CreateInstanceRequestBody 320 | **/ 321 | public CreateInstanceRequestBody brandId(String brandId) { 322 | this.brandId = brandId; 323 | return this; 324 | } 325 | 326 | /** 327 | * Get brandId. 328 | * @return brandId 329 | **/ 330 | @Schema(description = "") 331 | public String getBrandId() { 332 | return brandId; 333 | } 334 | 335 | /** 336 | * setBrandId. 337 | **/ 338 | public void setBrandId(String brandId) { 339 | this.brandId = brandId; 340 | } 341 | 342 | 343 | /** 344 | * recipients. 345 | * 346 | * @return CreateInstanceRequestBody 347 | **/ 348 | public CreateInstanceRequestBody recipients(java.util.List recipients) { 349 | this.recipients = recipients; 350 | return this; 351 | } 352 | 353 | /** 354 | * addRecipientsItem. 355 | * 356 | * @return CreateInstanceRequestBody 357 | **/ 358 | public CreateInstanceRequestBody addRecipientsItem(CreateInstanceRequestBodyRecipients recipientsItem) { 359 | if (this.recipients == null) { 360 | this.recipients = new java.util.ArrayList<>(); 361 | } 362 | this.recipients.add(recipientsItem); 363 | return this; 364 | } 365 | 366 | /** 367 | * The recipients who will receive the form in email. 368 | * @return recipients 369 | **/ 370 | @Schema(description = "The recipients who will receive the form in email") 371 | public java.util.List getRecipients() { 372 | return recipients; 373 | } 374 | 375 | /** 376 | * setRecipients. 377 | **/ 378 | public void setRecipients(java.util.List recipients) { 379 | this.recipients = recipients; 380 | } 381 | 382 | 383 | /** 384 | * tags. 385 | * 386 | * @return CreateInstanceRequestBody 387 | **/ 388 | public CreateInstanceRequestBody tags(java.util.List tags) { 389 | this.tags = tags; 390 | return this; 391 | } 392 | 393 | /** 394 | * addTagsItem. 395 | * 396 | * @return CreateInstanceRequestBody 397 | **/ 398 | public CreateInstanceRequestBody addTagsItem(String tagsItem) { 399 | if (this.tags == null) { 400 | this.tags = new java.util.ArrayList<>(); 401 | } 402 | this.tags.add(tagsItem); 403 | return this; 404 | } 405 | 406 | /** 407 | * List of tags provided by the user with each request. This field is optional.. 408 | * @return tags 409 | **/ 410 | @Schema(example = "[\"loan_application\",\"finance_dept\"]", description = "List of tags provided by the user with each request. This field is optional.") 411 | public java.util.List getTags() { 412 | return tags; 413 | } 414 | 415 | /** 416 | * setTags. 417 | **/ 418 | public void setTags(java.util.List tags) { 419 | this.tags = tags; 420 | } 421 | 422 | 423 | /** 424 | * Compares objects. 425 | * 426 | * @return true or false depending on comparison result. 427 | */ 428 | @Override 429 | public boolean equals(java.lang.Object o) { 430 | if (this == o) { 431 | return true; 432 | } 433 | if (o == null || getClass() != o.getClass()) { 434 | return false; 435 | } 436 | CreateInstanceRequestBody createInstanceRequestBody = (CreateInstanceRequestBody) o; 437 | return Objects.equals(this.formValues, createInstanceRequestBody.formValues) && 438 | Objects.equals(this.clientUserId, createInstanceRequestBody.clientUserId) && 439 | Objects.equals(this.authenticationInstant, createInstanceRequestBody.authenticationInstant) && 440 | Objects.equals(this.authenticationMethod, createInstanceRequestBody.authenticationMethod) && 441 | Objects.equals(this.assertionId, createInstanceRequestBody.assertionId) && 442 | Objects.equals(this.securityDomain, createInstanceRequestBody.securityDomain) && 443 | Objects.equals(this.returnUrl, createInstanceRequestBody.returnUrl) && 444 | Objects.equals(this.expirationOffset, createInstanceRequestBody.expirationOffset) && 445 | Objects.equals(this.sendOption, createInstanceRequestBody.sendOption) && 446 | Objects.equals(this.brandId, createInstanceRequestBody.brandId) && 447 | Objects.equals(this.recipients, createInstanceRequestBody.recipients) && 448 | Objects.equals(this.tags, createInstanceRequestBody.tags); 449 | } 450 | 451 | /** 452 | * Returns the HashCode. 453 | */ 454 | @Override 455 | public int hashCode() { 456 | return Objects.hash(formValues, clientUserId, authenticationInstant, authenticationMethod, assertionId, securityDomain, returnUrl, expirationOffset, sendOption, brandId, recipients, tags); 457 | } 458 | 459 | 460 | /** 461 | * Converts the given object to string. 462 | */ 463 | @Override 464 | public String toString() { 465 | StringBuilder sb = new StringBuilder(); 466 | sb.append("class CreateInstanceRequestBody {\n"); 467 | 468 | sb.append(" formValues: ").append(toIndentedString(formValues)).append("\n"); 469 | sb.append(" clientUserId: ").append(toIndentedString(clientUserId)).append("\n"); 470 | sb.append(" authenticationInstant: ").append(toIndentedString(authenticationInstant)).append("\n"); 471 | sb.append(" authenticationMethod: ").append(toIndentedString(authenticationMethod)).append("\n"); 472 | sb.append(" assertionId: ").append(toIndentedString(assertionId)).append("\n"); 473 | sb.append(" securityDomain: ").append(toIndentedString(securityDomain)).append("\n"); 474 | sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).append("\n"); 475 | sb.append(" expirationOffset: ").append(toIndentedString(expirationOffset)).append("\n"); 476 | sb.append(" sendOption: ").append(toIndentedString(sendOption)).append("\n"); 477 | sb.append(" brandId: ").append(toIndentedString(brandId)).append("\n"); 478 | sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); 479 | sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); 480 | sb.append("}"); 481 | return sb.toString(); 482 | } 483 | 484 | /** 485 | * Convert the given object to string with each line indented by 4 spaces 486 | * (except the first line). 487 | */ 488 | private String toIndentedString(java.lang.Object o) { 489 | if (o == null) { 490 | return "null"; 491 | } 492 | return o.toString().replace("\n", "\n "); 493 | } 494 | 495 | } 496 | 497 | --------------------------------------------------------------------------------