diff --git a/README.md b/README.md index 16da4c2..232b76a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Add this dependency to your project's POM: com.dropbox.sign dropbox-sign - 1.9.0 + 1.10.0 compile ``` @@ -71,7 +71,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.dropbox.sign:dropbox-sign:1.9.0" + implementation "com.dropbox.sign:dropbox-sign:1.10.0" } ``` @@ -85,7 +85,7 @@ mvn clean package Then manually install the following JARs: -- `target/dropbox-sign-1.9.0.jar` +- `target/dropbox-sign-1.10.0.jar` - `target/lib/*.jar` ## Getting Started @@ -477,7 +477,7 @@ apisupport@hellosign.com This Java package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: `3.0.0` - - Package version: `1.9.0` + - Package version: `1.10.0` - Build package: `org.openapitools.codegen.languages.JavaClientCodegen` diff --git a/VERSION b/VERSION index f8e233b..81c871d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.0 +1.10.0 diff --git a/build.gradle b/build.gradle index 5671f34..b08b372 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } plugins { - id 'com.vanniktech.maven.publish' version '0.24.0' + id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } @@ -21,7 +21,7 @@ apply plugin: 'signing' group = 'com.dropbox.sign' archivesBaseName = 'dropbox-sign' -version = '1.9.0' +version = '1.10.0' sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -42,17 +42,17 @@ if (JavaVersion.current().isJava8Compatible()) { } task javadocJar(type: Jar) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc } task sourcesJar(type: Jar) { - classifier = 'sources' + archiveClassifier.set('sources') from sourceSets.main.allSource } task fatJar(type: Jar) { - classifier = 'all' + archiveClassifier.set('all') duplicatesStrategy = DuplicatesStrategy.EXCLUDE from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } diff --git a/build.sbt b/build.sbt index 5d588f1..ba710c3 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.dropbox.sign", name := "dropbox-sign", - version := "1.9.0", + version := "1.10.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), Compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/OAuthTokenRefreshRequest.md b/docs/OAuthTokenRefreshRequest.md index f0ce430..bb0a0e5 100644 --- a/docs/OAuthTokenRefreshRequest.md +++ b/docs/OAuthTokenRefreshRequest.md @@ -10,8 +10,8 @@ |------------ | ------------- | ------------- | -------------| | `grantType`*_required_ | ```String``` | When refreshing an existing token use `refresh_token`. | | | `refreshToken`*_required_ | ```String``` | The token provided when you got the expired access token. | | -| `clientId` | ```String``` | The client ID for your API app. Mandatory from August 1st, 2025. Until then, required if the "Client Credentials Required" setting is enabled for token refresh; optional if disabled. | | -| `clientSecret` | ```String``` | The client secret for your API app. Mandatory from August 1st, 2025. Until then, required if the "Client Credentials Required" setting is enabled for token refresh; optional if disabled. | | +| `clientId` | ```String``` | The client ID for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings. | | +| `clientSecret` | ```String``` | The client secret for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings. | | diff --git a/docs/ReportCreateRequest.md b/docs/ReportCreateRequest.md index d2f4b67..7839030 100644 --- a/docs/ReportCreateRequest.md +++ b/docs/ReportCreateRequest.md @@ -20,6 +20,7 @@ ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | +| SMS_ACTIVITY | "sms_activity" | diff --git a/docs/ReportResponse.md b/docs/ReportResponse.md index b48dde6..aa74d68 100644 --- a/docs/ReportResponse.md +++ b/docs/ReportResponse.md @@ -21,6 +21,7 @@ Contains information about the report request. ---- | ----- | USER_ACTIVITY | "user_activity" | | DOCUMENT_STATUS | "document_status" | +| SMS_ACTIVITY | "sms_activity" | diff --git a/docs/TemplateResponseDocumentFormFieldText.md b/docs/TemplateResponseDocumentFormFieldText.md index 49cdfaa..1b8d78c 100644 --- a/docs/TemplateResponseDocumentFormFieldText.md +++ b/docs/TemplateResponseDocumentFormFieldText.md @@ -14,6 +14,8 @@ This class extends `TemplateResponseDocumentFormFieldBase` | `originalFontSize` | ```Integer``` | Original font size used in this form field's text. | | | `fontFamily` | ```String``` | Font family used in this form field's text. | | | `validationType` | [```ValidationTypeEnum```](#ValidationTypeEnum) | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | +| `validationCustomRegex` | ```String``` | When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field. | | +| `validationCustomRegexFormatLabel` | ```String``` | When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern. | | | `group` | ```String``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | diff --git a/gradle.properties b/gradle.properties index 5091b1e..0fe643d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ #target = android GROUP=com.dropbox.sign POM_ARTIFACT_ID=dropbox-sign -VERSION_NAME=1.9.0 +VERSION_NAME=1.10.0 POM_NAME=Dropbox Sign Java SDK POM_DESCRIPTION=Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! @@ -24,7 +24,6 @@ POM_DEVELOPER_ID=dropbox-sign-api-team POM_DEVELOPER_NAME=Dropbox Sign API Team POM_DEVELOPER_URL=https://hellosign.com -SONATYPE_HOST=S01 RELEASE_SIGNING_ENABLED=true SONATYPE_CONNECT_TIMEOUT_SECONDS=300 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5c6f89d..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/openapi-config.yaml b/openapi-config.yaml index bad48c7..50911c2 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -16,7 +16,7 @@ additionalProperties: groupId: com.dropbox.sign artifactId: dropbox-sign artifactName: Dropbox Sign Java SDK - artifactVersion: "1.9.0" + artifactVersion: "1.10.0" artifactUrl: https://github.com/hellosign/dropbox-sign-java artifactDescription: Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! scmConnection: scm:git:git://github.com/hellosign/dropbox-sign-java.git diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index c832450..c123c2e 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -7797,7 +7797,7 @@ components: type: array items: type: string - maxItems: 2 + maxItems: 10 minItems: 1 name: description: 'The name you want to assign to the ApiApp.' @@ -7823,7 +7823,7 @@ components: type: array items: type: string - maxItems: 2 + maxItems: 10 name: description: 'The name you want to assign to the ApiApp.' type: string @@ -8112,10 +8112,10 @@ components: description: 'The token provided when you got the expired access token.' type: string client_id: - description: 'The client ID for your API app. Mandatory from August 1st, 2025. Until then, required if the "Client Credentials Required" setting is enabled for token refresh; optional if disabled.' + description: 'The client ID for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings.' type: string client_secret: - description: 'The client secret for your API app. Mandatory from August 1st, 2025. Until then, required if the "Client Credentials Required" setting is enabled for token refresh; optional if disabled.' + description: 'The client secret for your API app. Required for new API apps. To enhance security, we recommend making it required for existing apps in your app settings.' type: string type: object ReportCreateRequest: @@ -8135,6 +8135,7 @@ components: enum: - user_activity - document_status + - sms_activity maxItems: 2 minItems: 1 start_date: @@ -11964,6 +11965,7 @@ components: enum: - user_activity - document_status + - sms_activity type: object x-internal-class: true SignatureRequestResponse: @@ -13130,6 +13132,14 @@ components: - employer_identification_number - custom_regex nullable: true + validation_custom_regex: + description: 'When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field.' + type: string + nullable: true + validation_custom_regex_format_label: + description: 'When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern.' + type: string + nullable: true group: description: 'The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.' type: string diff --git a/pom.xml b/pom.xml index 767f2ad..f83e5f5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ dropbox-sign jar dropbox-sign - 1.9.0 + 1.10.0 https://github.com/hellosign/dropbox-sign-java Use the Dropbox Sign Java SDK to connect your Java app to the service of Dropbox Sign in microseconds! diff --git a/src/main/java/com/dropbox/sign/ApiClient.java b/src/main/java/com/dropbox/sign/ApiClient.java index 4b10f8f..d272312 100644 --- a/src/main/java/com/dropbox/sign/ApiClient.java +++ b/src/main/java/com/dropbox/sign/ApiClient.java @@ -147,7 +147,7 @@ public ApiClient(Map authMap) { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.9.0/java"); + setUserAgent("OpenAPI-Generator/1.10.0/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap<>(); diff --git a/src/main/java/com/dropbox/sign/Configuration.java b/src/main/java/com/dropbox/sign/Configuration.java index c424852..8c4ca77 100644 --- a/src/main/java/com/dropbox/sign/Configuration.java +++ b/src/main/java/com/dropbox/sign/Configuration.java @@ -16,7 +16,7 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class Configuration { - public static final String VERSION = "1.9.0"; + public static final String VERSION = "1.10.0"; private static volatile ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java index d8226d6..58cdfdb 100644 --- a/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java +++ b/src/main/java/com/dropbox/sign/model/OAuthTokenRefreshRequest.java @@ -117,9 +117,8 @@ public OAuthTokenRefreshRequest clientId(@javax.annotation.Nullable String clien } /** - * The client ID for your API app. Mandatory from August 1st, 2025. Until then, required if the - * \"Client Credentials Required\" setting is enabled for token refresh; optional if - * disabled. + * The client ID for your API app. Required for new API apps. To enhance security, we recommend + * making it required for existing apps in your app settings. * * @return clientId */ @@ -141,9 +140,8 @@ public OAuthTokenRefreshRequest clientSecret(@javax.annotation.Nullable String c } /** - * The client secret for your API app. Mandatory from August 1st, 2025. Until then, required if - * the \"Client Credentials Required\" setting is enabled for token refresh; optional - * if disabled. + * The client secret for your API app. Required for new API apps. To enhance security, we + * recommend making it required for existing apps in your app settings. * * @return clientSecret */ diff --git a/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java index c5c3fd8..38e625d 100644 --- a/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java +++ b/src/main/java/com/dropbox/sign/model/ReportCreateRequest.java @@ -45,7 +45,9 @@ public class ReportCreateRequest { public enum ReportTypeEnum { USER_ACTIVITY(String.valueOf("user_activity")), - DOCUMENT_STATUS(String.valueOf("document_status")); + DOCUMENT_STATUS(String.valueOf("document_status")), + + SMS_ACTIVITY(String.valueOf("sms_activity")); private String value; diff --git a/src/main/java/com/dropbox/sign/model/ReportResponse.java b/src/main/java/com/dropbox/sign/model/ReportResponse.java index 29d5b88..6d5079f 100644 --- a/src/main/java/com/dropbox/sign/model/ReportResponse.java +++ b/src/main/java/com/dropbox/sign/model/ReportResponse.java @@ -52,7 +52,9 @@ public class ReportResponse { public enum ReportTypeEnum { USER_ACTIVITY(String.valueOf("user_activity")), - DOCUMENT_STATUS(String.valueOf("document_status")); + DOCUMENT_STATUS(String.valueOf("document_status")), + + SMS_ACTIVITY(String.valueOf("sms_activity")); private String value; diff --git a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java index 353bd89..1eb8a42 100644 --- a/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java +++ b/src/main/java/com/dropbox/sign/model/TemplateResponseDocumentFormFieldText.java @@ -34,6 +34,8 @@ TemplateResponseDocumentFormFieldText.JSON_PROPERTY_ORIGINAL_FONT_SIZE, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_FONT_FAMILY, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_TYPE, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX, + TemplateResponseDocumentFormFieldText.JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL, TemplateResponseDocumentFormFieldText.JSON_PROPERTY_GROUP }) @javax.annotation.Generated( @@ -119,6 +121,13 @@ public static ValidationTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_VALIDATION_TYPE = "validation_type"; @javax.annotation.Nullable private ValidationTypeEnum validationType; + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX = "validation_custom_regex"; + @javax.annotation.Nullable private String validationCustomRegex; + + public static final String JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL = + "validation_custom_regex_format_label"; + @javax.annotation.Nullable private String validationCustomRegexFormatLabel; + public static final String JSON_PROPERTY_GROUP = "group"; @javax.annotation.Nullable private String group; @@ -289,6 +298,55 @@ public void setValidationType(@javax.annotation.Nullable ValidationTypeEnum vali this.validationType = validationType; } + public TemplateResponseDocumentFormFieldText validationCustomRegex( + @javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + return this; + } + + /** + * When `validation_type` is set to `custom_regex`, this specifies the + * custom regular expression pattern that will be used to validate the text field. + * + * @return validationCustomRegex + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValidationCustomRegex() { + return validationCustomRegex; + } + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegex(@javax.annotation.Nullable String validationCustomRegex) { + this.validationCustomRegex = validationCustomRegex; + } + + public TemplateResponseDocumentFormFieldText validationCustomRegexFormatLabel( + @javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + return this; + } + + /** + * When `validation_type` is set to `custom_regex`, this specifies the error + * message displayed to the signer when the text does not match the provided regex pattern. + * + * @return validationCustomRegexFormatLabel + */ + @javax.annotation.Nullable @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValidationCustomRegexFormatLabel() { + return validationCustomRegexFormatLabel; + } + + @JsonProperty(JSON_PROPERTY_VALIDATION_CUSTOM_REGEX_FORMAT_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValidationCustomRegexFormatLabel( + @javax.annotation.Nullable String validationCustomRegexFormatLabel) { + this.validationCustomRegexFormatLabel = validationCustomRegexFormatLabel; + } + public TemplateResponseDocumentFormFieldText group(@javax.annotation.Nullable String group) { this.group = group; return this; @@ -334,6 +392,12 @@ public boolean equals(Object o) { && Objects.equals(this.fontFamily, templateResponseDocumentFormFieldText.fontFamily) && Objects.equals( this.validationType, templateResponseDocumentFormFieldText.validationType) + && Objects.equals( + this.validationCustomRegex, + templateResponseDocumentFormFieldText.validationCustomRegex) + && Objects.equals( + this.validationCustomRegexFormatLabel, + templateResponseDocumentFormFieldText.validationCustomRegexFormatLabel) && Objects.equals(this.group, templateResponseDocumentFormFieldText.group) && super.equals(o); } @@ -347,6 +411,8 @@ public int hashCode() { originalFontSize, fontFamily, validationType, + validationCustomRegex, + validationCustomRegexFormatLabel, group, super.hashCode()); } @@ -362,6 +428,12 @@ public String toString() { sb.append(" originalFontSize: ").append(toIndentedString(originalFontSize)).append("\n"); sb.append(" fontFamily: ").append(toIndentedString(fontFamily)).append("\n"); sb.append(" validationType: ").append(toIndentedString(validationType)).append("\n"); + sb.append(" validationCustomRegex: ") + .append(toIndentedString(validationCustomRegex)) + .append("\n"); + sb.append(" validationCustomRegexFormatLabel: ") + .append(toIndentedString(validationCustomRegexFormatLabel)) + .append("\n"); sb.append(" group: ").append(toIndentedString(group)).append("\n"); sb.append("}"); return sb.toString(); @@ -490,6 +562,56 @@ public Map createFormData() throws ApiException { JSON.getDefault().getMapper().writeValueAsString(validationType)); } } + if (validationCustomRegex != null) { + if (isFileTypeOrListOfFiles(validationCustomRegex)) { + fileTypeFound = true; + } + + if (validationCustomRegex.getClass().equals(java.io.File.class) + || validationCustomRegex.getClass().equals(Integer.class) + || validationCustomRegex.getClass().equals(String.class) + || validationCustomRegex.getClass().isEnum()) { + map.put("validation_custom_regex", validationCustomRegex); + } else if (isListOfFile(validationCustomRegex)) { + for (int i = 0; i < getListSize(validationCustomRegex); i++) { + map.put( + "validation_custom_regex[" + i + "]", + getFromList(validationCustomRegex, i)); + } + } else { + map.put( + "validation_custom_regex", + JSON.getDefault() + .getMapper() + .writeValueAsString(validationCustomRegex)); + } + } + if (validationCustomRegexFormatLabel != null) { + if (isFileTypeOrListOfFiles(validationCustomRegexFormatLabel)) { + fileTypeFound = true; + } + + if (validationCustomRegexFormatLabel.getClass().equals(java.io.File.class) + || validationCustomRegexFormatLabel.getClass().equals(Integer.class) + || validationCustomRegexFormatLabel.getClass().equals(String.class) + || validationCustomRegexFormatLabel.getClass().isEnum()) { + map.put( + "validation_custom_regex_format_label", + validationCustomRegexFormatLabel); + } else if (isListOfFile(validationCustomRegexFormatLabel)) { + for (int i = 0; i < getListSize(validationCustomRegexFormatLabel); i++) { + map.put( + "validation_custom_regex_format_label[" + i + "]", + getFromList(validationCustomRegexFormatLabel, i)); + } + } else { + map.put( + "validation_custom_regex_format_label", + JSON.getDefault() + .getMapper() + .writeValueAsString(validationCustomRegexFormatLabel)); + } + } if (group != null) { if (isFileTypeOrListOfFiles(group)) { fileTypeFound = true; diff --git a/src/test/java/com/dropbox/sign/api/FaxApiTest.java b/src/test/java/com/dropbox/sign/api/FaxApiTest.java new file mode 100644 index 0000000..ff1ae81 --- /dev/null +++ b/src/test/java/com/dropbox/sign/api/FaxApiTest.java @@ -0,0 +1,58 @@ +package com.dropbox.sign.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.TestHelper; +import com.dropbox.sign.model.*; +import com.fasterxml.jackson.databind.JsonNode; +import java.io.File; +import org.junit.jupiter.api.Test; + +public class FaxApiTest { + @Test + public void faxSendTest() throws Exception { + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxGetResponse.class.getSimpleName()); + FaxGetResponse expectedResponse = FaxGetResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + JsonNode requestData = TestHelper.getJsonContents(FaxSendRequest.class.getSimpleName()); + + FaxSendRequest request = FaxSendRequest.init(requestData.toString()); + request.addFilesItem(new File("test_fixtures/pdf-sample.pdf")); + + FaxApi api = new FaxApi(apiClient); + FaxGetResponse response = api.faxSend(request); + + assertEquals(expectedResponse, response); + } + + @Test + public void faxGetTest() throws Exception { + String faxId = "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d"; + + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxGetResponse.class.getSimpleName()); + FaxGetResponse expectedResponse = FaxGetResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + FaxApi api = new FaxApi(apiClient); + FaxGetResponse response = api.faxGet(faxId); + + assertEquals(expectedResponse, response); + } + + @Test + public void faxListTest() throws Exception { + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxListResponse.class.getSimpleName()); + FaxListResponse expectedResponse = FaxListResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + FaxApi api = new FaxApi(apiClient); + FaxListResponse response = api.faxList(); + + assertEquals(expectedResponse, response); + } +} diff --git a/src/test/java/com/dropbox/sign/api/FaxLineApiTest.java b/src/test/java/com/dropbox/sign/api/FaxLineApiTest.java new file mode 100644 index 0000000..50ea987 --- /dev/null +++ b/src/test/java/com/dropbox/sign/api/FaxLineApiTest.java @@ -0,0 +1,58 @@ +package com.dropbox.sign.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.dropbox.sign.ApiClient; +import com.dropbox.sign.TestHelper; +import com.dropbox.sign.model.*; +import com.fasterxml.jackson.databind.JsonNode; +import org.junit.jupiter.api.Test; + +public class FaxLineApiTest { + @Test + public void faxLineCreateTest() throws Exception { + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxLineResponse.class.getSimpleName()); + FaxLineResponse expectedResponse = FaxLineResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + JsonNode requestData = + TestHelper.getJsonContents(FaxLineCreateRequest.class.getSimpleName()); + + FaxLineCreateRequest request = FaxLineCreateRequest.init(requestData.toString()); + + FaxLineApi api = new FaxLineApi(apiClient); + FaxLineResponse response = api.faxLineCreate(request); + + assertEquals(expectedResponse, response); + } + + @Test + public void faxLineGetTest() throws Exception { + String faxLineNumber = "14155557897"; + + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxLineResponse.class.getSimpleName()); + FaxLineResponse expectedResponse = FaxLineResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + FaxLineApi api = new FaxLineApi(apiClient); + FaxLineResponse response = api.faxLineGet(faxLineNumber); + + assertEquals(expectedResponse, response); + } + + @Test + public void faxLineListTest() throws Exception { + JsonNode expectedResponseData = + TestHelper.getJsonContents(FaxLineListResponse.class.getSimpleName()); + FaxLineListResponse expectedResponse = + FaxLineListResponse.init(expectedResponseData.toString()); + ApiClient apiClient = TestHelper.setUpMock(200, expectedResponse); + + FaxLineApi api = new FaxLineApi(apiClient); + FaxLineListResponse response = api.faxLineList(); + + assertEquals(expectedResponse, response); + } +} diff --git a/templates/gradle-wrapper.properties.mustache b/templates/gradle-wrapper.properties.mustache index 552ae67..b82aa23 100644 --- a/templates/gradle-wrapper.properties.mustache +++ b/templates/gradle-wrapper.properties.mustache @@ -1,11 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -{{^useCustomTemplateCode}} distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip -{{/useCustomTemplateCode}} networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/templates/gradle.properties.mustache b/templates/gradle.properties.mustache index 101f52b..5aa1b7d 100644 --- a/templates/gradle.properties.mustache +++ b/templates/gradle.properties.mustache @@ -25,7 +25,6 @@ POM_DEVELOPER_ID={{developerId}} POM_DEVELOPER_NAME={{developerName}} POM_DEVELOPER_URL={{developerOrganizationUrl}} -SONATYPE_HOST=S01 RELEASE_SIGNING_ENABLED=true SONATYPE_CONNECT_TIMEOUT_SECONDS=300 diff --git a/templates/libraries/jersey2/build.gradle.mustache b/templates/libraries/jersey2/build.gradle.mustache index d3ea8ff..deeb879 100644 --- a/templates/libraries/jersey2/build.gradle.mustache +++ b/templates/libraries/jersey2/build.gradle.mustache @@ -25,7 +25,7 @@ buildscript { {{#useCustomTemplateCode}} plugins { - id 'com.vanniktech.maven.publish' version '0.24.0' + id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } @@ -136,17 +136,17 @@ if (JavaVersion.current().isJava8Compatible()) { } task javadocJar(type: Jar) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc } task sourcesJar(type: Jar) { - classifier = 'sources' + archiveClassifier.set('sources') from sourceSets.main.allSource } task fatJar(type: Jar) { - classifier = 'all' + archiveClassifier.set('all') duplicatesStrategy = DuplicatesStrategy.EXCLUDE from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } diff --git a/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json index 2eda936..0d668e0 100644 --- a/test_fixtures/FaxGetResponse.json +++ b/test_fixtures/FaxGetResponse.json @@ -20,12 +20,11 @@ "transmissions": [ { "recipient": "recipient@dropboxsign.com", - "sender": "me@dropboxsign.com", "sent_at": 1723231831, "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" } } } diff --git a/test_fixtures/FaxLineCreateRequest.json b/test_fixtures/FaxLineCreateRequest.json new file mode 100644 index 0000000..91d11c8 --- /dev/null +++ b/test_fixtures/FaxLineCreateRequest.json @@ -0,0 +1,6 @@ +{ + "default": { + "country": "US", + "area_code": 949 + } +} diff --git a/test_fixtures/FaxLineListResponse.json b/test_fixtures/FaxLineListResponse.json new file mode 100644 index 0000000..c241c1b --- /dev/null +++ b/test_fixtures/FaxLineListResponse.json @@ -0,0 +1,26 @@ +{ + "default": { + "list_info": { + "num_pages": 1, + "num_results": 1, + "page": 1, + "page_size": 1 + }, + "fax_lines": [ + { + "number": "14155557897", + "created_at": 1750196223, + "updated_at": 1750196223, + "accounts": [ + { + "account_id": "a3367a4130f3624687ea7de6f09df951a44923dd", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } + ] + } +} diff --git a/test_fixtures/FaxLineResponse.json b/test_fixtures/FaxLineResponse.json new file mode 100644 index 0000000..3855a8a --- /dev/null +++ b/test_fixtures/FaxLineResponse.json @@ -0,0 +1,18 @@ +{ + "default": { + "fax_line": { + "number": "14155557897", + "created_at": 1750196223, + "updated_at": 1750196223, + "accounts": [ + { + "account_id": "a3367a4130f3624687ea7de6f09df951a44923dd", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } + } +} diff --git a/test_fixtures/FaxListResponse.json b/test_fixtures/FaxListResponse.json index a9ebf63..d0ce7fe 100644 --- a/test_fixtures/FaxListResponse.json +++ b/test_fixtures/FaxListResponse.json @@ -27,12 +27,11 @@ "transmissions": [ { "recipient": "recipient@dropboxsign.com", - "sender": "me@dropboxsign.com", "sent_at": 1723231831, "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" } ] } diff --git a/test_fixtures/FaxResponse.json b/test_fixtures/FaxResponse.json new file mode 100644 index 0000000..32a44d5 --- /dev/null +++ b/test_fixtures/FaxResponse.json @@ -0,0 +1,24 @@ +{ + "default": { + "fax": { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "title": "example title", + "original_title": "example original title", + "metadata": {}, + "created_at": 1750105080, + "sender": "14155557068", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "final_copy_uri": "/v3/transmission/final_copy/c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "transmissions": [ + { + "recipient": "18005550199", + "status_code": "transmitting" + } + ], + "transmission_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "from": "14155557068", + "test_mode": false + } + } +} + diff --git a/test_fixtures/FaxSendResponse.json b/test_fixtures/FaxSendResponse.json deleted file mode 100644 index b651c78..0000000 --- a/test_fixtures/FaxSendResponse.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "default": { - "fax": { - "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", - "title": "example title", - "original_title": "example original title", - "subject": "example subject", - "message": "example message", - "metadata": [ ], - "created_at": 1726774555, - "sender": "me@dropboxsign.com", - "transmissions": [], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" - } - } -}