├── .swagger-codegen └── VERSION ├── settings.gradle ├── src ├── test │ ├── manifest.mf │ ├── nbproject │ │ ├── genfiles.properties │ │ ├── project.xml │ │ └── project.properties │ ├── dist │ │ └── README.TXT │ ├── build.xml │ └── java │ │ └── SdkUnitTests.java └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── docusign │ └── monitor │ ├── client │ ├── auth │ │ ├── OAuthFlow.java │ │ ├── AccessTokenListener.java │ │ ├── Authentication.java │ │ ├── HttpBasicAuth.java │ │ ├── ApiKeyAuth.java │ │ ├── JWTUtils.java │ │ └── OAuth.java │ ├── RFC3339DateFormat.java │ ├── Configuration.java │ ├── Pair.java │ ├── ApiResponse.java │ ├── StringUtil.java │ ├── JSON.java │ └── ApiException.java │ ├── model │ ├── Filter.java │ ├── Aggregation.java │ ├── AggregateResult.java │ ├── DataSet.java │ ├── CursoredResult.java │ ├── AggregateResultResult.java │ ├── RawRequest.java │ └── WebQuery.java │ └── api │ └── DataSetApi.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── LICENSE ├── .swagger-codegen-ignore ├── CHANGELOG.md ├── stylesheets ├── github-light.css ├── stylesheet.css └── normalize.css ├── README.md ├── checkstyle.xml └── pom.xml /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 2.4.21-SNAPSHOT -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "docusign-monitor-java" -------------------------------------------------------------------------------- /src/test/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-monitor-java-client/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/auth/OAuthFlow.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.client.auth; 4 | 5 | /** 6 | * enum. 7 | * 8 | */ 9 | 10 | public enum OAuthFlow { 11 | accessCode, implicit, password, application 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/auth/AccessTokenListener.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.client.auth; 2 | 3 | import org.apache.oltu.oauth2.common.token.BasicOAuthToken; 4 | 5 | public interface AccessTokenListener { 6 | void notify(BasicOAuthToken token); 7 | } 8 | -------------------------------------------------------------------------------- /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 | # Mobile Tools for Java (J2ME) 2 | .mtj.tmp/ 3 | 4 | # Package Files # 5 | *.jar 6 | *.war 7 | *.ear 8 | 9 | # exclude jar for gradle wrapper 10 | !gradle/wrapper/*.jar 11 | 12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 13 | hs_err_pid* 14 | 15 | # build files 16 | **/target 17 | target 18 | .gradle 19 | build 20 | *.class 21 | .classpath 22 | .settings 23 | .project 24 | 25 | # others 26 | .idea/ 27 | *.iml 28 | .DS_Store -------------------------------------------------------------------------------- /src/test/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=f04d81fd 2 | build.xml.script.CRC32=1b83c451 3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=f04d81fd 7 | nbproject/build-impl.xml.script.CRC32=dcf6b1d8 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 9 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/auth/Authentication.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.client.auth; 4 | 5 | import com.docusign.monitor.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 | -------------------------------------------------------------------------------- /src/test/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | SdkTests 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.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-monitor-java-client/target/surefire-reports/SdkUnitTests.txt && cat /home/travis/build/docusign/docusign-monitor-java-client/target/surefire-reports/TEST-SdkUnitTests.xml" 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/RFC3339DateFormat.java: -------------------------------------------------------------------------------- 1 | 2 | package com.docusign.monitor.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/monitor/client/Configuration.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2016- 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 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # DocuSign Monitor Java Client Changelog 2 | See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes. 3 | 4 | ## [v1.4.0] - Monitor API v2.0-2.0.0 - 2023-06-14 5 | ### Changed 6 | - Added support for version v2.0-2.0.0 of the DocuSign Monitor API. 7 | - Updated the SDK release version. 8 | 9 | ## [v1.3.0] - Monitor API v2.0-1.1.0 - 2023-05-30 10 | ### Changed 11 | - Added support for version v2.0-1.1.0 of the DocuSign Monitor API. 12 | - Added support for Jakarta library integration 13 | - Updated the SDK release version. 14 | 15 | ## [v1.2.0] - Monitor API v2.0-1.1.0 - 2023-05-05 16 | ### Changed 17 | - Added support for version v2.0-1.1.0 of the DocuSign Monitor API. 18 | - Added support for Jakarta library integration 19 | - Updated the SDK release version. 20 | 21 | ## [v1.1.0] - Monitor API v2.0-1.1.0 - 2022-04-11 22 | ### Changed 23 | - Added support for version v2.0-1.1.0 of the DocuSign Monitor API. 24 | - Updated the SDK release version. 25 | 26 | ## [v1.0.0] - Monitor API v2.0-1.0.1 - 2021-06-28 27 | ### Added 28 | - Added first GA version of the DocuSign Monitor API. 29 | 30 | ## [v1.0.0-BETA] - Monitor API v2.0-1.0.1 - 2021-05-14 31 | ### Added 32 | - Added first beta version of the DocuSign Monitor API. 33 | -------------------------------------------------------------------------------- /src/test/dist/README.TXT: -------------------------------------------------------------------------------- 1 | ======================== 2 | BUILD OUTPUT DESCRIPTION 3 | ======================== 4 | 5 | When you build an Java application project that has a main class, the IDE 6 | automatically copies all of the JAR 7 | files on the projects classpath to your projects dist/lib folder. The IDE 8 | also adds each of the JAR files to the Class-Path element in the application 9 | JAR files manifest file (MANIFEST.MF). 10 | 11 | To run the project from the command line, go to the dist folder and 12 | type the following: 13 | 14 | java -jar "SdkTests.jar" 15 | 16 | To distribute this project, zip up the dist folder (including the lib folder) 17 | and distribute the ZIP file. 18 | 19 | Notes: 20 | 21 | * If two JAR files on the project classpath have the same name, only the first 22 | JAR file is copied to the lib folder. 23 | * Only JAR files are copied to the lib folder. 24 | If the classpath contains other types of files or folders, these files (folders) 25 | are not copied. 26 | * If a library on the projects classpath also has a Class-Path element 27 | specified in the manifest,the content of the Class-Path element has to be on 28 | the projects runtime path. 29 | * To set a main class in a standard Java project, right-click the project node 30 | in the Projects window and choose Properties. Then click Run and enter the 31 | class name in the Main Class field. Alternatively, you can manually type the 32 | class name in the manifest Main-Class element. 33 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/Pair.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.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/monitor/client/ApiResponse.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.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/monitor/client/StringUtil.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.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/monitor/client/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.client.auth; 4 | 5 | import com.docusign.monitor.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/monitor/model/Filter.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | 11 | /** 12 | * Filter 13 | */ 14 | 15 | public class Filter { 16 | @JsonProperty("filterName") 17 | private String filterName = null; 18 | 19 | /** 20 | * Get filterName 21 | * @return filterName 22 | **/ 23 | @Schema(description = "") 24 | public String getFilterName() { 25 | return filterName; 26 | } 27 | 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | Filter filter = (Filter) o; 38 | return Objects.equals(this.filterName, filter.filterName); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(filterName); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class Filter {\n"); 51 | 52 | sb.append(" filterName: ").append(toIndentedString(filterName)).append("\n"); 53 | sb.append("}"); 54 | return sb.toString(); 55 | } 56 | 57 | /** 58 | * Convert the given object to string with each line indented by 4 spaces 59 | * (except the first line). 60 | */ 61 | private String toIndentedString(java.lang.Object o) { 62 | if (o == null) { 63 | return "null"; 64 | } 65 | return o.toString().replace("\n", "\n "); 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/Aggregation.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | 11 | /** 12 | * Aggregation 13 | */ 14 | 15 | public class Aggregation { 16 | @JsonProperty("aggregationName") 17 | private String aggregationName = null; 18 | 19 | /** 20 | * Get aggregationName 21 | * @return aggregationName 22 | **/ 23 | @Schema(description = "") 24 | public String getAggregationName() { 25 | return aggregationName; 26 | } 27 | 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | Aggregation aggregation = (Aggregation) o; 38 | return Objects.equals(this.aggregationName, aggregation.aggregationName); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(aggregationName); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class Aggregation {\n"); 51 | 52 | sb.append(" aggregationName: ").append(toIndentedString(aggregationName)).append("\n"); 53 | sb.append("}"); 54 | return sb.toString(); 55 | } 56 | 57 | /** 58 | * Convert the given object to string with each line indented by 4 spaces 59 | * (except the first line). 60 | */ 61 | private String toIndentedString(java.lang.Object o) { 62 | if (o == null) { 63 | return "null"; 64 | } 65 | return o.toString().replace("\n", "\n "); 66 | } 67 | 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/JSON.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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/monitor/client/auth/ApiKeyAuth.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.client.auth; 4 | 5 | import com.docusign.monitor.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/monitor/model/AggregateResult.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.model; 2 | 3 | import java.util.Objects; 4 | import java.util.Arrays; 5 | import com.docusign.monitor.model.AggregateResultResult; 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 | * AggregateResult. 13 | * 14 | */ 15 | 16 | public class AggregateResult { 17 | @JsonProperty("result") 18 | private java.util.List result = null; 19 | 20 | 21 | /** 22 | * result. 23 | * 24 | * @return AggregateResult 25 | **/ 26 | public AggregateResult result(java.util.List result) { 27 | this.result = result; 28 | return this; 29 | } 30 | 31 | /** 32 | * addResultItem. 33 | * 34 | * @return AggregateResult 35 | **/ 36 | public AggregateResult addResultItem(AggregateResultResult resultItem) { 37 | if (this.result == null) { 38 | this.result = new java.util.ArrayList<>(); 39 | } 40 | this.result.add(resultItem); 41 | return this; 42 | } 43 | 44 | /** 45 | * Get result. 46 | * @return result 47 | **/ 48 | @Schema(description = "") 49 | public java.util.List getResult() { 50 | return result; 51 | } 52 | 53 | /** 54 | * setResult. 55 | **/ 56 | public void setResult(java.util.List result) { 57 | this.result = result; 58 | } 59 | 60 | 61 | /** 62 | * Compares objects. 63 | * 64 | * @return true or false depending on comparison result. 65 | */ 66 | @Override 67 | public boolean equals(java.lang.Object o) { 68 | if (this == o) { 69 | return true; 70 | } 71 | if (o == null || getClass() != o.getClass()) { 72 | return false; 73 | } 74 | AggregateResult aggregateResult = (AggregateResult) o; 75 | return Objects.equals(this.result, aggregateResult.result); 76 | } 77 | 78 | /** 79 | * Returns the HashCode. 80 | */ 81 | @Override 82 | public int hashCode() { 83 | return Objects.hash(result); 84 | } 85 | 86 | 87 | /** 88 | * Converts the given object to string. 89 | */ 90 | @Override 91 | public String toString() { 92 | StringBuilder sb = new StringBuilder(); 93 | sb.append("class AggregateResult {\n"); 94 | 95 | sb.append(" result: ").append(toIndentedString(result)).append("\n"); 96 | sb.append("}"); 97 | return sb.toString(); 98 | } 99 | 100 | /** 101 | * Convert the given object to string with each line indented by 4 spaces 102 | * (except the first line). 103 | */ 104 | private String toIndentedString(java.lang.Object o) { 105 | if (o == null) { 106 | return "null"; 107 | } 108 | return o.toString().replace("\n", "\n "); 109 | } 110 | 111 | } 112 | 113 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/DataSet.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | * Methods to fetch organization event data.. 12 | * 13 | */ 14 | @Schema(description = "Methods to fetch organization event data.") 15 | 16 | public class DataSet { 17 | @JsonProperty("endCursor") 18 | private String endCursor = null; 19 | 20 | @JsonProperty("data") 21 | private java.util.List data = null; 22 | 23 | 24 | /** 25 | * endCursor. 26 | * 27 | * @return DataSet 28 | **/ 29 | public DataSet endCursor(String endCursor) { 30 | this.endCursor = endCursor; 31 | return this; 32 | } 33 | 34 | /** 35 | * . 36 | * @return endCursor 37 | **/ 38 | @Schema(description = "") 39 | public String getEndCursor() { 40 | return endCursor; 41 | } 42 | 43 | /** 44 | * setEndCursor. 45 | **/ 46 | public void setEndCursor(String endCursor) { 47 | this.endCursor = endCursor; 48 | } 49 | 50 | 51 | /** 52 | * data. 53 | * 54 | * @return DataSet 55 | **/ 56 | public DataSet data(java.util.List data) { 57 | this.data = data; 58 | return this; 59 | } 60 | 61 | /** 62 | * addDataItem. 63 | * 64 | * @return DataSet 65 | **/ 66 | public DataSet addDataItem(Object dataItem) { 67 | if (this.data == null) { 68 | this.data = new java.util.ArrayList<>(); 69 | } 70 | this.data.add(dataItem); 71 | return this; 72 | } 73 | 74 | /** 75 | * . 76 | * @return data 77 | **/ 78 | @Schema(description = "") 79 | public java.util.List getData() { 80 | return data; 81 | } 82 | 83 | /** 84 | * setData. 85 | **/ 86 | public void setData(java.util.List data) { 87 | this.data = data; 88 | } 89 | 90 | 91 | /** 92 | * Compares objects. 93 | * 94 | * @return true or false depending on comparison result. 95 | */ 96 | @Override 97 | public boolean equals(java.lang.Object o) { 98 | if (this == o) { 99 | return true; 100 | } 101 | if (o == null || getClass() != o.getClass()) { 102 | return false; 103 | } 104 | DataSet dataSet = (DataSet) o; 105 | return Objects.equals(this.endCursor, dataSet.endCursor) && 106 | Objects.equals(this.data, dataSet.data); 107 | } 108 | 109 | /** 110 | * Returns the HashCode. 111 | */ 112 | @Override 113 | public int hashCode() { 114 | return Objects.hash(endCursor, data); 115 | } 116 | 117 | 118 | /** 119 | * Converts the given object to string. 120 | */ 121 | @Override 122 | public String toString() { 123 | StringBuilder sb = new StringBuilder(); 124 | sb.append("class DataSet {\n"); 125 | 126 | sb.append(" endCursor: ").append(toIndentedString(endCursor)).append("\n"); 127 | sb.append(" data: ").append(toIndentedString(data)).append("\n"); 128 | sb.append("}"); 129 | return sb.toString(); 130 | } 131 | 132 | /** 133 | * Convert the given object to string with each line indented by 4 spaces 134 | * (except the first line). 135 | */ 136 | private String toIndentedString(java.lang.Object o) { 137 | if (o == null) { 138 | return "null"; 139 | } 140 | return o.toString().replace("\n", "\n "); 141 | } 142 | 143 | } 144 | 145 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/CursoredResult.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | * . 12 | * 13 | */ 14 | @Schema(description = "") 15 | 16 | public class CursoredResult { 17 | @JsonProperty("endCursor") 18 | private String endCursor = null; 19 | 20 | @JsonProperty("data") 21 | private java.util.List data = null; 22 | 23 | 24 | /** 25 | * endCursor. 26 | * 27 | * @return CursoredResult 28 | **/ 29 | public CursoredResult endCursor(String endCursor) { 30 | this.endCursor = endCursor; 31 | return this; 32 | } 33 | 34 | /** 35 | * . 36 | * @return endCursor 37 | **/ 38 | @Schema(description = "") 39 | public String getEndCursor() { 40 | return endCursor; 41 | } 42 | 43 | /** 44 | * setEndCursor. 45 | **/ 46 | public void setEndCursor(String endCursor) { 47 | this.endCursor = endCursor; 48 | } 49 | 50 | 51 | /** 52 | * data. 53 | * 54 | * @return CursoredResult 55 | **/ 56 | public CursoredResult data(java.util.List data) { 57 | this.data = data; 58 | return this; 59 | } 60 | 61 | /** 62 | * addDataItem. 63 | * 64 | * @return CursoredResult 65 | **/ 66 | public CursoredResult addDataItem(Object dataItem) { 67 | if (this.data == null) { 68 | this.data = new java.util.ArrayList<>(); 69 | } 70 | this.data.add(dataItem); 71 | return this; 72 | } 73 | 74 | /** 75 | * . 76 | * @return data 77 | **/ 78 | @Schema(description = "") 79 | public java.util.List getData() { 80 | return data; 81 | } 82 | 83 | /** 84 | * setData. 85 | **/ 86 | public void setData(java.util.List data) { 87 | this.data = data; 88 | } 89 | 90 | 91 | /** 92 | * Compares objects. 93 | * 94 | * @return true or false depending on comparison result. 95 | */ 96 | @Override 97 | public boolean equals(java.lang.Object o) { 98 | if (this == o) { 99 | return true; 100 | } 101 | if (o == null || getClass() != o.getClass()) { 102 | return false; 103 | } 104 | CursoredResult cursoredResult = (CursoredResult) o; 105 | return Objects.equals(this.endCursor, cursoredResult.endCursor) && 106 | Objects.equals(this.data, cursoredResult.data); 107 | } 108 | 109 | /** 110 | * Returns the HashCode. 111 | */ 112 | @Override 113 | public int hashCode() { 114 | return Objects.hash(endCursor, data); 115 | } 116 | 117 | 118 | /** 119 | * Converts the given object to string. 120 | */ 121 | @Override 122 | public String toString() { 123 | StringBuilder sb = new StringBuilder(); 124 | sb.append("class CursoredResult {\n"); 125 | 126 | sb.append(" endCursor: ").append(toIndentedString(endCursor)).append("\n"); 127 | sb.append(" data: ").append(toIndentedString(data)).append("\n"); 128 | sb.append("}"); 129 | return sb.toString(); 130 | } 131 | 132 | /** 133 | * Convert the given object to string with each line indented by 4 spaces 134 | * (except the first line). 135 | */ 136 | private String toIndentedString(java.lang.Object o) { 137 | if (o == null) { 138 | return "null"; 139 | } 140 | return o.toString().replace("\n", "\n "); 141 | } 142 | 143 | } 144 | 145 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/AggregateResultResult.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | * AggregateResultResult. 12 | * 13 | */ 14 | 15 | public class AggregateResultResult { 16 | @JsonProperty("name") 17 | private String name = null; 18 | 19 | @JsonProperty("data") 20 | private java.util.List data = null; 21 | 22 | 23 | /** 24 | * name. 25 | * 26 | * @return AggregateResultResult 27 | **/ 28 | public AggregateResultResult name(String name) { 29 | this.name = name; 30 | return this; 31 | } 32 | 33 | /** 34 | * Get name. 35 | * @return name 36 | **/ 37 | @Schema(description = "") 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | /** 43 | * setName. 44 | **/ 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | 50 | /** 51 | * data. 52 | * 53 | * @return AggregateResultResult 54 | **/ 55 | public AggregateResultResult data(java.util.List data) { 56 | this.data = data; 57 | return this; 58 | } 59 | 60 | /** 61 | * addDataItem. 62 | * 63 | * @return AggregateResultResult 64 | **/ 65 | public AggregateResultResult addDataItem(Object dataItem) { 66 | if (this.data == null) { 67 | this.data = new java.util.ArrayList<>(); 68 | } 69 | this.data.add(dataItem); 70 | return this; 71 | } 72 | 73 | /** 74 | * Get data. 75 | * @return data 76 | **/ 77 | @Schema(description = "") 78 | public java.util.List getData() { 79 | return data; 80 | } 81 | 82 | /** 83 | * setData. 84 | **/ 85 | public void setData(java.util.List data) { 86 | this.data = data; 87 | } 88 | 89 | 90 | /** 91 | * Compares objects. 92 | * 93 | * @return true or false depending on comparison result. 94 | */ 95 | @Override 96 | public boolean equals(java.lang.Object o) { 97 | if (this == o) { 98 | return true; 99 | } 100 | if (o == null || getClass() != o.getClass()) { 101 | return false; 102 | } 103 | AggregateResultResult aggregateResultResult = (AggregateResultResult) o; 104 | return Objects.equals(this.name, aggregateResultResult.name) && 105 | Objects.equals(this.data, aggregateResultResult.data); 106 | } 107 | 108 | /** 109 | * Returns the HashCode. 110 | */ 111 | @Override 112 | public int hashCode() { 113 | return Objects.hash(name, data); 114 | } 115 | 116 | 117 | /** 118 | * Converts the given object to string. 119 | */ 120 | @Override 121 | public String toString() { 122 | StringBuilder sb = new StringBuilder(); 123 | sb.append("class AggregateResultResult {\n"); 124 | 125 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 126 | sb.append(" data: ").append(toIndentedString(data)).append("\n"); 127 | sb.append("}"); 128 | return sb.toString(); 129 | } 130 | 131 | /** 132 | * Convert the given object to string with each line indented by 4 spaces 133 | * (except the first line). 134 | */ 135 | private String toIndentedString(java.lang.Object o) { 136 | if (o == null) { 137 | return "null"; 138 | } 139 | return o.toString().replace("\n", "\n "); 140 | } 141 | 142 | } 143 | 144 | -------------------------------------------------------------------------------- /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/test/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project SdkTests. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Official DocuSign Monitor Java Client 2 | 3 | [![Build status][travis-image]][travis-url] 4 | [![Maven Central status][maven-image]][maven-url] 5 | 6 | ## Requirements 7 | 8 | - Java 1.9+ 9 | - Free [Developer Sandbox](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16531) 10 | 11 | ## Compatibility 12 | 13 | - Java 1.9+ 14 | 15 | ## Note 16 | 17 | This open-source SDK is provided for cases where you would like to make additional changes that the SDK does not 18 | provide out-of-the-box. If you simply want to use the SDK with any of the examples shown in the [Developer Center ](https://developers.docusign.com/monitor-api/code-examples), follow the installation instructions below. 19 | 20 | ## Installation 21 | 22 | Note: DocuSign uses **Eclipse** with **Maven** for testing purposes. 23 | 24 | ### Maven: 25 | 26 | 1. In Eclipse, create a new project by selecting **File** -> **New** -> **Project**. 27 | 2. In the **New Project Wizard** , expand **Maven** , then select **Maven Project.** 28 | 3. Leave **Create a simple project** unchecked. 29 | 4. Select **Next** , then provide a unique **Group** and **Artifact Id**. 30 | 5. In the directory where you've saved your project, open the _pom.xml_ file. 31 | 6. In the _pom.xml_ file, locate the **dependencies** node. 32 | 7. Add: 33 | 34 | ``` 35 | 36 | com.docusign 37 | docusign-monitor-java 38 | 1.1.0 39 | 40 | ``` 41 | 42 | 8. If your project is still open, restart **Eclipse**. 43 | 44 | ## Dependencies 45 | 46 | This client has the following external dependencies: 47 | 48 | - io.swagger:swagger-annotations:jar:1.5.17 49 | - org.glassfish.jersey.core:jersey-client:jar:2.29.1 50 | - org.glassfish.jersey.media:jersey-media-multipart:jar:2.29.1 51 | - org.glassfish.jersey.media:jersey-media-json-jackson:2.29.1 52 | - com.fasterxml.jackson.core:jackson-core:jar:2.10.1 53 | - com.fasterxml.jackson.core:jackson-annotations:jar:2.10.1 54 | - com.fasterxml.jackson.core:jackson-databind:2.10.1 55 | - com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.10.1 56 | - com.brsanthu:migbase64:2.2 57 | - junit:junit:jar:4.12 58 | - com.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2 59 | - com.auth0:java-jwt:3.4.1 60 | - org.bouncycastle:bcprov-jdk15on:1.60 61 | 62 | ## OAuth Implementations 63 | 64 | For details regarding which type of OAuth grant will work best for your DocuSign integration, see the [REST API 65 | Authentication Overview](https://developers.docusign.com/monitor-api/guides/auth) guide located on the [DocuSign Developer Center](https://developers.docusign.com/). 66 | 67 | For security purposes, DocuSign recommends using the Authorization Code Grant flow. 68 | 69 | ## Support 70 | 71 | Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi). 72 | 73 | ## License 74 | 75 | The DocuSign Java Client is licensed under the [MIT License](https://github.com/docusign/docusign-monitor-java-client/blob 76 | /master/LICENSE). 77 | 78 | 79 | [travis-image]: https://img.shields.io/travis/docusign/docusign-monitor-java-client.svg?style=flat 80 | [travis-url]: https://travis-ci.org/docusign/docusign-monitor-java-client 81 | [maven-image]: https://img.shields.io/maven-central/v/com.docusign/docusign-monitor-java.svg?style=flat 82 | [maven-url]: https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.docusign%22 83 | 84 | ### Additional Resources 85 | * [DocuSign Developer Center](https://developers.docusign.com) 86 | * [DocuSign API on Twitter](https://twitter.com/docusignapi) 87 | * [DocuSign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/) 88 | * [DocuSign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ) 89 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/RawRequest.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | 9 | import io.swagger.v3.oas.annotations.media.Schema; 10 | 11 | /** 12 | * RawRequest 13 | */ 14 | 15 | public class RawRequest { 16 | /** 17 | * Gets or Sets queryScope 18 | */ 19 | public enum QueryScopeEnum { 20 | ACCOUNTID("AccountId"), 21 | 22 | ORGANIZATIONID("OrganizationId"), 23 | 24 | NONE("None"); 25 | 26 | private String value; 27 | 28 | QueryScopeEnum(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 QueryScopeEnum fromValue(String text) { 44 | for (QueryScopeEnum b : QueryScopeEnum.values()) { 45 | if (String.valueOf(b.value).equals(text)) { 46 | return b; 47 | } 48 | } 49 | return null; 50 | } 51 | } 52 | 53 | @JsonProperty("queryScope") 54 | private QueryScopeEnum queryScope = null; 55 | 56 | @JsonProperty("queryScopeId") 57 | private java.util.UUID queryScopeId = null; 58 | 59 | @JsonProperty("query") 60 | private String query = null; 61 | 62 | public RawRequest queryScope(QueryScopeEnum queryScope) { 63 | this.queryScope = queryScope; 64 | return this; 65 | } 66 | 67 | /** 68 | * Get queryScope 69 | * @return queryScope 70 | **/ 71 | @Schema(description = "") 72 | public QueryScopeEnum getQueryScope() { 73 | return queryScope; 74 | } 75 | 76 | public void setQueryScope(QueryScopeEnum queryScope) { 77 | this.queryScope = queryScope; 78 | } 79 | 80 | public RawRequest queryScopeId(java.util.UUID queryScopeId) { 81 | this.queryScopeId = queryScopeId; 82 | return this; 83 | } 84 | 85 | /** 86 | * Get queryScopeId 87 | * @return queryScopeId 88 | **/ 89 | @Schema(description = "") 90 | public java.util.UUID getQueryScopeId() { 91 | return queryScopeId; 92 | } 93 | 94 | public void setQueryScopeId(java.util.UUID queryScopeId) { 95 | this.queryScopeId = queryScopeId; 96 | } 97 | 98 | public RawRequest query(String query) { 99 | this.query = query; 100 | return this; 101 | } 102 | 103 | /** 104 | * Get query 105 | * @return query 106 | **/ 107 | @Schema(description = "") 108 | public String getQuery() { 109 | return query; 110 | } 111 | 112 | public void setQuery(String query) { 113 | this.query = query; 114 | } 115 | 116 | 117 | @Override 118 | public boolean equals(java.lang.Object o) { 119 | if (this == o) { 120 | return true; 121 | } 122 | if (o == null || getClass() != o.getClass()) { 123 | return false; 124 | } 125 | RawRequest rawRequest = (RawRequest) o; 126 | return Objects.equals(this.queryScope, rawRequest.queryScope) && 127 | Objects.equals(this.queryScopeId, rawRequest.queryScopeId) && 128 | Objects.equals(this.query, rawRequest.query); 129 | } 130 | 131 | @Override 132 | public int hashCode() { 133 | return Objects.hash(queryScope, queryScopeId, query); 134 | } 135 | 136 | 137 | @Override 138 | public String toString() { 139 | StringBuilder sb = new StringBuilder(); 140 | sb.append("class RawRequest {\n"); 141 | 142 | sb.append(" queryScope: ").append(toIndentedString(queryScope)).append("\n"); 143 | sb.append(" queryScopeId: ").append(toIndentedString(queryScopeId)).append("\n"); 144 | sb.append(" query: ").append(toIndentedString(query)).append("\n"); 145 | sb.append("}"); 146 | return sb.toString(); 147 | } 148 | 149 | /** 150 | * Convert the given object to string with each line indented by 4 spaces 151 | * (except the first line). 152 | */ 153 | private String toIndentedString(java.lang.Object o) { 154 | if (o == null) { 155 | return "null"; 156 | } 157 | return o.toString().replace("\n", "\n "); 158 | } 159 | 160 | } 161 | 162 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/ApiException.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.monitor.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/test/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=SdkTests 7 | application.vendor=mike.roseleip 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.test.classpath=\ 23 | ${run.test.classpath} 24 | # Files in build.classes.dir which should be excluded from distribution jar 25 | dist.archive.excludes= 26 | # This directory is removed when the project is cleaned: 27 | dist.dir=dist 28 | dist.jar=${dist.dir}/SdkTests.jar 29 | dist.javadoc.dir=${dist.dir}/javadoc 30 | endorsed.classpath= 31 | excludes= 32 | file.reference.com.docusign.monitor-15.4.0.jar=../../sdk/target/com.docusign.monitor-15.4.0.jar 33 | file.reference.jackson-annotations-2.4.2.jar=../../sdk/target/lib/jackson-annotations-2.4.2.jar 34 | file.reference.jackson-core-2.4.2.jar=../../sdk/target/lib/jackson-core-2.4.2.jar 35 | file.reference.jackson-databind-2.4.2.jar=../../sdk/target/lib/jackson-databind-2.4.2.jar 36 | file.reference.jackson-datatype-joda-2.1.5.jar=../../sdk/target/lib/jackson-datatype-joda-2.1.5.jar 37 | file.reference.jackson-jaxrs-base-2.4.2.jar=../../sdk/target/lib/jackson-jaxrs-base-2.4.2.jar 38 | file.reference.jackson-jaxrs-json-provider-2.4.2.jar=../../sdk/target/lib/jackson-jaxrs-json-provider-2.4.2.jar 39 | file.reference.jackson-module-jaxb-annotations-2.4.2.jar=../../sdk/target/lib/jackson-module-jaxb-annotations-2.4.2.jar 40 | file.reference.jersey-client-1.18.jar=../../sdk/target/lib/jersey-client-1.18.jar 41 | file.reference.jersey-core-1.18.jar=../../sdk/target/lib/jersey-core-1.18.jar 42 | file.reference.jersey-multipart-1.18.jar=../../sdk/target/lib/jersey-multipart-1.18.jar 43 | file.reference.joda-time-2.3.jar=../../sdk/target/lib/joda-time-2.3.jar 44 | file.reference.junit-4.8.1.jar=../../sdk/target/lib/junit-4.8.1.jar 45 | file.reference.migbase64-2.2.jar=../../sdk/target/lib/migbase64-2.2.jar 46 | file.reference.mimepull-1.9.3.jar=../../sdk/target/lib/mimepull-1.9.3.jar 47 | includes=** 48 | jar.compress=false 49 | javac.classpath=\ 50 | ${file.reference.jackson-annotations-2.4.2.jar}:\ 51 | ${file.reference.jackson-core-2.4.2.jar}:\ 52 | ${file.reference.jackson-databind-2.4.2.jar}:\ 53 | ${file.reference.jackson-datatype-joda-2.1.5.jar}:\ 54 | ${file.reference.jersey-client-1.18.jar}:\ 55 | ${file.reference.jersey-core-1.18.jar}:\ 56 | ${file.reference.jersey-multipart-1.18.jar}:\ 57 | ${file.reference.joda-time-2.3.jar}:\ 58 | ${file.reference.junit-4.8.1.jar}:\ 59 | ${file.reference.mimepull-1.9.3.jar}:\ 60 | ${file.reference.jackson-jaxrs-base-2.4.2.jar}:\ 61 | ${file.reference.jackson-jaxrs-json-provider-2.4.2.jar}:\ 62 | ${file.reference.jackson-module-jaxb-annotations-2.4.2.jar}:\ 63 | ${file.reference.migbase64-2.2.jar}:\ 64 | ${file.reference.com.docusign.monitor-15.4.0.jar} 65 | # Space-separated list of extra javac options 66 | javac.compilerargs= 67 | javac.deprecation=false 68 | javac.processorpath=\ 69 | ${javac.classpath} 70 | javac.source=1.8 71 | javac.target=1.8 72 | javac.test.classpath=\ 73 | ${javac.classpath}:\ 74 | ${build.classes.dir}:\ 75 | ${libs.junit_4.classpath} 76 | javac.test.processorpath=\ 77 | ${javac.test.classpath} 78 | javadoc.additionalparam= 79 | javadoc.author=false 80 | javadoc.encoding=${source.encoding} 81 | javadoc.noindex=false 82 | javadoc.nonavbar=false 83 | javadoc.notree=false 84 | javadoc.private=false 85 | javadoc.splitindex=true 86 | javadoc.use=true 87 | javadoc.version=false 88 | javadoc.windowtitle= 89 | main.class= 90 | manifest.file=manifest.mf 91 | meta.inf.dir=${src.dir}/META-INF 92 | mkdist.disabled=false 93 | platform.active=default_platform 94 | run.classpath=\ 95 | ${javac.classpath}:\ 96 | ${build.classes.dir} 97 | # Space-separated list of JVM arguments used when running the project. 98 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 99 | # To set system properties for unit tests define test-sys-prop.name=value: 100 | run.jvmargs= 101 | run.test.classpath=\ 102 | ${javac.test.classpath}:\ 103 | ${build.test.classes.dir} 104 | source.encoding=UTF-8 105 | src.dir=src 106 | test.src.dir=test 107 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/model/WebQuery.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | * WebQuery. 12 | * 13 | */ 14 | 15 | public class WebQuery { 16 | @JsonProperty("filters") 17 | private java.util.List filters = null; 18 | 19 | @JsonProperty("aggregations") 20 | private java.util.List aggregations = null; 21 | 22 | /** 23 | * Gets or Sets queryScope 24 | */ 25 | public enum QueryScopeEnum { 26 | ORGANIZATIONID("OrganizationId"); 27 | 28 | private String value; 29 | 30 | QueryScopeEnum(String value) { 31 | this.value = value; 32 | } 33 | 34 | @JsonValue 35 | public String getValue() { 36 | return value; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return String.valueOf(value); 42 | } 43 | 44 | @JsonCreator 45 | public static QueryScopeEnum fromValue(String value) { 46 | for (QueryScopeEnum b : QueryScopeEnum.values()) { 47 | if (b.value.equals(value)) { 48 | return b; 49 | } 50 | } 51 | return null; 52 | } 53 | } 54 | 55 | @JsonProperty("queryScope") 56 | private QueryScopeEnum queryScope = null; 57 | 58 | @JsonProperty("queryScopeId") 59 | private String queryScopeId = null; 60 | 61 | 62 | /** 63 | * filters. 64 | * 65 | * @return WebQuery 66 | **/ 67 | public WebQuery filters(java.util.List filters) { 68 | this.filters = filters; 69 | return this; 70 | } 71 | 72 | /** 73 | * addFiltersItem. 74 | * 75 | * @return WebQuery 76 | **/ 77 | public WebQuery addFiltersItem(Object filtersItem) { 78 | if (this.filters == null) { 79 | this.filters = new java.util.ArrayList<>(); 80 | } 81 | this.filters.add(filtersItem); 82 | return this; 83 | } 84 | 85 | /** 86 | * Get filters. 87 | * @return filters 88 | **/ 89 | @Schema(description = "") 90 | public java.util.List getFilters() { 91 | return filters; 92 | } 93 | 94 | /** 95 | * setFilters. 96 | **/ 97 | public void setFilters(java.util.List filters) { 98 | this.filters = filters; 99 | } 100 | 101 | 102 | /** 103 | * aggregations. 104 | * 105 | * @return WebQuery 106 | **/ 107 | public WebQuery aggregations(java.util.List aggregations) { 108 | this.aggregations = aggregations; 109 | return this; 110 | } 111 | 112 | /** 113 | * addAggregationsItem. 114 | * 115 | * @return WebQuery 116 | **/ 117 | public WebQuery addAggregationsItem(Object aggregationsItem) { 118 | if (this.aggregations == null) { 119 | this.aggregations = new java.util.ArrayList<>(); 120 | } 121 | this.aggregations.add(aggregationsItem); 122 | return this; 123 | } 124 | 125 | /** 126 | * Get aggregations. 127 | * @return aggregations 128 | **/ 129 | @Schema(description = "") 130 | public java.util.List getAggregations() { 131 | return aggregations; 132 | } 133 | 134 | /** 135 | * setAggregations. 136 | **/ 137 | public void setAggregations(java.util.List aggregations) { 138 | this.aggregations = aggregations; 139 | } 140 | 141 | 142 | /** 143 | * queryScope. 144 | * 145 | * @return WebQuery 146 | **/ 147 | public WebQuery queryScope(QueryScopeEnum queryScope) { 148 | this.queryScope = queryScope; 149 | return this; 150 | } 151 | 152 | /** 153 | * Get queryScope. 154 | * @return queryScope 155 | **/ 156 | @Schema(description = "") 157 | public QueryScopeEnum getQueryScope() { 158 | return queryScope; 159 | } 160 | 161 | /** 162 | * setQueryScope. 163 | **/ 164 | public void setQueryScope(QueryScopeEnum queryScope) { 165 | this.queryScope = queryScope; 166 | } 167 | 168 | 169 | /** 170 | * queryScopeId. 171 | * 172 | * @return WebQuery 173 | **/ 174 | public WebQuery queryScopeId(String queryScopeId) { 175 | this.queryScopeId = queryScopeId; 176 | return this; 177 | } 178 | 179 | /** 180 | * Get queryScopeId. 181 | * @return queryScopeId 182 | **/ 183 | @Schema(description = "") 184 | public String getQueryScopeId() { 185 | return queryScopeId; 186 | } 187 | 188 | /** 189 | * setQueryScopeId. 190 | **/ 191 | public void setQueryScopeId(String queryScopeId) { 192 | this.queryScopeId = queryScopeId; 193 | } 194 | 195 | 196 | /** 197 | * Compares objects. 198 | * 199 | * @return true or false depending on comparison result. 200 | */ 201 | @Override 202 | public boolean equals(java.lang.Object o) { 203 | if (this == o) { 204 | return true; 205 | } 206 | if (o == null || getClass() != o.getClass()) { 207 | return false; 208 | } 209 | WebQuery webQuery = (WebQuery) o; 210 | return Objects.equals(this.filters, webQuery.filters) && 211 | Objects.equals(this.aggregations, webQuery.aggregations) && 212 | Objects.equals(this.queryScope, webQuery.queryScope) && 213 | Objects.equals(this.queryScopeId, webQuery.queryScopeId); 214 | } 215 | 216 | /** 217 | * Returns the HashCode. 218 | */ 219 | @Override 220 | public int hashCode() { 221 | return Objects.hash(filters, aggregations, queryScope, queryScopeId); 222 | } 223 | 224 | 225 | /** 226 | * Converts the given object to string. 227 | */ 228 | @Override 229 | public String toString() { 230 | StringBuilder sb = new StringBuilder(); 231 | sb.append("class WebQuery {\n"); 232 | 233 | sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); 234 | sb.append(" aggregations: ").append(toIndentedString(aggregations)).append("\n"); 235 | sb.append(" queryScope: ").append(toIndentedString(queryScope)).append("\n"); 236 | sb.append(" queryScopeId: ").append(toIndentedString(queryScopeId)).append("\n"); 237 | sb.append("}"); 238 | return sb.toString(); 239 | } 240 | 241 | /** 242 | * Convert the given object to string with each line indented by 4 spaces 243 | * (except the first line). 244 | */ 245 | private String toIndentedString(java.lang.Object o) { 246 | if (o == null) { 247 | return "null"; 248 | } 249 | return o.toString().replace("\n", "\n "); 250 | } 251 | 252 | } 253 | 254 | -------------------------------------------------------------------------------- /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/monitor/api/DataSetApi.java: -------------------------------------------------------------------------------- 1 | 2 | package com.docusign.monitor.api; 3 | 4 | import jakarta.ws.rs.core.GenericType; 5 | 6 | import com.docusign.monitor.client.ApiException; 7 | import com.docusign.monitor.client.ApiClient; 8 | import com.docusign.monitor.client.Configuration; 9 | import com.docusign.monitor.model.*; 10 | import com.docusign.monitor.client.Pair; 11 | import com.docusign.monitor.client.ApiResponse; 12 | 13 | 14 | 15 | 16 | /** 17 | * DataSetApi class. 18 | * 19 | **/ 20 | public class DataSetApi { 21 | private ApiClient apiClient; 22 | 23 | /** 24 | * DataSetApi. 25 | * 26 | **/ 27 | public DataSetApi() { 28 | this(Configuration.getDefaultApiClient()); 29 | } 30 | 31 | /** 32 | * DataSetApi. 33 | * 34 | **/ 35 | public DataSetApi(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 | /// Gets customer event data for an organization. Gets customer event data for the organization that owns the integration key. The results for this endpoint are paginated by event timestamp. Use the `cursor` parameter to specify where the query begins in the dataset. Use the `limit` parameter to set the number of records returned. 58 | /// 59 | 60 | /** 61 | * GetStreamOptions Class. 62 | * 63 | **/ 64 | public class GetStreamOptions 65 | { 66 | private String cursor = null; 67 | private Integer limit = null; 68 | 69 | /** 70 | * setCursor method. 71 | */ 72 | public void setCursor(String cursor) { 73 | this.cursor = cursor; 74 | } 75 | 76 | /** 77 | * getCursor method. 78 | * 79 | * @return String 80 | */ 81 | public String getCursor() { 82 | return this.cursor; 83 | } 84 | 85 | /** 86 | * setLimit method. 87 | */ 88 | public void setLimit(Integer limit) { 89 | this.limit = limit; 90 | } 91 | 92 | /** 93 | * getLimit method. 94 | * 95 | * @return Integer 96 | */ 97 | public Integer getLimit() { 98 | return this.limit; 99 | } 100 | } 101 | 102 | /** 103 | * Gets customer event data for an organization.. 104 | * Gets customer event data for the organization that owns the integration key. The results for this endpoint are paginated by event timestamp. Use the `cursor` parameter to specify where the query begins in the dataset. Use the `limit` parameter to set the number of records returned. 105 | * @param version Must be `2`. (required) 106 | * @param dataSetName Must be `monitor`. (required) 107 | * @return CursoredResult 108 | */ 109 | public CursoredResult getStream(String version, String dataSetName) throws ApiException { 110 | return getStream(version, dataSetName, null); 111 | } 112 | 113 | /** 114 | * Gets customer event data for an organization.. 115 | * Gets customer event data for the organization that owns the integration key. The results for this endpoint are paginated by event timestamp. Use the `cursor` parameter to specify where the query begins in the dataset. Use the `limit` parameter to set the number of records returned. 116 | * @param version Must be `2`. (required) 117 | * @param dataSetName Must be `monitor`. (required) 118 | * @param options for modifying the method behavior. 119 | * @return CursoredResult 120 | * @throws ApiException if fails to make API call 121 | */ 122 | public CursoredResult getStream(String version, String dataSetName, DataSetApi.GetStreamOptions options) throws ApiException { 123 | ApiResponse localVarResponse = getStreamWithHttpInfo(version, dataSetName, options); 124 | return localVarResponse.getData(); 125 | } 126 | 127 | /** 128 | * Gets customer event data for an organization. 129 | * Gets customer event data for the organization that owns the integration key. The results for this endpoint are paginated by event timestamp. Use the `cursor` parameter to specify where the query begins in the dataset. Use the `limit` parameter to set the number of records returned. 130 | * @param version Must be `2`. (required) 131 | * @param dataSetName Must be `monitor`. (required) 132 | * @param options for modifying the method behavior. 133 | * @return CursoredResult 134 | * @throws ApiException if fails to make API call 135 | */ 136 | public ApiResponse getStreamWithHttpInfo(String version, String dataSetName, DataSetApi.GetStreamOptions options) throws ApiException { 137 | Object localVarPostBody = "{}"; 138 | 139 | // verify the required parameter 'version' is set 140 | if (version == null) { 141 | throw new ApiException(400, "Missing the required parameter 'version' when calling getStream"); 142 | } 143 | 144 | // verify the required parameter 'dataSetName' is set 145 | if (dataSetName == null) { 146 | throw new ApiException(400, "Missing the required parameter 'dataSetName' when calling getStream"); 147 | } 148 | 149 | // create path and map variables 150 | String localVarPath = "/api/v{version}/datasets/{dataSetName}/stream" 151 | .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())) 152 | .replaceAll("\\{" + "dataSetName" + "\\}", apiClient.escapeString(dataSetName.toString())); 153 | 154 | // query params 155 | java.util.List localVarQueryParams = new java.util.ArrayList(); 156 | java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); 157 | java.util.Map localVarHeaderParams = new java.util.HashMap(); 158 | java.util.Map localVarFormParams = new java.util.HashMap(); 159 | 160 | if (options != null) { 161 | localVarQueryParams.addAll(apiClient.parameterToPair("cursor", options.cursor)); 162 | }if (options != null) { 163 | localVarQueryParams.addAll(apiClient.parameterToPair("limit", options.limit)); 164 | } 165 | 166 | 167 | 168 | 169 | 170 | final String[] localVarAccepts = { 171 | "application/json" 172 | }; 173 | final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); 174 | 175 | final String[] localVarContentTypes = { 176 | "application/json" 177 | }; 178 | final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); 179 | 180 | String[] localVarAuthNames = new String[] { }; 181 | 182 | GenericType localVarReturnType = new GenericType() {}; 183 | CursoredResult localVarResponse = apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); 184 | return new ApiResponse(apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse); 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /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/test/java/SdkUnitTests.java: -------------------------------------------------------------------------------- 1 | import com.docusign.monitor.api.*; 2 | import com.docusign.monitor.client.*; 3 | import com.docusign.monitor.client.auth.OAuth; 4 | import com.docusign.monitor.client.auth.OAuth.UserInfo; 5 | 6 | import com.docusign.monitor.model.CursoredResult; 7 | import org.junit.*; 8 | import org.junit.runners.MethodSorters; 9 | 10 | //import java.awt.*; 11 | //import java.net.URI; 12 | import java.util.ArrayList; 13 | 14 | import com.migcomponents.migbase64.Base64; 15 | 16 | import jakarta.ws.rs.core.UriBuilderException; 17 | 18 | /** 19 | * 20 | * @author majid.mallis 21 | */ 22 | @FixMethodOrder(MethodSorters.NAME_ASCENDING) 23 | public class SdkUnitTests { 24 | 25 | //private static final String UserName = System.getenv("USER_NAME"); 26 | private static final String UserId = System.getenv("USER_ID"); 27 | private static final String IntegratorKey = System.getenv("INTEGRATOR_KEY_JWT"); 28 | //private static final String IntegratorKeyImplicit = System.getenv("INTEGRATOR_KEY_IMPLICIT"); 29 | //private static final String ClientSecret = System.getenv("CLIENT_SECRET"); 30 | //private static final String RedirectURI = System.getenv("REDIRECT_URI"); 31 | 32 | private static final String BaseUrl = ApiClient.DEMO_REST_BASEPATH; 33 | //private static final String OAuthBaseUrl = OAuth.DEMO_OAUTH_BASEPATH; 34 | private static final byte[] privateKeyBytes = Base64.decode(System.getenv("PRIVATE_KEY")); 35 | // JUnit 4.12 runs test cases in parallel, so the envelope ID needs to be initiated as well. 36 | 37 | // private JSON json = new JSON(); 38 | 39 | public SdkUnitTests() { 40 | } 41 | 42 | @BeforeClass 43 | public static void setUpClass() { 44 | } 45 | 46 | @AfterClass 47 | public static void tearDownClass() { 48 | } 49 | 50 | @After 51 | public void tearDown() { 52 | } 53 | 54 | // The methods must be annotated with annotation @Test. For example: 55 | // 56 | @Test 57 | public void JWTLoginTest() { 58 | System.out.println("\nJWTLoginTest:\n" + "==========================================="); 59 | ApiClient apiClient = new ApiClient(BaseUrl); 60 | //String currentDir = System.getenv("user.dir"); 61 | 62 | try { 63 | java.util.List scopes = new ArrayList(); 64 | scopes.add(OAuth.Scope_SIGNATURE); 65 | scopes.add(OAuth.Scope_IMPERSONATION); 66 | 67 | // IMPORTANT NOTE: 68 | // the first time you ask for a JWT access token, you should grant access by making the following call 69 | // get DocuSign OAuth authorization url: 70 | //String oauthLoginUrl = apiClient.getJWTUri(IntegratorKey, RedirectURI, OAuthBaseUrl, scopes); 71 | // open DocuSign OAuth authorization url in the browser, login and grant access 72 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); 73 | // END OF NOTE 74 | 75 | OAuth.OAuthToken oAuthToken = apiClient.requestJWTUserToken(IntegratorKey, UserId, scopes, privateKeyBytes, 3600); 76 | Assert.assertNotSame(null, oAuthToken); 77 | // now that the API client has an OAuth token, let's use it in all 78 | // DocuSign APIs 79 | apiClient.setAccessToken(oAuthToken.getAccessToken(), oAuthToken.getExpiresIn()); 80 | UserInfo userInfo = apiClient.getUserInfo(oAuthToken.getAccessToken()); 81 | Assert.assertNotSame(null, userInfo); 82 | Assert.assertNotNull(userInfo.getAccounts()); 83 | Assert.assertTrue(userInfo.getAccounts().size() > 0); 84 | 85 | System.out.println("UserInfo: " + userInfo); 86 | Configuration.setDefaultApiClient(apiClient); 87 | } catch (ApiException ex) { 88 | Assert.fail("Exception: " + ex); 89 | } catch (Exception e) { 90 | Assert.fail("Exception: " + e.getLocalizedMessage()); 91 | } 92 | } 93 | 94 | @Test 95 | public void AuthorizationCodeLoginTest() { 96 | System.out.println("\nAuthorizationCodeLoginTest:\n" + "==========================================="); 97 | ApiClient apiClient = new ApiClient(BaseUrl); 98 | try { 99 | // after successful login you should compare the value of URI decoded "state" query param 100 | // with the one you create here; they should match. 101 | java.util.List scopes = new ArrayList(); 102 | scopes.add(OAuth.Scope_SIGNATURE); 103 | scopes.add(OAuth.Scope_IMPERSONATION); 104 | // get DocuSign OAuth authorization url 105 | //URI oauthLoginUrl = apiClient.getAuthorizationUri(IntegratorKey, scopes, RedirectURI, OAuth.CODE, null); 106 | // open DocuSign OAuth login in the browser 107 | //Desktop.getDesktop().browse(oauthLoginUrl); 108 | // IMPORTANT: after the login, DocuSign will send back a fresh 109 | // authorization code as a query param of the redirect URI. 110 | // You should set up a route that handles the redirect call to get 111 | // that code and pass it to token endpoint as shown in the next 112 | // lines: 113 | /*String code = ""; 114 | OAuth.OAuthToken oAuthToken = apiClient.generateAccessToken(IntegratorKey, ClientSecret, code); 115 | Assert.assertNotSame(null, oAuthToken); 116 | Assert.assertNotNull(oAuthToken.getAccessToken()); 117 | Assert.assertTrue(oAuthToken.getExpiresIn() > 0L); 118 | 119 | // now that the API client has an OAuth token, let's use it in all 120 | // DocuSign APIs 121 | apiClient.setAccessToken(oAuthToken.getAccessToken(), oAuthToken.getExpiresIn()); 122 | UserInfo userInfo = apiClient.getUserInfo(oAuthToken.getAccessToken()); 123 | Assert.assertNotSame(null, userInfo); 124 | Assert.assertNotNull(userInfo.getAccounts()); 125 | Assert.assertTrue(userInfo.getAccounts().size() > 0); 126 | 127 | System.out.println("UserInfo: " + userInfo); 128 | Configuration.setDefaultApiClient(apiClient); 129 | } catch (ApiException ex) { 130 | Assert.fail("Exception: " + ex);*/ 131 | } catch (Exception e) { 132 | Assert.fail("Exception: " + e.getLocalizedMessage()); 133 | } 134 | } 135 | 136 | @Test 137 | public void ImplicitLoginTest() { 138 | System.out.println("\nImplicitLoginTest:\n" + "==========================================="); 139 | //ApiClient apiClient = new ApiClient(BaseUrl); 140 | try { 141 | // after successful login you should compare the value of URI decoded "state" query param 142 | // with the one you create here; they should match. 143 | //String randomState = "*^.$DGj*)+}Jk"; 144 | java.util.List scopes = new ArrayList(); 145 | scopes.add(OAuth.Scope_SIGNATURE); 146 | scopes.add(OAuth.Scope_IMPERSONATION); 147 | // get DocuSign OAuth authorization url 148 | //URI oAuthLoginUri = apiClient.getAuthorizationUri(IntegratorKeyImplicit, scopes, RedirectURI, OAuth.TOKEN, randomState); 149 | // open DocuSign OAuth login in the browser 150 | //Desktop.getDesktop().browse(oAuthLoginUri); 151 | // IMPORTANT: after the login, DocuSign will send back a new 152 | // access token in the hash fragment of the redirect URI. 153 | // You should set up a client-side handler that handles window.location change to get 154 | // that token and pass it to the ApiClient object as shown in the next 155 | // lines: 156 | //String token = ""; 157 | // now that the API client has an OAuth token, let's use it in all 158 | // DocuSign APIs 159 | /*apiClient.setAccessToken(oAuthToken.getAccessToken(), oAuthToken.getExpiresIn()); 160 | UserInfo userInfo = apiClient.getUserInfo(token); 161 | Assert.assertNotSame(null, userInfo); 162 | Assert.assertNotNull(userInfo.getAccounts()); 163 | Assert.assertTrue(userInfo.getAccounts().size() > 0); 164 | 165 | System.out.println("UserInfo: " + userInfo); 166 | Configuration.setDefaultApiClient(apiClient);*/ 167 | } catch (UriBuilderException ex) { 168 | System.out.println("UriBuilderException: " + ex); 169 | } catch (Exception e) { 170 | Assert.fail("Exception: " + e.getLocalizedMessage()); 171 | } 172 | } 173 | 174 | @Test 175 | public void GetStreamTest() { 176 | System.out.println("\nGetStreamTest:\n" + "==========================================="); 177 | ApiClient apiClient = new ApiClient(BaseUrl); 178 | //String currentDir = System.getProperty("user.dir"); 179 | 180 | try { 181 | // IMPORTANT NOTE: 182 | // the first time you ask for a JWT access token, you should grant access by making the following call 183 | // get DocuSign OAuth authorization url: 184 | //String oauthLoginUrl = apiClient.getJWTUri(IntegratorKey, RedirectURI, OAuthBaseUrl); 185 | // open DocuSign OAuth authorization url in the browser, login and grant access 186 | //Desktop.getDesktop().browse(URI.create(oauthLoginUrl)); 187 | // END OF NOTE 188 | 189 | java.util.List scopes = new ArrayList(); 190 | scopes.add(OAuth.Scope_SIGNATURE); 191 | scopes.add(OAuth.Scope_IMPERSONATION); 192 | 193 | OAuth.OAuthToken oAuthToken = apiClient.requestJWTUserToken(IntegratorKey, UserId, scopes, privateKeyBytes, 3600); 194 | Assert.assertNotSame(null, oAuthToken); 195 | // now that the API client has an OAuth token, let's use it in all 196 | // DocuSign APIs 197 | apiClient.setAccessToken(oAuthToken.getAccessToken(), oAuthToken.getExpiresIn()); 198 | 199 | UserInfo userInfo = apiClient.getUserInfo(oAuthToken.getAccessToken()); 200 | Assert.assertNotSame(null, userInfo); 201 | Assert.assertNotNull(userInfo.getAccounts()); 202 | Assert.assertTrue(userInfo.getAccounts().size() > 0); 203 | 204 | System.out.println("UserInfo: " + userInfo); 205 | 206 | Configuration.setDefaultApiClient(apiClient); 207 | 208 | DataSetApi dataSetApi = new DataSetApi(); 209 | String dataSetName = "monitor"; 210 | String version = "2.0"; 211 | CursoredResult cursoredResult = dataSetApi.getStream(version, dataSetName); 212 | Assert.assertNotNull(cursoredResult.getData()); 213 | 214 | System.out.println("CursoredResult - first row: " + cursoredResult.getData().get(0)); 215 | } catch (ApiException ex) { 216 | Assert.fail("ApiException: " + ex.getLocalizedMessage()); 217 | } catch (Exception e) { 218 | e.printStackTrace(); 219 | Assert.fail("Exception: " + e.getLocalizedMessage()); 220 | } 221 | } 222 | } -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/auth/JWTUtils.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.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 | -------------------------------------------------------------------------------- /checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 71 | 72 | 73 | 75 | 76 | 77 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 123 | 125 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 172 | 173 | 174 | 176 | 178 | 179 | 180 | 181 | 183 | 184 | 185 | 186 | 188 | 189 | 190 | 191 | 193 | 194 | 195 | 196 | 198 | 199 | 200 | 201 | 203 | 204 | 205 | 206 | 208 | 209 | 210 | 211 | 213 | 214 | 215 | 216 | 218 | 219 | 220 | 221 | 223 | 225 | 227 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 249 | 250 | 251 | 253 | 254 | 255 | 256 | 261 | 262 | 263 | 264 | 268 | 269 | 270 | 271 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 285 | 286 | 287 | 288 | 289 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 308 | 309 | 310 | 311 | 312 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 325 | 326 | 327 | 328 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.docusign 5 | docusign-monitor-java 6 | jar 7 | docusign-monitor-java 8 | 1.4.0 9 | https://developers.docusign.com 10 | The official DocuSign Monitor Java client provides libraries for Java application integration with DocuSign Monitor for real estate and mortgage workflows. It is recommended that you use this version of the library for new development. 11 | 12 | 13 | 2.2.0 14 | 15 | 16 | 17 | 18 | ossrh 19 | https://s01.oss.sonatype.org/content/repositories/snapshots 20 | 21 | 22 | ossrh2 23 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ 24 | 25 | 26 | 27 | 28 | scm:git:git@github.com:docusign/docusign-monitor-java-client.git 29 | scm:git:git@github.com:docusign/docusign-monitor-java-client.git 30 | git@github.com:docusign/docusign-monitor-java-client.git 31 | 32 | 33 | 34 | 35 | DocuSign Monitor Java Client License 36 | https://raw.githubusercontent.com/docusign/docusign-monitor-java-client/master/LICENSE 37 | repo 38 | 39 | 40 | 41 | 42 | 43 | DocuSign Developer Center 44 | devcenter@docusign.com 45 | DocuSign 46 | https://developers.docusign.com 47 | 48 | 49 | 50 | 51 | 52 | 53 | com.diffplug.spotless 54 | spotless-maven-plugin 55 | 2.12.1 56 | 57 | 58 | 59 | 60 | src/main/java/**/*.java 61 | src/test/java/**/*.java 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 1.7 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | apply 78 | 79 | compile 80 | 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-checkstyle-plugin 86 | 3.1.2 87 | 88 | ${project.basedir}/checkstyle.xml 89 | 90 | 91 | 92 | 93 | checkstyle 94 | 95 | compile 96 | 97 | 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-enforcer-plugin 102 | 3.0.0-M1 103 | 104 | 105 | enforce-maven 106 | 107 | enforce 108 | 109 | 110 | 111 | 112 | 2.2.0 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | org.apache.maven.plugins 121 | maven-surefire-plugin 122 | 3.0.0-M3 123 | 124 | alphabetical 125 | -Xms512m -Xmx1500m 126 | methods 127 | true 128 | 1 129 | false 130 | 1 131 | false 132 | 133 | **/*Tests.java 134 | 135 | 136 | 137 | 138 | org.apache.maven.surefire 139 | surefire-junit47 140 | 3.0.0-M3 141 | 142 | 143 | 144 | 145 | maven-dependency-plugin 146 | 147 | 148 | package 149 | 150 | copy-dependencies 151 | 152 | 153 | ${project.build.directory}/lib 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | org.apache.maven.plugins 162 | maven-jar-plugin 163 | 3.1.1 164 | 165 | 166 | 167 | test-jar 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | org.codehaus.mojo 177 | build-helper-maven-plugin 178 | 1.10 179 | 180 | 181 | add_sources 182 | generate-sources 183 | 184 | add-source 185 | 186 | 187 | 188 | 189 | src/main/java 190 | 191 | 192 | 193 | 194 | add_test_sources 195 | generate-test-sources 196 | 197 | add-test-source 198 | 199 | 200 | 201 | 202 | src/test/java 203 | 204 | 205 | 206 | 207 | 208 | 209 | org.apache.maven.plugins 210 | maven-compiler-plugin 211 | 3.6.1 212 | 213 | 1.8 214 | 1.8 215 | 216 | 217 | 218 | org.apache.maven.plugins 219 | maven-javadoc-plugin 220 | 2.10.4 221 | 222 | 223 | attach-javadocs 224 | 225 | jar 226 | 227 | 228 | 229 | 230 | 231 | org.apache.maven.plugins 232 | maven-source-plugin 233 | 2.2.1 234 | 235 | 236 | attach-sources 237 | 238 | jar-no-fork 239 | 240 | 241 | 242 | 243 | 244 | org.apache.maven.plugins 245 | maven-shade-plugin 246 | 3.3.0 247 | 248 | 249 | package 250 | 251 | shade 252 | 253 | 254 | true 255 | shaded 256 | 257 | 258 | junit:junit:jar: 259 | org.hamcrest:hamcrest-core:jar 260 | 261 | 262 | 263 | 264 | *:* 265 | 266 | META-INF/*.SF 267 | META-INF/*.DSA 268 | META-INF/*.RSA 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | org.apache.maven.plugins 278 | maven-gpg-plugin 279 | 1.5 280 | 281 | 282 | sign-artifacts 283 | verify 284 | 285 | sign 286 | 287 | 288 | 289 | 290 | 291 | --pinentry-mode 292 | loopback 293 | 294 | 295 | 296 | 297 | org.sonatype.plugins 298 | nexus-staging-maven-plugin 299 | 1.6.8 300 | 301 | ossrh 302 | https://s01.oss.sonatype.org/ 303 | true 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | io.swagger.core.v3 312 | swagger-annotations 313 | ${swagger-core-version} 314 | 315 | 316 | 317 | 318 | org.glassfish.jersey.core 319 | jersey-client 320 | ${jersey-version} 321 | 322 | 323 | org.glassfish.jersey.media 324 | jersey-media-multipart 325 | ${jersey-version} 326 | 327 | 328 | org.glassfish.jersey.media 329 | jersey-media-json-jackson 330 | ${jersey-version} 331 | 332 | 333 | org.glassfish.jersey.inject 334 | jersey-hk2 335 | ${jersey-version} 336 | 337 | 338 | 339 | com.fasterxml.jackson.jakarta.rs 340 | jackson-jakarta-rs-base 341 | ${jackson-version} 342 | 343 | 344 | org.apache.oltu.oauth2 345 | org.apache.oltu.oauth2.client 346 | ${oltu-version} 347 | 348 | 349 | 350 | com.auth0 351 | java-jwt 352 | 3.4.1 353 | 354 | 355 | org.bouncycastle 356 | bcprov-jdk15on 357 | 1.69 358 | 359 | 360 | com.fasterxml.jackson.dataformat 361 | jackson-dataformat-csv 362 | ${jackson-version} 363 | 364 | 365 | com.fasterxml.jackson.datatype 366 | jackson-datatype-jsr310 367 | ${jackson-version} 368 | 369 | 370 | 371 | junit 372 | junit 373 | ${junit-version} 374 | test 375 | 376 | 377 | com.brsanthu 378 | migbase64 379 | 2.2 380 | compile 381 | 382 | 383 | jakarta.ws.rs 384 | jakarta.ws.rs-api 385 | 3.1.0 386 | compile 387 | 388 | 389 | com.brsanthu 390 | migbase64 391 | 2.2 392 | 393 | 394 | 395 | UTF-8 396 | 2.2.8 397 | 3.0.9 398 | 2.14.2 399 | 4.13.1 400 | 1.0.2 401 | 402 | 403 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/monitor/client/auth/OAuth.java: -------------------------------------------------------------------------------- 1 | package com.docusign.monitor.client.auth; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | import java.util.Objects; 6 | 7 | import jakarta.ws.rs.client.ClientBuilder; 8 | import jakarta.ws.rs.core.Response; 9 | 10 | import com.docusign.monitor.client.ApiException; 11 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 12 | import org.apache.oltu.oauth2.client.OAuthClient; 13 | import org.apache.oltu.oauth2.client.URLConnectionClient; 14 | import org.apache.oltu.oauth2.client.request.OAuthClientRequest; 15 | import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; 16 | import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; 17 | import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; 18 | import org.apache.oltu.oauth2.common.message.types.GrantType; 19 | import org.apache.oltu.oauth2.common.token.BasicOAuthToken; 20 | 21 | import com.docusign.monitor.client.Pair; 22 | import com.fasterxml.jackson.annotation.JsonProperty; 23 | import jakarta.ws.rs.client.Client; 24 | 25 | import io.swagger.v3.oas.annotations.media.Schema; 26 | 27 | /** 28 | * OAuth class. 29 | * 30 | */ 31 | public class OAuth implements Authentication { 32 | static final int MILLIS_PER_SECOND = 1000; 33 | 34 | // OAuth Scope constants 35 | /** create and send envelopes, and obtain links for starting signing sessions. */ 36 | public final static String Scope_SIGNATURE = "signature"; 37 | /** obtain a refresh token with an extended lifetime. */ 38 | public final static String Scope_EXTENDED = "extended"; 39 | /** obtain access to the user’s account when the user is not present. */ 40 | public final static String Scope_IMPERSONATION = "impersonation"; 41 | 42 | // OAuth ResponseType constants 43 | /** used by public/native client applications. */ 44 | public final static String CODE = "code"; 45 | /** used by private/trusted client application. */ 46 | public final static String TOKEN = "token"; 47 | 48 | // OAuth base path constants 49 | /** live/production base path. */ 50 | public final static String PRODUCTION_OAUTH_BASEPATH = "account.docusign.com"; 51 | /** sandbox/demo base path. */ 52 | public final static String DEMO_OAUTH_BASEPATH = "account-d.docusign.com"; 53 | /** stage base path. */ 54 | public final static String STAGE_OAUTH_BASEPATH = "account-s.docusign.com"; 55 | 56 | // OAuth grant types 57 | /** JWT grant type. */ 58 | public final static String GRANT_TYPE_JWT = "urn:ietf:params:oauth:grant-type:jwt-bearer"; 59 | 60 | private volatile String accessToken; 61 | private Long expirationTimeMillis; 62 | private OAuthClient oauthClient; 63 | private TokenRequestBuilder tokenRequestBuilder; 64 | private AuthenticationRequestBuilder authenticationRequestBuilder; 65 | private AccessTokenListener accessTokenListener; 66 | 67 | /** 68 | * OAuth constructor. 69 | * 70 | */ 71 | public OAuth() { 72 | this(null, null, null); 73 | } 74 | 75 | /** 76 | * OAuth constructor. 77 | * 78 | * @param client The client to use 79 | * @param tokenRequestBuilder The request builder 80 | * @param authenticationRequestBuilder The auth request builder 81 | */ 82 | public OAuth(Client client, TokenRequestBuilder tokenRequestBuilder, AuthenticationRequestBuilder authenticationRequestBuilder) { 83 | this.oauthClient = new OAuthClient(new URLConnectionClient()); 84 | this.tokenRequestBuilder = tokenRequestBuilder; 85 | this.authenticationRequestBuilder = authenticationRequestBuilder; 86 | } 87 | 88 | /** 89 | * OAuth constructor. 90 | * 91 | * @param client The client to use 92 | * @param flow The OAuth flow 93 | * @param authorizationUrl The auth url 94 | * @param tokenUrl The token URL 95 | * @param scopes The scopes to use 96 | */ 97 | public OAuth(Client client, OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { 98 | this(client, OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes), OAuthClientRequest.authorizationLocation(authorizationUrl).setScope(scopes)); 99 | 100 | switch (flow) { 101 | case accessCode: 102 | tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); 103 | authenticationRequestBuilder.setResponseType(OAuth.CODE); 104 | break; 105 | case implicit: 106 | tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); 107 | authenticationRequestBuilder.setResponseType(OAuth.TOKEN); 108 | break; 109 | case password: 110 | tokenRequestBuilder.setGrantType(GrantType.PASSWORD); 111 | break; 112 | case application: 113 | tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); 114 | break; 115 | default: 116 | break; 117 | } 118 | } 119 | 120 | /** 121 | * OAuth constructor. 122 | * 123 | * @param flow The OAuth flow 124 | * @param authorizationUrl The auth url 125 | * @param tokenUrl The token URL 126 | * @param scopes The scopes to use 127 | */ 128 | public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { 129 | this(ClientBuilder.newBuilder().build(), flow, authorizationUrl, tokenUrl, scopes); 130 | } 131 | 132 | /** 133 | * applyToParams method. 134 | * 135 | * @param queryParams The query params 136 | * @param headerParams The header params 137 | */ 138 | @Override 139 | public void applyToParams(List queryParams, Map headerParams) { 140 | // If first time, get the token 141 | if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { 142 | try { 143 | updateAccessToken(); 144 | } catch (ApiException e) { 145 | accessToken = null; 146 | } 147 | } 148 | if (accessToken != null) { 149 | headerParams.put("Authorization", "Bearer " + accessToken); 150 | } 151 | } 152 | 153 | /** 154 | * updateAccessToken method. 155 | * 156 | */ 157 | public synchronized void updateAccessToken() throws ApiException { 158 | OAuthJSONAccessTokenResponse accessTokenResponse; 159 | try { 160 | accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); 161 | } catch (Exception e) { 162 | throw new ApiException(e.getMessage()); 163 | } 164 | if (accessTokenResponse != null) 165 | { 166 | // FIXME: This does not work in case of non HTTP 200 :-( oauthClient needs to return the plain HTTP resonse 167 | if (accessTokenResponse.getResponseCode() != Response.Status.OK.getStatusCode()) 168 | { 169 | throw new ApiException("Error while requesting an access token, received HTTP code: " + accessTokenResponse.getResponseCode()); 170 | } 171 | 172 | if (accessTokenResponse.getAccessToken() == null) { 173 | throw new ApiException("Error while requesting an access token. No 'access_token' found."); 174 | } 175 | if (accessTokenResponse.getExpiresIn() == null) { 176 | throw new ApiException("Error while requesting an access token. No 'expires_in' found."); 177 | } 178 | 179 | setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); 180 | if (this.accessTokenListener != null) { 181 | this.accessTokenListener.notify((BasicOAuthToken)accessTokenResponse.getOAuthToken()); 182 | } 183 | } else { 184 | // in case of HTTP error codes accessTokenResponse is null, thus no check of accessTokenResponse.getResponseCode() possible :-( 185 | throw new ApiException("Error while requesting an access token. No accessTokenResponse object recieved, maybe a non HTTP 200 received?"); 186 | } 187 | } 188 | 189 | /** 190 | * registerAccessTokenListener method. 191 | * 192 | * @param accessTokenListener The access token listener 193 | */ 194 | public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { 195 | this.accessTokenListener = accessTokenListener; 196 | } 197 | 198 | /** 199 | * getAccessToken method. 200 | * 201 | * @return String 202 | */ 203 | public synchronized String getAccessToken() { 204 | return accessToken; 205 | } 206 | 207 | public synchronized void setAccessToken(String accessToken, Long expiresIn) { 208 | this.accessToken = accessToken; 209 | this.expirationTimeMillis = System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; 210 | } 211 | 212 | public TokenRequestBuilder getTokenRequestBuilder() { 213 | return tokenRequestBuilder; 214 | } 215 | 216 | public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { 217 | this.tokenRequestBuilder = tokenRequestBuilder; 218 | } 219 | 220 | public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { 221 | return authenticationRequestBuilder; 222 | } 223 | 224 | public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { 225 | this.authenticationRequestBuilder = authenticationRequestBuilder; 226 | } 227 | 228 | public OAuthClient getOauthClient() { 229 | return oauthClient; 230 | } 231 | 232 | public void setOauthClient(OAuthClient oauthClient) { 233 | this.oauthClient = oauthClient; 234 | } 235 | 236 | public void setOauthClient(Client client) { 237 | this.oauthClient = new OAuthClient(new URLConnectionClient()); 238 | } 239 | 240 | /** 241 | * 242 | * OAuthToken model with the following properties. 243 | *
accessToken: the token you will use in the Authorization header of calls to the DocuSign API. 244 | *
tokenType: this is the type of the accessToken. It is usually "Bearer". 245 | *
refreshToken: a token you can use to get a new accessToken without requiring user interaction. 246 | *
expiresIn: the number of seconds before the accessToken expires. 247 | * 248 | */ 249 | @JsonIgnoreProperties(ignoreUnknown = true) 250 | public static class OAuthToken { 251 | @JsonProperty("access_token") 252 | private String accessToken = null; 253 | 254 | @JsonProperty("token_type") 255 | private String tokenType = null; 256 | 257 | @JsonProperty("refresh_token") 258 | private String refreshToken = null; 259 | 260 | @JsonProperty("expires_in") 261 | private Long expiresIn = 0L; 262 | 263 | public OAuthToken accessToken(String accessToken) { 264 | this.accessToken = accessToken; 265 | return this; 266 | } 267 | 268 | /** 269 | * Get accessToken. 270 | * 271 | * @return accessToken 272 | **/ 273 | @Schema(example = "null", description = "") 274 | public String getAccessToken() { 275 | return accessToken; 276 | } 277 | 278 | public void setAccessToken(String accessToken) { 279 | this.accessToken = accessToken; 280 | } 281 | 282 | public OAuthToken isTokenType(String tokenType) { 283 | this.tokenType = tokenType; 284 | return this; 285 | } 286 | 287 | /** 288 | * Get tokenType. 289 | * 290 | * @return tokenType 291 | **/ 292 | @Schema(example = "null", description = "") 293 | public String getTokenType() { 294 | return tokenType; 295 | } 296 | 297 | public void setTokenType(String tokenType) { 298 | this.tokenType = tokenType; 299 | } 300 | 301 | public OAuthToken refreshToken(String refreshToken) { 302 | this.refreshToken = refreshToken; 303 | return this; 304 | } 305 | 306 | /** 307 | * Get refreshToken. 308 | * 309 | * @return refreshToken 310 | **/ 311 | @Schema(example = "null", description = "") 312 | public String getRefreshToken() { 313 | return refreshToken; 314 | } 315 | 316 | public void setRefreshToken(String refreshToken) { 317 | this.refreshToken = refreshToken; 318 | } 319 | 320 | public OAuthToken expiresIn(Long expiresIn) { 321 | this.expiresIn = expiresIn; 322 | return this; 323 | } 324 | 325 | /** 326 | * Get expiresIn. 327 | * 328 | * @return expiresIn 329 | **/ 330 | @Schema(example = "3600L", description = "0L") 331 | public Long getExpiresIn() { 332 | return expiresIn; 333 | } 334 | 335 | public void setExpiresIn(Long expiresIn) { 336 | this.expiresIn = expiresIn; 337 | } 338 | 339 | @Override 340 | public boolean equals(java.lang.Object o) { 341 | if (this == o) { 342 | return true; 343 | } 344 | if (o == null || getClass() != o.getClass()) { 345 | return false; 346 | } 347 | OAuthToken oAuthToken = (OAuthToken) o; 348 | return Objects.equals(this.accessToken, oAuthToken.accessToken) 349 | && Objects.equals(this.tokenType, oAuthToken.tokenType) 350 | && Objects.equals(this.refreshToken, oAuthToken.refreshToken) 351 | && Objects.equals(this.expiresIn, oAuthToken.expiresIn); 352 | } 353 | 354 | @Override 355 | public int hashCode() { 356 | return Objects.hash(accessToken, tokenType, refreshToken, expiresIn); 357 | } 358 | 359 | @Override 360 | public String toString() { 361 | StringBuilder sb = new StringBuilder(); 362 | sb.append("class OAuthToken {\n"); 363 | 364 | sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); 365 | sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); 366 | sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); 367 | sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); 368 | return sb.toString(); 369 | } 370 | 371 | /** 372 | * Convert the given object to string with each line indented by 4 373 | * spaces (except the first line). 374 | */ 375 | private String toIndentedString(java.lang.Object o) { 376 | if (o == null) { 377 | return "null"; 378 | } 379 | return o.toString().replace("\n", "\n "); 380 | } 381 | } 382 | 383 | /** 384 | * 385 | * Link model with the below properties. 386 | *
rel: currently the only value is "self". 387 | *
href: the direct link of the organization. 388 | * 389 | */ 390 | @JsonIgnoreProperties(ignoreUnknown = true) 391 | public static class Link { 392 | @JsonProperty("rel") 393 | private String rel = null; 394 | 395 | @JsonProperty("href") 396 | private String href = null; 397 | 398 | public Link rel(String rel) { 399 | this.rel = rel; 400 | return this; 401 | } 402 | 403 | /** 404 | * Get rel. 405 | * 406 | * @return rel 407 | **/ 408 | @Schema(example = "null", description = "") 409 | public String getRel() { 410 | return rel; 411 | } 412 | 413 | public void setRel(String rel) { 414 | this.rel = rel; 415 | } 416 | 417 | public Link href(String href) { 418 | this.href = href; 419 | return this; 420 | } 421 | 422 | /** 423 | * Get href. 424 | * 425 | * @return href 426 | **/ 427 | @Schema(example = "null", description = "") 428 | public String getHref() { 429 | return href; 430 | } 431 | 432 | public void setHref(String href) { 433 | this.href = href; 434 | } 435 | 436 | @Override 437 | public boolean equals(java.lang.Object o) { 438 | if (this == o) { 439 | return true; 440 | } 441 | if (o == null || getClass() != o.getClass()) { 442 | return false; 443 | } 444 | Link link = (Link) o; 445 | return Objects.equals(this.rel, link.rel) 446 | && Objects.equals(this.href, link.href); 447 | } 448 | 449 | @Override 450 | public int hashCode() { 451 | return Objects.hash(rel, href); 452 | } 453 | 454 | @Override 455 | public String toString() { 456 | StringBuilder sb = new StringBuilder(); 457 | sb.append("class Link {\n"); 458 | 459 | sb.append(" rel: ").append(toIndentedString(rel)).append("\n"); 460 | sb.append(" href: ").append(toIndentedString(href)).append("\n"); 461 | return sb.toString(); 462 | } 463 | 464 | /** 465 | * Convert the given object to string with each line indented by 4 466 | * spaces (except the first line). 467 | */ 468 | private String toIndentedString(java.lang.Object o) { 469 | if (o == null) { 470 | return "null"; 471 | } 472 | return o.toString().replace("\n", "\n "); 473 | } 474 | } 475 | 476 | /** 477 | * 478 | * Organization model with the below properties. 479 | *
organizationId: the organization ID GUID if DocuSign Org Admin is enabled. 480 | *
links: this is list of organization direct links associated with the DocuSign account. 481 | * 482 | */ 483 | @JsonIgnoreProperties(ignoreUnknown = true) 484 | public static class Organization { 485 | @JsonProperty("organization_id") 486 | private String organizationId = null; 487 | 488 | @JsonProperty("links") 489 | private java.util.List links = new java.util.ArrayList(); 490 | 491 | public Organization organizationId(String organizationId) { 492 | this.organizationId = organizationId; 493 | return this; 494 | } 495 | 496 | /** 497 | * Get organizationId. 498 | * 499 | * @return organizationId 500 | **/ 501 | @Schema(example = "null", description = "") 502 | public String getOrganizationId() { 503 | return organizationId; 504 | } 505 | 506 | public void setOrganizationId(String organizationId) { 507 | this.organizationId = organizationId; 508 | } 509 | 510 | public Organization links(java.util.List links) { 511 | this.links = links; 512 | return this; 513 | } 514 | 515 | public Organization addLinksItem(Link linksItem) { 516 | this.links.add(linksItem); 517 | return this; 518 | } 519 | 520 | /** 521 | * Get links. 522 | * 523 | * @return links 524 | **/ 525 | @Schema(example = "null", description = "") 526 | public java.util.List getLinks() { 527 | return links; 528 | } 529 | 530 | public void setLinks(java.util.List links) { 531 | this.links = links; 532 | } 533 | 534 | @Override 535 | public boolean equals(java.lang.Object o) { 536 | if (this == o) { 537 | return true; 538 | } 539 | if (o == null || getClass() != o.getClass()) { 540 | return false; 541 | } 542 | Organization organization = (Organization) o; 543 | return Objects.equals(this.organizationId, organization.organizationId) 544 | && Objects.equals(this.links, organization.links); 545 | } 546 | 547 | @Override 548 | public int hashCode() { 549 | return Objects.hash(organizationId, links); 550 | } 551 | 552 | @Override 553 | public String toString() { 554 | StringBuilder sb = new StringBuilder(); 555 | sb.append("class Organization {\n"); 556 | 557 | sb.append(" organizationId: ").append(toIndentedString(organizationId)).append("\n"); 558 | sb.append(" links: ").append(toIndentedString(links)).append("\n"); 559 | return sb.toString(); 560 | } 561 | 562 | /** 563 | * Convert the given object to string with each line indented by 4 564 | * spaces (except the first line). 565 | */ 566 | private String toIndentedString(java.lang.Object o) { 567 | if (o == null) { 568 | return "null"; 569 | } 570 | return o.toString().replace("\n", "\n "); 571 | } 572 | } 573 | 574 | /** 575 | * 576 | * Account model with the below properties. 577 | *
accountId: the account ID GUID. 578 | *
isDefault: whether this is the default account, when the user has access to multiple accounts. 579 | *
accountName: the human-readable name of the account. 580 | *
baseUri: the base URI associated with this account. 581 | * It also tells which DocuSign data center the account is hosted on. 582 | *
organization: If DocuSign Org Admin is enabled on this account, 583 | * this property contains the organization information. 584 | * 585 | */ 586 | @JsonIgnoreProperties(ignoreUnknown = true) 587 | public static class Account { 588 | @JsonProperty("account_id") 589 | private String accountId = null; 590 | 591 | @JsonProperty("is_default") 592 | private String isDefault = null; 593 | 594 | @JsonProperty("account_name") 595 | private String accountName = null; 596 | 597 | @JsonProperty("base_uri") 598 | private String baseUri = null; 599 | 600 | @JsonProperty("organization") 601 | private Organization organization = new Organization(); 602 | 603 | public Account accountId(String accountId) { 604 | this.accountId = accountId; 605 | return this; 606 | } 607 | 608 | /** 609 | * Get accountId. 610 | * 611 | * @return accountId 612 | **/ 613 | @Schema(example = "null", description = "") 614 | public String getAccountId() { 615 | return accountId; 616 | } 617 | 618 | public void setAccountId(String accountId) { 619 | this.accountId = accountId; 620 | } 621 | 622 | public Account isDefault(String isDefault) { 623 | this.isDefault = isDefault; 624 | return this; 625 | } 626 | 627 | /** 628 | * Get isDefault. 629 | * 630 | * @return isDefault 631 | **/ 632 | @Schema(example = "null", description = "") 633 | public String getIsDefault() { 634 | return isDefault; 635 | } 636 | 637 | public void setIsDefault(String isDefault) { 638 | this.isDefault = isDefault; 639 | } 640 | 641 | public Account accountName(String accountName) { 642 | this.accountName = accountName; 643 | return this; 644 | } 645 | 646 | /** 647 | * Get accountName. 648 | * 649 | * @return accountName 650 | **/ 651 | @Schema(example = "null", description = "") 652 | public String getAccountName() { 653 | return accountName; 654 | } 655 | 656 | public void setAccountName(String accountName) { 657 | this.accountName = accountName; 658 | } 659 | 660 | public Account baseUri(String baseUri) { 661 | this.baseUri = baseUri; 662 | return this; 663 | } 664 | 665 | /** 666 | * Get baseUri. 667 | * 668 | * @return baseUri 669 | **/ 670 | @Schema(example = "null", description = "") 671 | public String getBaseUri() { 672 | return baseUri; 673 | } 674 | 675 | public void setBaseUri(String baseUri) { 676 | this.baseUri = baseUri; 677 | } 678 | 679 | public Account organization(Organization organization) { 680 | this.organization = organization; 681 | return this; 682 | } 683 | 684 | /** 685 | * Get organization. 686 | * 687 | * @return organization 688 | **/ 689 | @Schema(example = "null", description = "") 690 | public Organization getOrganization() { 691 | return organization; 692 | } 693 | 694 | public void setOrganization(Organization organization) { 695 | this.organization = organization; 696 | } 697 | 698 | @Override 699 | public boolean equals(java.lang.Object o) { 700 | if (this == o) { 701 | return true; 702 | } 703 | if (o == null || getClass() != o.getClass()) { 704 | return false; 705 | } 706 | Account account = (Account) o; 707 | return Objects.equals(this.accountId, account.accountId) 708 | && Objects.equals(this.isDefault, account.isDefault) 709 | && Objects.equals(this.accountName, account.accountName) 710 | && Objects.equals(this.baseUri, account.baseUri) 711 | && Objects.equals(this.organization, account.organization); 712 | } 713 | 714 | @Override 715 | public int hashCode() { 716 | return Objects.hash(accountId, isDefault, accountName, baseUri, organization); 717 | } 718 | 719 | @Override 720 | public String toString() { 721 | StringBuilder sb = new StringBuilder(); 722 | sb.append("class Account {\n"); 723 | 724 | sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); 725 | sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); 726 | sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); 727 | sb.append(" baseUri: ").append(toIndentedString(baseUri)).append("\n"); 728 | sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); 729 | return sb.toString(); 730 | } 731 | 732 | /** 733 | * Convert the given object to string with each line indented by 4 734 | * spaces (except the first line). 735 | */ 736 | private String toIndentedString(java.lang.Object o) { 737 | if (o == null) { 738 | return "null"; 739 | } 740 | return o.toString().replace("\n", "\n "); 741 | } 742 | } 743 | 744 | /** 745 | * 746 | * UserInfo model with the below properties. 747 | *
sub: the user ID GUID. 748 | *
accounts: this is list of DocuSign accounts associated with the current user. 749 | *
name: the user's full name. 750 | *
givenName: the user's given name. 751 | *
familyName: the user's family name. 752 | *
email: the user's email address. 753 | *
created: the UTC DateTime when the user login was created. 754 | * 755 | * @see Account 756 | * 757 | */ 758 | @JsonIgnoreProperties(ignoreUnknown = true) 759 | public static class UserInfo { 760 | 761 | @JsonProperty("sub") 762 | private String sub = null; 763 | 764 | @JsonProperty("email") 765 | private String email = null; 766 | 767 | @JsonProperty("accounts") 768 | private java.util.List accounts = new java.util.ArrayList(); 769 | 770 | @JsonProperty("name") 771 | private String name = null; 772 | 773 | @JsonProperty("given_name") 774 | private String givenName = null; 775 | 776 | @JsonProperty("family_name") 777 | private String familyName = null; 778 | 779 | @JsonProperty("created") 780 | private String created = null; 781 | 782 | public UserInfo sub(String sub) { 783 | this.sub = sub; 784 | return this; 785 | } 786 | 787 | /** 788 | * Get sub. 789 | * 790 | * @return sub 791 | **/ 792 | @Schema(example = "null", description = "") 793 | public String getSub() { 794 | return sub; 795 | } 796 | 797 | public void setSub(String sub) { 798 | this.sub = sub; 799 | } 800 | 801 | public UserInfo email(String email) { 802 | this.email = email; 803 | return this; 804 | } 805 | 806 | /** 807 | * Get email. 808 | * 809 | * @return email 810 | **/ 811 | @Schema(example = "null", description = "") 812 | public String getEmail() { 813 | return email; 814 | } 815 | 816 | public void setEmail(String email) { 817 | this.email = email; 818 | } 819 | 820 | public UserInfo accounts(java.util.List accounts) { 821 | this.accounts = accounts; 822 | return this; 823 | } 824 | 825 | public UserInfo addAccountsItem(Account accountsItem) { 826 | this.accounts.add(accountsItem); 827 | return this; 828 | } 829 | 830 | /** 831 | * Get accounts. 832 | * 833 | * @return accounts 834 | **/ 835 | @Schema(example = "null", description = "") 836 | public java.util.List getAccounts() { 837 | return accounts; 838 | } 839 | 840 | public void setAccounts(java.util.List accounts) { 841 | this.accounts = accounts; 842 | } 843 | 844 | public UserInfo name(String name) { 845 | this.name = name; 846 | return this; 847 | } 848 | 849 | /** 850 | * Get name. 851 | * 852 | * @return name 853 | **/ 854 | @Schema(example = "null", description = "") 855 | public String getName() { 856 | return name; 857 | } 858 | 859 | public void setName(String name) { 860 | this.name = name; 861 | } 862 | 863 | public UserInfo givenName(String givenName) { 864 | this.givenName = givenName; 865 | return this; 866 | } 867 | 868 | /** 869 | * Get givenName. 870 | * 871 | * @return givenName 872 | **/ 873 | @Schema(example = "null", description = "") 874 | public String getGivenName() { 875 | return givenName; 876 | } 877 | 878 | public void setGivenName(String givenName) { 879 | this.givenName = givenName; 880 | } 881 | 882 | public UserInfo familyName(String familyName) { 883 | this.familyName = familyName; 884 | return this; 885 | } 886 | 887 | /** 888 | * Get familyName. 889 | * 890 | * @return familyName 891 | **/ 892 | @Schema(example = "null", description = "") 893 | public String getFamilyName() { 894 | return familyName; 895 | } 896 | 897 | public void setFamilyName(String familyName) { 898 | this.familyName = familyName; 899 | } 900 | 901 | public UserInfo created(String created) { 902 | this.created = created; 903 | return this; 904 | } 905 | 906 | /** 907 | * Get created. 908 | * 909 | * @return created 910 | **/ 911 | @Schema(example = "null", description = "") 912 | public String getCreated() { 913 | return created; 914 | } 915 | 916 | public void setCreated(String created) { 917 | this.created = created; 918 | } 919 | 920 | @Override 921 | public boolean equals(java.lang.Object o) { 922 | if (this == o) { 923 | return true; 924 | } 925 | if (o == null || getClass() != o.getClass()) { 926 | return false; 927 | } 928 | UserInfo userInfo = (UserInfo) o; 929 | return Objects.equals(this.sub, userInfo.sub) && Objects.equals(this.email, userInfo.email) 930 | && Objects.equals(this.accounts, userInfo.accounts) && Objects.equals(this.name, userInfo.name) 931 | && Objects.equals(this.givenName, userInfo.givenName) && Objects.equals(this.familyName, userInfo.familyName) 932 | && Objects.equals(this.created, userInfo.created); 933 | } 934 | 935 | @Override 936 | public int hashCode() { 937 | return Objects.hash(sub, email, accounts, name, givenName, familyName, created); 938 | } 939 | 940 | @Override 941 | public String toString() { 942 | StringBuilder sb = new StringBuilder(); 943 | sb.append("class UserInfo {\n"); 944 | 945 | sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); 946 | sb.append(" email: ").append(toIndentedString(email)).append("\n"); 947 | sb.append(" name: ").append(toIndentedString(name)).append("\n"); 948 | sb.append(" givenName: ").append(toIndentedString(givenName)).append("\n"); 949 | sb.append(" familyName: ").append(toIndentedString(familyName)).append("\n"); 950 | sb.append(" created: ").append(toIndentedString(created)).append("\n"); 951 | sb.append(" accounts: ").append(toIndentedString(accounts)).append("\n"); 952 | return sb.toString(); 953 | } 954 | 955 | /** 956 | * Convert the given object to string with each line indented by 4 spaces 957 | * (except the first line). 958 | */ 959 | private String toIndentedString(java.lang.Object o) { 960 | if (o == null) { 961 | return "null"; 962 | } 963 | return o.toString().replace("\n", "\n "); 964 | } 965 | 966 | } 967 | } 968 | --------------------------------------------------------------------------------