diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f552357 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release +on: + push: + branches: ['main'] + paths: + - '.github/workflows/release.yml' + - 'pom.xml' + workflow_dispatch: + inputs: + publish_to_package_manager: + description: 'Override PUBLISH_TO_PACKAGE_MANAGER for this run' + type: boolean + default: false + +env: + # Toggle to enable package-manager publishing on push to base. + # The workflow_dispatch input above overrides this on manual runs. + # Quoted so the value is always compared as a string (see the gate step below). + PUBLISH_TO_PACKAGE_MANAGER: 'false' + # SDK identity baked in at generation time from the in-memory build context, + # so the workflow never reads pom.xml at runtime. + SDK_VERSION: '4.0.0' + SDK_GROUP_ID: 'com.alohi' + SDK_ARTIFACT_ID: 'signplus' + RELEASE_TAG: 'v4.0.0' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Create tag if it does not exist + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if gh api "repos/${{ github.repository }}/git/refs/tags/$RELEASE_TAG" >/dev/null 2>&1; then + echo "::notice::Tag $RELEASE_TAG already exists, nothing to do" + exit 0 + fi + gh api -X POST "repos/${{ github.repository }}/git/refs" \ + -f ref="refs/tags/$RELEASE_TAG" \ + -f sha="${{ github.sha }}" + echo "::notice::Created tag $RELEASE_TAG at ${{ github.sha }}" + - name: Compute publish gate + id: gate + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "ok=${{ inputs.publish_to_package_manager }}" >> "$GITHUB_OUTPUT" + else + echo "ok=$PUBLISH_TO_PACKAGE_MANAGER" >> "$GITHUB_OUTPUT" + fi + # Maven Central (Sonatype) requires GPG-signed artifacts plus -sources and + # -javadoc jars. The generated pom.xml attaches those via the + # `release-sign-artifacts` profile (activated by -DperformRelease=true) and + # publishes through the central-publishing-maven-plugin (server id: central). + - uses: actions/setup-java@v4 + if: steps.gate.outputs.ok == 'true' + with: + distribution: 'temurin' + java-version: '11' + server-id: 'central' + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + - name: Publish to Maven Central + if: steps.gate.outputs.ok == 'true' + # Idempotent: Maven Central is immutable, so re-running for an + # already-published version (e.g. enabling publishing on an existing + # tag) skips the deploy instead of failing. + run: | + GROUP_PATH="${SDK_GROUP_ID//./\/}" + POM_URL="https://repo1.maven.org/maven2/${GROUP_PATH}/${SDK_ARTIFACT_ID}/${SDK_VERSION}/${SDK_ARTIFACT_ID}-${SDK_VERSION}.pom" + if curl -sfI "$POM_URL" >/dev/null 2>&1; then + echo "::notice::$SDK_GROUP_ID:$SDK_ARTIFACT_ID:$SDK_VERSION already published to Maven Central, skipping deploy" + else + mvn --batch-mode -DperformRelease=true -DskipTests deploy + fi + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Create GitHub release + if: steps.gate.outputs.ok == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then + echo "::notice::Release $RELEASE_TAG already exists" + else + gh release create "$RELEASE_TAG" --title "$RELEASE_TAG" --generate-notes + fi diff --git a/.gitignore b/.gitignore index beceff9..a7e1cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ build/ gradle-app.setting !gradle-wrapper.jar +# Kotlin +.kotlin + # IntelliJ out/ .idea/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..9d7fb43 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/.idea/encoding.xml b/.idea/encoding.xml new file mode 100644 index 0000000..d2ba3b4 --- /dev/null +++ b/.idea/encoding.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a68d10e --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..52fd866 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..e7b9aac --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1733418524837 + + + + diff --git a/.manifest.json b/.manifest.json index 60cd391..4c465d4 100644 --- a/.manifest.json +++ b/.manifest.json @@ -1,24 +1,28 @@ { - "liblabVersion": "2.25.46", - "date": "2025-09-17T12:01:32.149Z", + "sdkGenVersion": "1.5.1", + "date": "2026-06-30T05:00:04.196Z", "config": { - "apiId": 2744, - "sdkName": "signplus", - "sdkVersion": "2.4.0", - "languages": ["java"], - "auth": ["bearer"], - "docs": [], - "liblabVersion": "2", - "deliveryMethods": ["zip"], - "rawConfig": { - "sdkName": "signplus", - "apiVersion": "2.5.0", - "apiName": "signplus-api", - "specFilePath": "openapi.yaml", - "languages": ["csharp", "go", "python", "typescript", "java", "php"], - "auth": ["bearer"], - "customizations": { - "includeOptionalSnippetParameters": true, + "sdkVersion": "4.0.0", + "auth": [ + "bearer" + ], + "apiVersion": "2.5.0", + "publishing": { + "githubOrg": "alohihq", + "enabled": false, + "releaseBranch": "main" + }, + "languageOptions": { + "java": { + "githubRepoName": "signplus-java", + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, "authentication": { "access": { "prefix": "Bearer" @@ -26,169 +30,255 @@ }, "devContainer": false, "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], "inferServiceNames": false, + "groupId": "com.alohi", + "artifactId": "signplus", + "developers": [ + { + "name": "Alohi SA", + "email": "support@alohi.com", + "organization": "Alohi SA", + "organizationUrl": "https://www.alohi.com" + } + ] + }, + "typescript": { + "githubRepoName": "signplus-typescript", + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, "injectedModels": [], + "inferServiceNames": false, + "npmOrg": "alohi", + "npmName": "signplus-typescript", + "httpClient": "axios", + "bundle": false, + "exportClassDefault": false + }, + "python": { + "githubRepoName": "signplus-python", + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, "license": { "type": "MIT" }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false, + "pypiPackageName": "signplus-python", + "classifiers": [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Topic :: Software Development" + ] + }, + "kotlin": { "retry": { "enabled": true, "maxAttempts": 3, "retryDelay": 150 - } + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false }, - "languageOptions": { - "python": { - "alwaysInitializeOptionals": false, - "pypiPackageName": "signplus-python", - "githubRepoName": "signplus-python", - "ignoreFiles": [], - "sdkVersion": "1.4.0", - "liblabVersion": "2", - "additionalConstructorParameters": [] + "ruby": { + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 }, - "java": { - "githubRepoName": "signplus-java", - "groupId": "com.alohi", - "artifactId": "signplus", - "sdkVersion": "2.4.0", - "liblabVersion": "2", - "developers": [ - { - "name": "Alohi SA", - "email": "support@alohi.com", - "organization": "Alohi SA", - "organizationUrl": "https://www.alohi.com" - } - ], - "additionalConstructorParameters": [] + "license": { + "type": "MIT" }, - "typescript": { - "bundle": false, - "exportClassDefault": false, - "httpClient": "axios", - "npmName": "signplus-typescript", - "npmOrg": "alohi", - "githubRepoName": "signplus-typescript", - "ignoreFiles": [], - "sdkVersion": "2.4.0", - "liblabVersion": "2", - "additionalConstructorParameters": [] + "authentication": { + "access": { + "prefix": "Bearer" + } }, - "go": { - "goModuleName": "github.com/alohihq/signplus-go", - "githubRepoName": "signplus-go", - "ignoreFiles": [], - "sdkVersion": "1.4.0", - "liblabVersion": "2", - "additionalConstructorParameters": [] + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false + }, + "go": { + "githubRepoName": "signplus-sharp", + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 }, - "php": { - "packageName": "alohi/signplus", - "githubRepoName": "signplus-php", - "ignoreFiles": [], - "sdkVersion": "2.4.0", - "liblabVersion": "2", - "additionalConstructorParameters": [] + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } }, - "csharp": { - "packageId": "Alohi.Signplus", - "githubRepoName": "signplus-sharp", - "ignoreFiles": [], - "sdkVersion": "1.4.0", - "liblabVersion": "2" - } + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false, + "goModuleName": "github.com/alohihq/signplus-go" }, - "publishing": { - "githubOrg": "alohihq" - } - }, - "liblabConfigVersion": "1.0.0", - "apiVersion": "2.5.0", - "apiName": "signplus-api", - "specFilePath": "openapi.yaml", - "createDocs": false, - "languageOptions": { "csharp": { "githubRepoName": "signplus-sharp", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "1.4.0", - "packageId": "Alohi.Signplus" - }, - "go": { - "githubRepoName": "signplus-go", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "1.4.0", - "goModuleName": "github.com/alohihq/signplus-go", - "additionalConstructorParameters": [] - }, - "java": { - "githubRepoName": "signplus-java", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "2.4.0", - "groupId": "com.alohi", - "artifactId": "signplus", - "includeKotlinSnippets": false, - "developers": [ - { - "name": "Alohi SA", - "email": "support@alohi.com", - "organization": "Alohi SA", - "organizationUrl": "https://www.alohi.com" + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" } - ], - "additionalConstructorParameters": [] - }, - "python": { - "githubRepoName": "signplus-python", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "1.4.0", - "alwaysInitializeOptionals": false, - "additionalConstructorParameters": [], - "pypiPackageName": "signplus-python" + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false, + "packageId": "Alohi.Signplus" }, "php": { "githubRepoName": "signplus-php", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "2.4.0", - "additionalConstructorParameters": [], + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false, "packageName": "alohi/signplus" }, - "typescript": { - "githubRepoName": "signplus-typescript", - "ignoreFiles": [], - "liblabVersion": "2", - "renameIllegalModelProperties": true, - "sdkVersion": "2.4.0", - "additionalConstructorParameters": [], - "bundle": false, - "denoteCommon": false, - "exportClassDefault": false, - "generateEnumAs": "enum", - "httpClient": "axios", - "npmName": "signplus-typescript", - "npmOrg": "alohi" + "cli": { + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false + }, + "rust": { + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "license": { + "type": "MIT" + }, + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "devContainer": false, + "generateEnv": true, + "responseHeaders": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false } }, - "validationsToIgnore": [], - "publishing": { - "githubOrg": "alohihq", - "platform": "github" + "customCode": { + "trackChanges": true + }, + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150, + "maxDelay": 5000, + "retryDelayJitter": 50, + "backOffFactor": 2, + "httpMethodsToRetry": [ + "GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "HEAD", + "OPTIONS" + ] }, - "analytics": { - "streaming": false, - "pagination": false + "license": { + "type": "MIT", + "name": "MIT", + "url": "https://opensource.org/licenses/MIT", + "path": "MIT.ejs" }, "authentication": { "access": { @@ -197,33 +287,20 @@ }, "devContainer": false, "generateEnv": true, - "includeOptionalSnippetParameters": true, - "license": { - "type": "MIT", - "name": "MIT", - "url": "https://opensource.org/licenses/MIT", - "path": "MIT.ejs" - }, "responseHeaders": false, - "buildAllModels": false, - "retry": { - "enabled": true, - "maxAttempts": 3, - "retryDelay": 150, - "maxDelay": 5000, - "retryDelayJitter": 50, - "backOffFactor": 2, - "httpCodesToRetry": [408, 429, 500, 502, 503, 504], - "httpMethodsToRetry": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"] - }, - "multiTenant": true, - "includeWatermark": false, + "includeOptionalSnippetParameters": true, + "injectedModels": [], + "inferServiceNames": false, + "languages": [ + "java" + ], + "deliveryMethods": [ + "zip" + ], + "sdkName": "signplus", "githubRepoName": "signplus-java", - "ignoreFiles": [], - "renameIllegalModelProperties": true, "groupId": "com.alohi", "artifactId": "signplus", - "includeKotlinSnippets": false, "developers": [ { "name": "Alohi SA", @@ -232,24 +309,24 @@ "organizationUrl": "https://www.alohi.com" } ], - "additionalConstructorParameters": [], "language": "java", "deliveryMethod": "zip", "hooks": { "enabled": false, "sourceDir": "" }, + "validateResponses": false, "usesFormData": false, "environmentVariables": [], "fileOutput": "/tmp", - "inferServiceNames": false, "httpLibrary": { "name": "axios", - "packages": { - "axios": "^1.9.0" - }, - "languages": ["typescript"] + "packages": {}, + "languages": [ + "typescript" + ] }, + "multiTenant": false, "customQueries": { "paths": [], "rawQueries": [], @@ -259,11 +336,15 @@ "specType": "openapi", "deprecatedOperations": { "include": true + }, + "multipleResponses": { + "enabled": false } }, "files": [ "pom.xml", ".gitignore", + ".github/workflows/release.yml", "src/main/java/com/alohi/signplus/validation/Violation.java", "src/main/java/com/alohi/signplus/validation/ViolationAggregator.java", "src/main/java/com/alohi/signplus/validation/validators/AbstractValidator.java", @@ -276,6 +357,7 @@ "src/main/java/com/alohi/signplus/services/BaseService.java", "src/main/java/com/alohi/signplus/http/HttpMethod.java", "src/main/java/com/alohi/signplus/http/ModelConverter.java", + "src/main/java/com/alohi/signplus/http/util/ContentTypes.java", "src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java", "src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java", "src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java", @@ -283,7 +365,6 @@ "src/main/java/com/alohi/signplus/http/serialization/Serializer.java", "src/main/java/com/alohi/signplus/http/serialization/Util.java", "src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java", - "src/main/java/com/alohi/signplus/hook/Hook.java", "src/main/java/com/alohi/signplus/exceptions/ApiError.java", "src/main/java/com/alohi/signplus/http/Environment.java", "src/main/java/com/alohi/signplus/Signplus.java", @@ -291,74 +372,76 @@ "src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java", "src/main/java/com/alohi/signplus/config/RetryConfig.java", "src/main/java/com/alohi/signplus/config/SignplusConfig.java", - "documentation/models/CreateEnvelopeRequest.md", + "src/main/java/com/alohi/signplus/config/RequestConfig.java", + "documentation/snippets/snippets.json", "documentation/models/Envelope.md", - "documentation/models/CreateEnvelopeFromTemplateRequest.md", - "documentation/models/ListEnvelopesRequest.md", - "documentation/models/ListEnvelopesResponse.md", - "documentation/models/Document.md", - "documentation/models/ListEnvelopeDocumentsResponse.md", - "documentation/models/AddEnvelopeDocumentRequest.md", - "documentation/models/SetEnvelopeDynamicFieldsRequest.md", - "documentation/models/AddEnvelopeSigningStepsRequest.md", - "documentation/models/SetEnvelopeAttachmentsSettingsRequest.md", - "documentation/models/EnvelopeAttachments.md", - "documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md", - "documentation/models/RenameEnvelopeRequest.md", - "documentation/models/SetEnvelopeCommentRequest.md", - "documentation/models/EnvelopeNotification.md", - "documentation/models/SetEnvelopeExpirationRequest.md", - "documentation/models/SetEnvelopeLegalityLevelRequest.md", - "documentation/models/Annotation.md", - "documentation/models/ListEnvelopeDocumentAnnotationsResponse.md", - "documentation/models/AddAnnotationRequest.md", - "documentation/models/CreateTemplateRequest.md", - "documentation/models/Template.md", - "documentation/models/ListTemplatesRequest.md", - "documentation/models/ListTemplatesResponse.md", - "documentation/models/AddTemplateDocumentRequest.md", - "documentation/models/ListTemplateDocumentsResponse.md", - "documentation/models/AddTemplateSigningStepsRequest.md", - "documentation/models/RenameTemplateRequest.md", - "documentation/models/SetTemplateCommentRequest.md", - "documentation/models/ListTemplateAnnotationsResponse.md", - "documentation/models/ListTemplateDocumentAnnotationsResponse.md", - "documentation/models/CreateWebhookRequest.md", - "documentation/models/Webhook.md", - "documentation/models/ListWebhooksRequest.md", - "documentation/models/ListWebhooksResponse.md", - "documentation/models/EnvelopeLegalityLevel.md", "documentation/models/EnvelopeFlowType.md", + "documentation/models/EnvelopeLegalityLevel.md", "documentation/models/EnvelopeStatus.md", "documentation/models/SigningStep.md", "documentation/models/Recipient.md", "documentation/models/RecipientRole.md", "documentation/models/RecipientVerification.md", "documentation/models/RecipientVerificationType.md", + "documentation/models/Document.md", "documentation/models/Page.md", + "documentation/models/EnvelopeNotification.md", + "documentation/models/EnvelopeAttachments.md", "documentation/models/AttachmentSettings.md", "documentation/models/AttachmentPlaceholdersPerRecipient.md", "documentation/models/AttachmentPlaceholder.md", "documentation/models/AttachmentPlaceholderFile.md", + "documentation/models/CreateEnvelopeRequest.md", + "documentation/models/CreateEnvelopeFromTemplateRequest.md", + "documentation/models/ListEnvelopesResponse.md", + "documentation/models/ListEnvelopesRequest.md", "documentation/models/EnvelopeOrderField.md", + "documentation/models/DownloadEnvelopeSignedDocumentsParameters.md", + "documentation/models/ListEnvelopeDocumentsResponse.md", + "documentation/models/AddEnvelopeDocumentRequest.md", + "documentation/models/SetEnvelopeDynamicFieldsRequest.md", "documentation/models/DynamicField.md", + "documentation/models/AddEnvelopeSigningStepsRequest.md", + "documentation/models/SetEnvelopeAttachmentsSettingsRequest.md", + "documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md", "documentation/models/AttachmentPlaceholderRequest.md", + "documentation/models/RenameEnvelopeRequest.md", + "documentation/models/SetEnvelopeCommentRequest.md", + "documentation/models/SetEnvelopeExpirationRequest.md", + "documentation/models/SetEnvelopeLegalityLevelRequest.md", + "documentation/models/Annotation.md", "documentation/models/AnnotationType.md", "documentation/models/AnnotationSignature.md", "documentation/models/AnnotationInitials.md", "documentation/models/AnnotationText.md", - "documentation/models/AnnotationDateTime.md", - "documentation/models/AnnotationCheckbox.md", "documentation/models/AnnotationFont.md", "documentation/models/AnnotationFontFamily.md", + "documentation/models/AnnotationDateTime.md", "documentation/models/AnnotationDateTimeFormat.md", + "documentation/models/AnnotationCheckbox.md", "documentation/models/AnnotationCheckboxStyle.md", + "documentation/models/ListEnvelopeDocumentAnnotationsResponse.md", + "documentation/models/AddAnnotationRequest.md", + "documentation/models/Template.md", "documentation/models/TemplateSigningStep.md", "documentation/models/TemplateRecipient.md", "documentation/models/TemplateRecipientRole.md", + "documentation/models/CreateTemplateRequest.md", + "documentation/models/ListTemplatesResponse.md", + "documentation/models/ListTemplatesRequest.md", "documentation/models/TemplateOrderField.md", + "documentation/models/AddTemplateDocumentRequest.md", + "documentation/models/ListTemplateDocumentsResponse.md", + "documentation/models/AddTemplateSigningStepsRequest.md", + "documentation/models/RenameTemplateRequest.md", + "documentation/models/SetTemplateCommentRequest.md", + "documentation/models/ListTemplateAnnotationsResponse.md", + "documentation/models/ListTemplateDocumentAnnotationsResponse.md", + "documentation/models/Webhook.md", "documentation/models/WebhookEvent.md", - "documentation/models/DownloadEnvelopeSignedDocumentsParameters.md", + "documentation/models/CreateWebhookRequest.md", + "documentation/models/ListWebhooksResponse.md", + "documentation/models/ListWebhooksRequest.md", "src/main/java/com/alohi/signplus/json/TypeUtils.java", "examples/pom.xml", "examples/run.sh", @@ -375,8 +458,8 @@ "src/main/java/com/alohi/signplus/http/util/RequestBuilder.java", "examples/README.md", ".env.example", - "src/main/java/com/alohi/signplus/models/EnvelopeLegalityLevel.java", "src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java", + "src/main/java/com/alohi/signplus/models/EnvelopeLegalityLevel.java", "src/main/java/com/alohi/signplus/models/EnvelopeStatus.java", "src/main/java/com/alohi/signplus/models/RecipientRole.java", "src/main/java/com/alohi/signplus/models/RecipientVerificationType.java", @@ -398,39 +481,39 @@ "src/main/java/com/alohi/signplus/models/AddTemplateSigningStepsRequest.java", "src/main/java/com/alohi/signplus/models/RenameTemplateRequest.java", "src/main/java/com/alohi/signplus/models/SetTemplateCommentRequest.java", + "src/main/java/com/alohi/signplus/models/SigningStep.java", + "src/main/java/com/alohi/signplus/models/AttachmentSettings.java", + "src/main/java/com/alohi/signplus/models/DownloadEnvelopeSignedDocumentsParameters.java", "src/main/java/com/alohi/signplus/models/ListEnvelopeDocumentsResponse.java", "src/main/java/com/alohi/signplus/models/AddEnvelopeDocumentRequest.java", "src/main/java/com/alohi/signplus/models/AddEnvelopeSigningStepsRequest.java", "src/main/java/com/alohi/signplus/models/RenameEnvelopeRequest.java", "src/main/java/com/alohi/signplus/models/SetEnvelopeLegalityLevelRequest.java", + "src/main/java/com/alohi/signplus/models/AnnotationSignature.java", + "src/main/java/com/alohi/signplus/models/AnnotationInitials.java", "src/main/java/com/alohi/signplus/models/ListEnvelopeDocumentAnnotationsResponse.java", + "src/main/java/com/alohi/signplus/models/TemplateSigningStep.java", "src/main/java/com/alohi/signplus/models/ListTemplateDocumentsResponse.java", "src/main/java/com/alohi/signplus/models/ListTemplateAnnotationsResponse.java", "src/main/java/com/alohi/signplus/models/ListTemplateDocumentAnnotationsResponse.java", "src/main/java/com/alohi/signplus/models/CreateWebhookRequest.java", "src/main/java/com/alohi/signplus/models/ListWebhooksResponse.java", - "src/main/java/com/alohi/signplus/models/SigningStep.java", - "src/main/java/com/alohi/signplus/models/AttachmentSettings.java", - "src/main/java/com/alohi/signplus/models/AnnotationSignature.java", - "src/main/java/com/alohi/signplus/models/AnnotationInitials.java", - "src/main/java/com/alohi/signplus/models/TemplateSigningStep.java", - "src/main/java/com/alohi/signplus/models/DownloadEnvelopeSignedDocumentsParameters.java", - "src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java", - "src/main/java/com/alohi/signplus/models/ListWebhooksRequest.java", "src/main/java/com/alohi/signplus/models/RecipientVerification.java", "src/main/java/com/alohi/signplus/models/Page.java", + "src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java", "src/main/java/com/alohi/signplus/models/DynamicField.java", "src/main/java/com/alohi/signplus/models/AnnotationCheckbox.java", + "src/main/java/com/alohi/signplus/models/ListWebhooksRequest.java", + "src/main/java/com/alohi/signplus/models/EnvelopeNotification.java", + "src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java", "src/main/java/com/alohi/signplus/models/CreateEnvelopeFromTemplateRequest.java", "src/main/java/com/alohi/signplus/models/ListEnvelopesResponse.java", - "src/main/java/com/alohi/signplus/models/EnvelopeNotification.java", + "src/main/java/com/alohi/signplus/models/AnnotationFont.java", "src/main/java/com/alohi/signplus/models/ListTemplatesResponse.java", "src/main/java/com/alohi/signplus/models/Webhook.java", - "src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java", - "src/main/java/com/alohi/signplus/models/AnnotationFont.java", "src/main/java/com/alohi/signplus/models/AttachmentPlaceholderFile.java", - "src/main/java/com/alohi/signplus/models/CreateEnvelopeRequest.java", "src/main/java/com/alohi/signplus/models/Document.java", + "src/main/java/com/alohi/signplus/models/CreateEnvelopeRequest.java", "src/main/java/com/alohi/signplus/models/TemplateRecipient.java", "src/main/java/com/alohi/signplus/models/Recipient.java", "src/main/java/com/alohi/signplus/models/AttachmentPlaceholderRequest.java", @@ -446,5 +529,195 @@ "src/main/java/com/alohi/signplus/models/ListEnvelopesRequest.java", "documentation/services/SignplusService.md", "src/main/java/com/alohi/signplus/services/SignplusService.java" - ] + ], + "fileHashes": { + ".env.example": "deba3e289e64ed2ccb9169d2739d4db6bf8383b6cdfa5f98abd6f76010df80fd", + ".github/workflows/release.yml": "50655390fdf739b21491738410bc9f966ea689bd967fd7cf5f99e547440ea51c", + ".gitignore": "16c2381047d584e96eb9c89da75b41f24abb5df5e1b9b770321ef9bf9f46b7b4", + ".idea/compiler.xml": "d4b3c50d88d994f6b45771590618d6bb974dd4686aee2207f98e4f2d6425f438", + ".idea/encoding.xml": "c08731aff01601ae1dce0f19fe8f058b750a167cdef4fb92b8ba104eeb7ec038", + ".idea/jarRepositories.xml": "9c794caa37d870d809db42aa629d5232e5f1a9a76593a28a55898244ecbc75a2", + ".idea/misc.xml": "042abf22dfaa2dc7e5f3d7956f778c18bdfb7404f4a9bddd388d49e48e00f90e", + ".idea/workspace.xml": "6ff635cc74e6a8bf1618157a9110c7a70a6d78175e0ca9065f07acdbc75aad26", + "LICENSE": "3ec558dc6e9c9355ab4b28c942caa92bf90b0b82c12d7838d2ef92467ad135c1", + "README.md": "5f4ba91c2bef8e4404bb386783e5fe2bbdd2fbde955070987b454aeb63ef57c6", + "documentation/models/AddAnnotationRequest.md": "1822f9d7a78452d5b2ee3bce87f8b056e73605368e282edfb964002bd57cb919", + "documentation/models/AddEnvelopeDocumentRequest.md": "790891c96ed5bf90452cdb3f60780b35d5291826da957eedab5cfbbb31ce5eef", + "documentation/models/AddEnvelopeSigningStepsRequest.md": "20c5f3d66847e9d27b77c9cd5174663c161e3fe1018364730048981faa5d93a8", + "documentation/models/AddTemplateDocumentRequest.md": "3695a69ede62f33c9e5bf69637b91fdb0c35227536572dee61a88630c5355c33", + "documentation/models/AddTemplateSigningStepsRequest.md": "ce76e3ae564967eb0307a4ddd4c9f961774a766128a06cc6f76ee241b3bfa4c2", + "documentation/models/Annotation.md": "6d970dfa833705a58d586df43a17e3639d8187f29a7120d3d4e167ba433e0537", + "documentation/models/AnnotationCheckbox.md": "0fc35b9bc12dc2cf494016e7d72196ed79be22f81a3c58237275d5676ea75849", + "documentation/models/AnnotationCheckboxStyle.md": "9c5732b22525d686ab724ce93848ff6672791e2128bc4214fbe4f10546368821", + "documentation/models/AnnotationDateTime.md": "88b269668dde28d6560ae6d7ac3bf35612f53bb2a5932f3edeb767577a3a9600", + "documentation/models/AnnotationDateTimeFormat.md": "a39bfcd57cdae80a6390682af7f287c28d963161a8bb4def1adeb812109f488c", + "documentation/models/AnnotationFont.md": "b56d1938fe3d8e8d23d0be6f0d0350318652972da4840e4ec04dd42249a741f8", + "documentation/models/AnnotationFontFamily.md": "9a6e3513f1d0abab964c9810cd0e60fe2f96967b2d23c645bde4fd7e63c99ff1", + "documentation/models/AnnotationInitials.md": "b79ac5163d05a8b588cd502cacfbb89b57bdeb7611cd0f2d575cb4ca61ad28b7", + "documentation/models/AnnotationSignature.md": "7ba44a393894d0732900d73f42ab81fcea984245feb8e16de6be5e3f770d085e", + "documentation/models/AnnotationText.md": "1fc3489b65fc030517734a6f387d43a379a7209cbd057b0a7a1f14abd8a9db4c", + "documentation/models/AnnotationType.md": "f0c5d796d61da29a051d41e2a1b2b1bc3885e7a7ff3ebee845c6e875d06de4e8", + "documentation/models/AttachmentPlaceholder.md": "becd3c408998810f2ba6e88aeeaf6f575a082833e7e19dd654ece343761b8ac8", + "documentation/models/AttachmentPlaceholderFile.md": "79321dbf5eb36ad54a56b9bb5312b9bb5d24f098cba86e8a7da048c0fd842a10", + "documentation/models/AttachmentPlaceholderRequest.md": "0de74f240998cf31d9b953dde4bfe01978ca1ee4bcd6febb3e72eb3cf4a48325", + "documentation/models/AttachmentPlaceholdersPerRecipient.md": "ca3e535ca0989d2383b42b56eba4270d84a01e23dd0cd8f53e7501edae0ed9b3", + "documentation/models/AttachmentSettings.md": "d357529ce7a784ec4284741c30c932098a34a3a07496ccd7bad5e1d230e7902a", + "documentation/models/CreateEnvelopeFromTemplateRequest.md": "e52ba257a88d8a080005a0a480eda61e59ed3d65f79d836ab95ed95f24a6f44e", + "documentation/models/CreateEnvelopeRequest.md": "4926c4ca567d8a6f7c5319ab13b851513cb7dd9c6bd78e208360a5ada3f08aff", + "documentation/models/CreateTemplateRequest.md": "80d58ac01c40353adc2f9e15ad71cc8be4794e991eb943af2a85727980a19d75", + "documentation/models/CreateWebhookRequest.md": "b71010667a79453e23b3fda135f8f9c82e0ba4125fea8d13b4073b8aba5d5f5d", + "documentation/models/Document.md": "be981674318ecf7626656905c2f79673e263aaec0072f9503eb933a943cabaa3", + "documentation/models/DownloadEnvelopeSignedDocumentsParameters.md": "f35650531132f2c104cede96925b956261621fc41a43efd02fe42f8eef9009da", + "documentation/models/DynamicField.md": "e36f012e14464f6cfee11242c00bf734c70457613cc0456bbbcc4beb252e0bb9", + "documentation/models/Envelope.md": "4622b3b4702d560365ba63834ab90bfe0466e85036a7fd2b8f327a569bdbf0d9", + "documentation/models/EnvelopeAttachments.md": "81ab2f35528666538dc3148f2f95b764e11ace58d85856f4ab5a71e9a1746166", + "documentation/models/EnvelopeFlowType.md": "a52f49c8488cb0d6c6c4e445f1a5a2e58147a4a608083756276341002a658be3", + "documentation/models/EnvelopeLegalityLevel.md": "84f1ae4c383abc293b45d92b9b53fe02bb8f02019d8b1c5ffc7f3ef05f698575", + "documentation/models/EnvelopeNotification.md": "5004e2754c8b923f8fa49c4b64cabba1496515f8260275908556e74a598f3a4e", + "documentation/models/EnvelopeOrderField.md": "f12890e4bad097bcbce03e7fd689bc3360915d6c5c19a691e3a4ec0ea4624481", + "documentation/models/EnvelopeStatus.md": "d3195b5be478ae8eab4c841a5a84b0706a2965011d994052105fae514d73fbd1", + "documentation/models/ListEnvelopeDocumentAnnotationsResponse.md": "da5f552e2aa3c7e6fbbf3c393b90ef07dd3519dfc698df79beca6ae3b370e715", + "documentation/models/ListEnvelopeDocumentsResponse.md": "5744c764a54103f31b2458e9f190fb51f79db3ed5087d581c6620c4b8642d4ac", + "documentation/models/ListEnvelopesRequest.md": "4eb025dd911c39ca8fd10707eb0bad75b212ea17e936c7fd9d39bdbfc512581c", + "documentation/models/ListEnvelopesResponse.md": "5b7c3ccf91c218d5d4e340a074c9d9de95fa53f4f916d15f1a7eb5fbba5c4ea0", + "documentation/models/ListTemplateAnnotationsResponse.md": "84aaeaaa5b6582792de95680784737328a85d9d147eaec5ed222b66fcb11249e", + "documentation/models/ListTemplateDocumentAnnotationsResponse.md": "8c5e7b712c4f544620dd9224cb6f36b4725b3eb1ffc75ae869b5848ecb26ed23", + "documentation/models/ListTemplateDocumentsResponse.md": "26e88c61f710f17939a037fc3c05ec550d61def6f74f23c49cc3c5abb8742d2d", + "documentation/models/ListTemplatesRequest.md": "7491e9bfd6dae44900d81604b4411fcb5e737da30aab12ebf849f1708786902d", + "documentation/models/ListTemplatesResponse.md": "7091cec03dcebdd4ee94ffa3abfb06d7f29f17ce360b26b0814f11349e89942f", + "documentation/models/ListWebhooksRequest.md": "7b22965b9a4e4d3e8c9a9dea95afe2f7247fc89274dc5e76035b88e2e580eb45", + "documentation/models/ListWebhooksResponse.md": "3b56c18f262218a963bf94ae2bea73c4d026a9e6b9a5ef2c6a049bb292c85ba8", + "documentation/models/Page.md": "18ad08ae751ee73b31218699656b04c196e5db76a4ffc14bf67376ceaa8c34d3", + "documentation/models/Recipient.md": "dceeefa2a1ee4f394cf10ea11c86ae274cc7766976d3c0f22af393dd7b6ddcf3", + "documentation/models/RecipientRole.md": "67d3c22ff15e5e11ccf5be47efe320d1ea31018cab371fea5e088d83d3eed10d", + "documentation/models/RecipientVerification.md": "c7c326b19635fbe106ae30e5935d32c5e557d4ea8e2eb1b83cf2067e3fac60a7", + "documentation/models/RecipientVerificationType.md": "5776f1d165673ee7f588e351d1875c2216371e62719cf78e7dcf4584c0a4454a", + "documentation/models/RenameEnvelopeRequest.md": "3dd466b58e842f32665f0803439c02001d38bc958ac3503e6d64f67f0fe61dde", + "documentation/models/RenameTemplateRequest.md": "7c9181b76aa7bd2bddb42c2bc0e46e4f030eb21bc1633c441812b00b4ddc5248", + "documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md": "46b6bacbff01cd7e870c0acf7a2400648dac407a2bf3b395b68579156e2385d6", + "documentation/models/SetEnvelopeAttachmentsSettingsRequest.md": "fd716156384b28055ce14bb303fc1b9e1811985d9ae13a8ddb0aec44059920e6", + "documentation/models/SetEnvelopeCommentRequest.md": "44978e4dca59b4e892cddf11f8cad6dbf7fb46a781b57cb52191c0a08a828c69", + "documentation/models/SetEnvelopeDynamicFieldsRequest.md": "996bac33749c4535ab3ca3703cbfd5625d7fbc057e6d5bd9a486dbfd61dfb412", + "documentation/models/SetEnvelopeExpirationRequest.md": "ac63fb6495c4b652ef73d4dc3b838c454b67cbc9158f51ad614a155cc792bd00", + "documentation/models/SetEnvelopeLegalityLevelRequest.md": "949dd28d1dad27580e65819beedd5977d2d2bec3ceef2760f44d41138aada1f7", + "documentation/models/SetTemplateCommentRequest.md": "d0d6826ecf3854fdc62cc08b520c33bc6150780f671310ce0479b3d0988b4ba9", + "documentation/models/SigningStep.md": "6b70e09c0ae98067cd09c595ef630b508542ab5b6cbc15b5749b3d3bc899d9cd", + "documentation/models/Template.md": "3caaf370e5730a9b14e4defb70e3d086026e27ad20457d802959c4e0c92e5529", + "documentation/models/TemplateOrderField.md": "dcb52be30f8fd7448b6eb93dcb1097125f0404e90c58d5bd2544f064c3238778", + "documentation/models/TemplateRecipient.md": "c236d1292a7f58a3f13a14f30c949388052d613e895a9f8733bffaa6bfc09ff3", + "documentation/models/TemplateRecipientRole.md": "45fe5aa20340b38f97ab93835aa80e824934bb5f2af7913641bd35ea626cc086", + "documentation/models/TemplateSigningStep.md": "1ba26035141f006c3cf321ff789f7590253582d22a2b7b85f3612c9842f50b02", + "documentation/models/Webhook.md": "75bd77b2e7cbb64579e5fdcfdf93f0e62e2e4aadd04779cbab405565ec5a5a5f", + "documentation/models/WebhookEvent.md": "859455632fbdb76aafe580c237d25a053ed531ddde36f5039694dd865f118e79", + "documentation/services/SignplusService.md": "25cb0c7e1c3dcfa4511b3d038561c279a328a83b2896573156ec0388092ef1e1", + "documentation/snippets/snippets.json": "e9f76f36528b90ed48511824ff593e38c0dbbd9315f1701f15809814c36a7e8c", + "examples/.gitignore": "16c2381047d584e96eb9c89da75b41f24abb5df5e1b9b770321ef9bf9f46b7b4", + "examples/README.md": "ddd772dbadc462f6282630590c80ef5ffe87b10fc4b03b4d5d83490342efc810", + "examples/pom.xml": "d49f63a048dfa5922ae6e3044d9f3539e3970d3234bb5c4dbf8d5fc620170e2f", + "examples/run.sh": "b421122e2d707b60e35b125a39a47dd9b1bec16d241aec1ba5a7357816e4757b", + "examples/src/main/java/com/example/Main.java": "cde24ae9d2a0b0db7a62e537de0594fb6aef8b6cfeef7509c19abff4170b4620", + "pom.xml": "f170105127933e636b8f797c9ff5ebaa57df4cf159c3e025e8e848e84e5e43e9", + "prettier.config.js": "b3f990b4c84640a705ded29e3343d8e3d70ddc4b88431d10d47c23f568470cfd", + "src/main/java/com/alohi/signplus/Signplus.java": "eafb3e0d0efe75045e00ff431f24c95d8562718ff098d54383220e813c0273ce", + "src/main/java/com/alohi/signplus/config/RequestConfig.java": "2597667c8f714cafd98d85059f8dd75dfeea46101b182642a4784348053c2a31", + "src/main/java/com/alohi/signplus/config/RetryConfig.java": "5d6df73c5ea367c9166673a2d44139f97695b45e1e8f8a4d6819fe8925998c0b", + "src/main/java/com/alohi/signplus/config/SignplusConfig.java": "f6f23be3f0afc298d903014dad72b965692f3c4892ae3e4d0178b3b70c2484dc", + "src/main/java/com/alohi/signplus/exceptions/ApiError.java": "312f64e9dbfff531ea8b38c0c61b36c3ae712178413281e30b1e7e8e9cf00ca8", + "src/main/java/com/alohi/signplus/http/Environment.java": "7edc7ec7383d5de29c417b98df6f83c71f733a6b34661dc6b6f271b35fa348b2", + "src/main/java/com/alohi/signplus/http/HttpMethod.java": "c470ae597b5d102ba84f06929b8369dda70bc8a53ae999ffc9adbb69be898a57", + "src/main/java/com/alohi/signplus/http/ModelConverter.java": "8d9e1bea43970262dd801cf0179e7a168ca0f3c0b07439f853dfe869aad877e9", + "src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java": "152cf31f575ad923bdd8124e808b86ea991f9ca3f36b2213fb05076c74bbfb52", + "src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java": "7d56f2279b522a1bfc4ec41ec27448fe3cb5d97c5eef7facaf5f93a4990f86d7", + "src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java": "9e905d4790f03ae7ae7feb921a0afda2f5e1256784615c86c33910e2e2914fb2", + "src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java": "54bff8afe4cf081e5fa7790f55ade53200d6515fec66c362d21fbb85aba0d5b3", + "src/main/java/com/alohi/signplus/http/serialization/SerializationStyle.java": "3ce00d1a99b56278564ec8913ab253cccc161dc8da1a7dfe3dc3104a08895b0d", + "src/main/java/com/alohi/signplus/http/serialization/Serializer.java": "d20a56aca861769ec39376db4f4c7af69fade46c53b14f42072f5912b5716361", + "src/main/java/com/alohi/signplus/http/serialization/Util.java": "cbbb4e6f41b24b3d9dbf809e452818998b7837325f35253b872cd72e3d287fd6", + "src/main/java/com/alohi/signplus/http/util/ContentTypes.java": "62597c440f204b3c474ffe8e8c478c958788d67f3387e0c2a736048b15d06666", + "src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java": "9daa5274be889765855bde64871f94c73b23279069f4e4b257cb3b16a39c998c", + "src/main/java/com/alohi/signplus/http/util/RequestBuilder.java": "8db3b4f2e96d81773a0b4bb264e471d4249d10261bc590f4cce9d7db455b7770", + "src/main/java/com/alohi/signplus/json/TypeUtils.java": "3a776d11bef57b42a42fb16082879b5b2928c93aa8cfd2049ea4a2b6eeff6e27", + "src/main/java/com/alohi/signplus/models/AddAnnotationRequest.java": "ba0e87dc4d0aec9b19b37cc53a0ac115a1e8295f696ccaf35471fd39e608dddc", + "src/main/java/com/alohi/signplus/models/AddEnvelopeDocumentRequest.java": "9142806c2499c5a83691c4b86fbe31d544eea72e56f54da664eb7b1ee41e8b4c", + "src/main/java/com/alohi/signplus/models/AddEnvelopeSigningStepsRequest.java": "0d73bdffdcce633c737811e153f2ffc94d605413e84847183bd52f5af5b93afa", + "src/main/java/com/alohi/signplus/models/AddTemplateDocumentRequest.java": "3bbc927973e85042a1e9128b84fb7c96cd5b129a2d5859a346e8997303a63194", + "src/main/java/com/alohi/signplus/models/AddTemplateSigningStepsRequest.java": "2f8f158efd225189023cf409266548854fdf7c1bc8d206ff15d0aa2bde875237", + "src/main/java/com/alohi/signplus/models/Annotation.java": "704a15875ec6ad4f97b50b8b01df40e47c2d74823158f7bcf1f4bcfa9ab70f74", + "src/main/java/com/alohi/signplus/models/AnnotationCheckbox.java": "444ecc13c18358720eef17e4145aace7911d027d5a211acd6d3736da5291e2b5", + "src/main/java/com/alohi/signplus/models/AnnotationCheckboxStyle.java": "21b88d94b7fed265feca2d7e8a654879c010680667606813b5af7d0187526d2f", + "src/main/java/com/alohi/signplus/models/AnnotationDateTime.java": "dcdc2660635e79e14dd25260ae8c7305484065271e0c8dd09753d0cf251ca320", + "src/main/java/com/alohi/signplus/models/AnnotationDateTimeFormat.java": "7e0b3fa42be03ea943f0340331edfadfb5c25df768fd3af3cd6ee7d884f68378", + "src/main/java/com/alohi/signplus/models/AnnotationFont.java": "d48d9fe039a1aa5038e6fee2cd45cec96d6349e618ec90a2dba7fc1c28cc77f8", + "src/main/java/com/alohi/signplus/models/AnnotationFontFamily.java": "926885a2ecefa210d6d527bfb7965aecfe04172b3dee12629deb63b8f1da9fbc", + "src/main/java/com/alohi/signplus/models/AnnotationInitials.java": "274413c638c9cea9b2fa53e929fb5f99b18536672a5a122f43102126cb29fb58", + "src/main/java/com/alohi/signplus/models/AnnotationSignature.java": "38828fafdfe9b0ec0e8f18a0add9996e4f5790ce6ce37729d93906f133901be0", + "src/main/java/com/alohi/signplus/models/AnnotationText.java": "cb5b9efe1d56d5e24e2230f83b766dc5fc5394729e6910553afacb177eabd9ec", + "src/main/java/com/alohi/signplus/models/AnnotationType.java": "f684b855291dc096d3473c768674a5cdbdbde5bd289c03c399d8ae5d5a40b6f9", + "src/main/java/com/alohi/signplus/models/AttachmentPlaceholder.java": "af8f3d568890c6ca41c6358cb35a3e5ea9890d05a89b48db1a2ad6d9e2c303a5", + "src/main/java/com/alohi/signplus/models/AttachmentPlaceholderFile.java": "e0732f5c021e89daa964dacbeacad70ac1fbb5e910c2ad5e9e749e5dc9c4263a", + "src/main/java/com/alohi/signplus/models/AttachmentPlaceholderRequest.java": "a165123bb5db371e0bd5308fa9d3f0043565578461c98c957ad1df6ed58ab110", + "src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java": "7f53b532dd6ed891403ced328b21844731fd7716633efd9fff70188fa1b8bf6a", + "src/main/java/com/alohi/signplus/models/AttachmentSettings.java": "44a282950bb38b01d5f5c122d83ced395476e9ed8c8c708ac5778cb7a93688d3", + "src/main/java/com/alohi/signplus/models/CreateEnvelopeFromTemplateRequest.java": "10c71f7fccec0a54c1f3291b964a408ab48cbf3fe9801f01c10ad9c2ac57b39a", + "src/main/java/com/alohi/signplus/models/CreateEnvelopeRequest.java": "a7c049092a83fdd37614be22f3046139917ec524d53d0ca074a731ec56e655bb", + "src/main/java/com/alohi/signplus/models/CreateTemplateRequest.java": "ada685ddc2ca4060235569408a645aec95b71e8e1d0e482d43d20f635f30d5db", + "src/main/java/com/alohi/signplus/models/CreateWebhookRequest.java": "0535a41d94089165b4601c6428cfc2c7bc93fe8650aa836a6494fbc2b53370d7", + "src/main/java/com/alohi/signplus/models/Document.java": "b5ff10b4dd8438c2ec73cf3e0b14420154606dd54745c4e4cffcf627994908c2", + "src/main/java/com/alohi/signplus/models/DownloadEnvelopeSignedDocumentsParameters.java": "094bcb8bc0ea0900c4b14e844a7ca0b1cdc9d24ce372ed8451f9864dfc134845", + "src/main/java/com/alohi/signplus/models/DynamicField.java": "37fd4113cb5add24cce9f353f7b6b91f842e80a1af7b2e272033604515a9ea35", + "src/main/java/com/alohi/signplus/models/Envelope.java": "27a1bf0a2c2106ad855c33c3cc06fbc474937cc5c98587e58e52841ef9544dbf", + "src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java": "7500a53103a03da81efbf201423956446154dc3c11ee69fc748ae70451e1e3d2", + "src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java": "f35d67ad3b3cd68bc5722a94ee354849f811c30f619a11f715f0e25bf09be35d", + "src/main/java/com/alohi/signplus/models/EnvelopeLegalityLevel.java": "71f10a582d1736c9e3a5d97acc3fc33042dbe656a7c1d5a56cdc9460a9b63683", + "src/main/java/com/alohi/signplus/models/EnvelopeNotification.java": "5b5e0c6a11c09957f86e91e63a4c5f1b316c4b1bbd8c1d2cb804db53ebb955bb", + "src/main/java/com/alohi/signplus/models/EnvelopeOrderField.java": "0c6456da1efddd498d865140b9568bf50bc9506f39e68c94517c93ecf45b31ed", + "src/main/java/com/alohi/signplus/models/EnvelopeStatus.java": "0e449692643fa94191cd313780c0706b591eb18b4ef5504173e245c6e68794fb", + "src/main/java/com/alohi/signplus/models/ListEnvelopeDocumentAnnotationsResponse.java": "943502797d806f765b1df380b3dca52b4f9aeee68d4d8c5efe53c2bf4c9d252b", + "src/main/java/com/alohi/signplus/models/ListEnvelopeDocumentsResponse.java": "3803a638bc3ac63b7fbee9ff34a4eda637378a70b0c9d9d3cae51e894d1b3754", + "src/main/java/com/alohi/signplus/models/ListEnvelopesRequest.java": "fc48b75676b8b63addb20c593fb5dbd91616e12160e9351c0b6e3f3db5b53203", + "src/main/java/com/alohi/signplus/models/ListEnvelopesResponse.java": "0bf8bbd4f4987d7d7207deec047541c05c6e47ead42977d55e364c1cd7eaeb5f", + "src/main/java/com/alohi/signplus/models/ListTemplateAnnotationsResponse.java": "8f806163ef58459b35f716307e905ee4c33a3e10f440aca14e40761e6429bc24", + "src/main/java/com/alohi/signplus/models/ListTemplateDocumentAnnotationsResponse.java": "f6ff42796114269bb95e87dd0334ebffd7b233a4e4b97dd497f7c40b50ff9077", + "src/main/java/com/alohi/signplus/models/ListTemplateDocumentsResponse.java": "bce0b6e654a6bbc3a4e408c3d4966ce62c626314384ec6a26ae51e211aafdda0", + "src/main/java/com/alohi/signplus/models/ListTemplatesRequest.java": "c7b59a0c40aad4d9ccd92e1e74d9a6ab15ed9ef05f43aa34a9af5ff41f939699", + "src/main/java/com/alohi/signplus/models/ListTemplatesResponse.java": "5e3f80b4d41016f624c8397ff8fcc84a2fb27be803140bf4d39e272ba6111cdf", + "src/main/java/com/alohi/signplus/models/ListWebhooksRequest.java": "3c1bd896a85ba40aa73addbe3568b581061295e38ead171f9740cb4edeae7bc7", + "src/main/java/com/alohi/signplus/models/ListWebhooksResponse.java": "d6348e83b14774c6abd9e25ca4e3d0a073c38b95ab731bad673b21baf50dccef", + "src/main/java/com/alohi/signplus/models/Page.java": "af8ad35ac79c763376a7d9880b0d38005174f2e6553bdd78cb74dd3fce6ca6aa", + "src/main/java/com/alohi/signplus/models/Recipient.java": "6c486f0b5fc5e121ec4630c28567c8914f60baa88a30cb5beaab570e78b04e50", + "src/main/java/com/alohi/signplus/models/RecipientRole.java": "23cf8893a14c76c486d4425a4e05122a1d41623f58f8b59d381d10702b071717", + "src/main/java/com/alohi/signplus/models/RecipientVerification.java": "c97ee9d2f1c1452c52cddc59b076dca588ebf6d6da2903ee81754d08f3df661c", + "src/main/java/com/alohi/signplus/models/RecipientVerificationType.java": "af5044771fc5b2f3eea2078cc1f203ae9d026fce8926b79fdc515bc0988a3f43", + "src/main/java/com/alohi/signplus/models/RenameEnvelopeRequest.java": "fc0a7dcba97e91be7a3482cabe16dfbfc83051758e41e5883f3466ae12c46ade", + "src/main/java/com/alohi/signplus/models/RenameTemplateRequest.java": "a2553a57d86ea92d4afe2cbba1ba3d09ec4b659c5dda8d6ea667fd5ff0818ac1", + "src/main/java/com/alohi/signplus/models/SetEnvelopeAttachmentsPlaceholdersRequest.java": "3a1aa5f16ba3df8635d6d965c3e964546b9b824ec5b707d4fa02ddc52fbdc0ab", + "src/main/java/com/alohi/signplus/models/SetEnvelopeAttachmentsSettingsRequest.java": "353a5bd5416312488b1a97a69426b0d64fa7309148664628f9ff52d1912989ac", + "src/main/java/com/alohi/signplus/models/SetEnvelopeCommentRequest.java": "9924228272bad803b4e73da242627cb29e78a3182d0f706b362156ac3bce043b", + "src/main/java/com/alohi/signplus/models/SetEnvelopeDynamicFieldsRequest.java": "17b1f3b886af05322efe36c270b930ee8319ebc678fbd9af1bdac2988b7fead2", + "src/main/java/com/alohi/signplus/models/SetEnvelopeExpirationRequest.java": "d383b50cbd69890398f14c10693b23d45b436679b21dd506e79cf1ac87577032", + "src/main/java/com/alohi/signplus/models/SetEnvelopeLegalityLevelRequest.java": "d3d5681cc7386fb387bd0f448942d1d85ee28d817f1e42892af496b0755670e7", + "src/main/java/com/alohi/signplus/models/SetTemplateCommentRequest.java": "019ce1b7c668fc4a0d87237c500c3b85b24a554d07165a26da07e8b5995f1ee6", + "src/main/java/com/alohi/signplus/models/SigningStep.java": "4f4c0476981753e18ec6b9dfbf2bc877eb8f720a7c02dd82b261eb0b5c255595", + "src/main/java/com/alohi/signplus/models/Template.java": "2d2cc43f5abe85ad55ba1c7b32477b5fd5403062495fd92766e96655ecc1da6f", + "src/main/java/com/alohi/signplus/models/TemplateOrderField.java": "37f4ac647bca16fe88e7df158784dd41a59d90c926f2b708de58a7df1cd256ee", + "src/main/java/com/alohi/signplus/models/TemplateRecipient.java": "44b2853c0118ead1e26c88af58492ee2f843acadcadecc7a5866765a857cba5d", + "src/main/java/com/alohi/signplus/models/TemplateRecipientRole.java": "56452548fe6ee077b0813d80c09ac40fd0af14f9b7d79752bc5726d09a4b1a90", + "src/main/java/com/alohi/signplus/models/TemplateSigningStep.java": "87410a2a7916fe4e19b9fb53e101d71863038c2fae6ad06acac37c805008cb90", + "src/main/java/com/alohi/signplus/models/Webhook.java": "55b2132bd87fcb3c909c27b2de1bdf524ff96bc509f3275102a4de3a384115b2", + "src/main/java/com/alohi/signplus/models/WebhookEvent.java": "61a974ec52a8508e544b1cb1b80c157e3aaab99f453a34868b2eeb60d486b976", + "src/main/java/com/alohi/signplus/services/BaseService.java": "0f2f23ff12bb807440057f4d997538bddbc102ec5c331d606ebd06ae680108a4", + "src/main/java/com/alohi/signplus/services/SignplusService.java": "b7f3191fc35d88fdf5aeb884514e51ccd204ad3fe3e270051ba5074c51a307cc", + "src/main/java/com/alohi/signplus/validation/Violation.java": "02ca55a4fae380775b3795810ba1ad4d655cd97d5b1bba5acc4f96617ffb6350", + "src/main/java/com/alohi/signplus/validation/ViolationAggregator.java": "945043886a7c657017db23c5cbe18884411c977a7e978bc24489bd0d0d9c59b1", + "src/main/java/com/alohi/signplus/validation/exceptions/ValidationException.java": "9a4a9895a4b6d0d5d5d702c48caded2dbe7a83eed5d137cc551b1d1c67e46172", + "src/main/java/com/alohi/signplus/validation/validators/AbstractValidator.java": "2c2509fd549df9de306d929387e73e32716695976b8627fa3b6561ca656eba85", + "src/main/java/com/alohi/signplus/validation/validators/ListValidator.java": "c03f599639b4707dbec212ff0ade43280dd75e31614cf776ff2507e0d00dbeb6", + "src/main/java/com/alohi/signplus/validation/validators/NumericValidator.java": "b5e24156c72a2c291ef01203d8dfe35ee0596c8696baabc58f845bd768caa915", + "src/main/java/com/alohi/signplus/validation/validators/StringValidator.java": "b560dcbb9b122e32f08cf538c49e09b7f031cd406c3a5fd36b849fe43f3a0721", + "src/main/java/com/alohi/signplus/validation/validators/Validator.java": "0290ff09377dcc295bd63127cc9ce7438033fa3828b73b25127dd3fdf801f04d", + "src/main/java/com/alohi/signplus/validation/validators/modelValidators/AbstractModelValidator.java": "00d24eb9a593324e2c7f9b1f9b46c51759046d528d8898662ee3652de9c13021", + "src/main/java/com/alohi/signplus/validation/validators/modelValidators/CreateEnvelopeFromTemplateRequestValidator.java": "4c254226560bfcf0350c60f0b33fcce8062b1f9b8b0bd027146f41be85491c34", + "src/main/java/com/alohi/signplus/validation/validators/modelValidators/CreateEnvelopeRequestValidator.java": "a630bf672e46d8567ca64cd0e238a2eef7397160fedfadc0781cb202185472fd", + "src/main/java/com/alohi/signplus/validation/validators/modelValidators/CreateTemplateRequestValidator.java": "05c32a07913be579f19866ff241b3a25f0f088ecc634f38d0472fb139136a638" + } } diff --git a/LICENSE b/LICENSE index 2be0553..3cef8a0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 +Copyright (c) 2026 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a83e8ba..554ae23 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -# Signplus Java SDK 2.4.0 +# Signplus Java SDK 4.0.0 Welcome to the Signplus SDK documentation. This guide will help you get started with integrating and using the Signplus SDK in your project. -[![This SDK was generated by liblab](https://raw.githubusercontent.com/liblaber/liblab-assets/main/assets/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme) - ## Versions - API version: `2.5.0` -- SDK version: `2.4.0` +- SDK version: `4.0.0` ## About the API @@ -40,14 +38,14 @@ If you use Maven, place the following within the _dependency_ tag in your `pom.x com.alohi signplus - 2.4.0 + 4.0.0 ``` If you use Gradle, paste the next line inside the _dependencies_ block of your `build.gradle` file: ```Gradle -implementation group: com.alohi, name: signplus, version: 2.4.0 +implementation("com.alohi:signplus:4.0.0") ``` If you use JAR files, package the SDK by running the following command: @@ -162,74 +160,74 @@ The SDK includes several models that represent the data structures used in API r | Name | Description | | :------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [CreateEnvelopeRequest](documentation/models/CreateEnvelopeRequest.md) | | | [Envelope](documentation/models/Envelope.md) | | -| [CreateEnvelopeFromTemplateRequest](documentation/models/CreateEnvelopeFromTemplateRequest.md) | | -| [ListEnvelopesRequest](documentation/models/ListEnvelopesRequest.md) | | -| [ListEnvelopesResponse](documentation/models/ListEnvelopesResponse.md) | | -| [Document](documentation/models/Document.md) | | -| [ListEnvelopeDocumentsResponse](documentation/models/ListEnvelopeDocumentsResponse.md) | | -| [AddEnvelopeDocumentRequest](documentation/models/AddEnvelopeDocumentRequest.md) | | -| [SetEnvelopeDynamicFieldsRequest](documentation/models/SetEnvelopeDynamicFieldsRequest.md) | | -| [AddEnvelopeSigningStepsRequest](documentation/models/AddEnvelopeSigningStepsRequest.md) | | -| [SetEnvelopeAttachmentsSettingsRequest](documentation/models/SetEnvelopeAttachmentsSettingsRequest.md) | | -| [EnvelopeAttachments](documentation/models/EnvelopeAttachments.md) | | -| [SetEnvelopeAttachmentsPlaceholdersRequest](documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md) | | -| [RenameEnvelopeRequest](documentation/models/RenameEnvelopeRequest.md) | | -| [SetEnvelopeCommentRequest](documentation/models/SetEnvelopeCommentRequest.md) | | -| [EnvelopeNotification](documentation/models/EnvelopeNotification.md) | | -| [SetEnvelopeExpirationRequest](documentation/models/SetEnvelopeExpirationRequest.md) | | -| [SetEnvelopeLegalityLevelRequest](documentation/models/SetEnvelopeLegalityLevelRequest.md) | | -| [Annotation](documentation/models/Annotation.md) | | -| [ListEnvelopeDocumentAnnotationsResponse](documentation/models/ListEnvelopeDocumentAnnotationsResponse.md) | | -| [AddAnnotationRequest](documentation/models/AddAnnotationRequest.md) | | -| [CreateTemplateRequest](documentation/models/CreateTemplateRequest.md) | | -| [Template](documentation/models/Template.md) | | -| [ListTemplatesRequest](documentation/models/ListTemplatesRequest.md) | | -| [ListTemplatesResponse](documentation/models/ListTemplatesResponse.md) | | -| [AddTemplateDocumentRequest](documentation/models/AddTemplateDocumentRequest.md) | | -| [ListTemplateDocumentsResponse](documentation/models/ListTemplateDocumentsResponse.md) | | -| [AddTemplateSigningStepsRequest](documentation/models/AddTemplateSigningStepsRequest.md) | | -| [RenameTemplateRequest](documentation/models/RenameTemplateRequest.md) | | -| [SetTemplateCommentRequest](documentation/models/SetTemplateCommentRequest.md) | | -| [ListTemplateAnnotationsResponse](documentation/models/ListTemplateAnnotationsResponse.md) | | -| [ListTemplateDocumentAnnotationsResponse](documentation/models/ListTemplateDocumentAnnotationsResponse.md) | | -| [CreateWebhookRequest](documentation/models/CreateWebhookRequest.md) | | -| [Webhook](documentation/models/Webhook.md) | | -| [ListWebhooksRequest](documentation/models/ListWebhooksRequest.md) | | -| [ListWebhooksResponse](documentation/models/ListWebhooksResponse.md) | | -| [EnvelopeLegalityLevel](documentation/models/EnvelopeLegalityLevel.md) | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | | [EnvelopeFlowType](documentation/models/EnvelopeFlowType.md) | Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) | +| [EnvelopeLegalityLevel](documentation/models/EnvelopeLegalityLevel.md) | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | | [EnvelopeStatus](documentation/models/EnvelopeStatus.md) | Status of the envelope | | [SigningStep](documentation/models/SigningStep.md) | | | [Recipient](documentation/models/Recipient.md) | | | [RecipientRole](documentation/models/RecipientRole.md) | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | | [RecipientVerification](documentation/models/RecipientVerification.md) | | | [RecipientVerificationType](documentation/models/RecipientVerificationType.md) | Type of verification the recipient must complete before accessing the envelope. - `PASSCODE`: requires a code to be entered. - `SMS`: sends a code via SMS. - `ID_VERIFICATION`: prompts the recipient to complete an automated ID and selfie check. | +| [Document](documentation/models/Document.md) | | | [Page](documentation/models/Page.md) | | +| [EnvelopeNotification](documentation/models/EnvelopeNotification.md) | | +| [EnvelopeAttachments](documentation/models/EnvelopeAttachments.md) | | | [AttachmentSettings](documentation/models/AttachmentSettings.md) | | | [AttachmentPlaceholdersPerRecipient](documentation/models/AttachmentPlaceholdersPerRecipient.md) | | | [AttachmentPlaceholder](documentation/models/AttachmentPlaceholder.md) | | | [AttachmentPlaceholderFile](documentation/models/AttachmentPlaceholderFile.md) | | +| [CreateEnvelopeRequest](documentation/models/CreateEnvelopeRequest.md) | | +| [CreateEnvelopeFromTemplateRequest](documentation/models/CreateEnvelopeFromTemplateRequest.md) | | +| [ListEnvelopesResponse](documentation/models/ListEnvelopesResponse.md) | | +| [ListEnvelopesRequest](documentation/models/ListEnvelopesRequest.md) | | | [EnvelopeOrderField](documentation/models/EnvelopeOrderField.md) | Field to order envelopes by | +| [DownloadEnvelopeSignedDocumentsParameters](documentation/models/DownloadEnvelopeSignedDocumentsParameters.md) | | +| [ListEnvelopeDocumentsResponse](documentation/models/ListEnvelopeDocumentsResponse.md) | | +| [AddEnvelopeDocumentRequest](documentation/models/AddEnvelopeDocumentRequest.md) | | +| [SetEnvelopeDynamicFieldsRequest](documentation/models/SetEnvelopeDynamicFieldsRequest.md) | | | [DynamicField](documentation/models/DynamicField.md) | | +| [AddEnvelopeSigningStepsRequest](documentation/models/AddEnvelopeSigningStepsRequest.md) | | +| [SetEnvelopeAttachmentsSettingsRequest](documentation/models/SetEnvelopeAttachmentsSettingsRequest.md) | | +| [SetEnvelopeAttachmentsPlaceholdersRequest](documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md) | | | [AttachmentPlaceholderRequest](documentation/models/AttachmentPlaceholderRequest.md) | | +| [RenameEnvelopeRequest](documentation/models/RenameEnvelopeRequest.md) | | +| [SetEnvelopeCommentRequest](documentation/models/SetEnvelopeCommentRequest.md) | | +| [SetEnvelopeExpirationRequest](documentation/models/SetEnvelopeExpirationRequest.md) | | +| [SetEnvelopeLegalityLevelRequest](documentation/models/SetEnvelopeLegalityLevelRequest.md) | | +| [Annotation](documentation/models/Annotation.md) | | | [AnnotationType](documentation/models/AnnotationType.md) | Type of the annotation | | [AnnotationSignature](documentation/models/AnnotationSignature.md) | Signature annotation (null if annotation is not a signature) | | [AnnotationInitials](documentation/models/AnnotationInitials.md) | Initials annotation (null if annotation is not initials) | | [AnnotationText](documentation/models/AnnotationText.md) | Text annotation (null if annotation is not a text) | -| [AnnotationDateTime](documentation/models/AnnotationDateTime.md) | Date annotation (null if annotation is not a date) | -| [AnnotationCheckbox](documentation/models/AnnotationCheckbox.md) | Checkbox annotation (null if annotation is not a checkbox) | | [AnnotationFont](documentation/models/AnnotationFont.md) | | | [AnnotationFontFamily](documentation/models/AnnotationFontFamily.md) | Font family of the text | +| [AnnotationDateTime](documentation/models/AnnotationDateTime.md) | Date annotation (null if annotation is not a date) | | [AnnotationDateTimeFormat](documentation/models/AnnotationDateTimeFormat.md) | Format of the date time (DMY_NUMERIC_SLASH is day/month/year with slashes, MDY_NUMERIC_SLASH is month/day/year with slashes, YMD_NUMERIC_SLASH is year/month/day with slashes, DMY_NUMERIC_DASH_SHORT is day/month/year with dashes, DMY_NUMERIC_DASH is day/month/year with dashes, YMD_NUMERIC_DASH is year/month/day with dashes, MDY_TEXT_DASH_SHORT is month/day/year with dashes, MDY_TEXT_SPACE_SHORT is month/day/year with spaces, MDY_TEXT_SPACE is month/day/year with spaces) | +| [AnnotationCheckbox](documentation/models/AnnotationCheckbox.md) | Checkbox annotation (null if annotation is not a checkbox) | | [AnnotationCheckboxStyle](documentation/models/AnnotationCheckboxStyle.md) | Style of the checkbox | +| [ListEnvelopeDocumentAnnotationsResponse](documentation/models/ListEnvelopeDocumentAnnotationsResponse.md) | | +| [AddAnnotationRequest](documentation/models/AddAnnotationRequest.md) | | +| [Template](documentation/models/Template.md) | | | [TemplateSigningStep](documentation/models/TemplateSigningStep.md) | | | [TemplateRecipient](documentation/models/TemplateRecipient.md) | | | [TemplateRecipientRole](documentation/models/TemplateRecipientRole.md) | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | +| [CreateTemplateRequest](documentation/models/CreateTemplateRequest.md) | | +| [ListTemplatesResponse](documentation/models/ListTemplatesResponse.md) | | +| [ListTemplatesRequest](documentation/models/ListTemplatesRequest.md) | | | [TemplateOrderField](documentation/models/TemplateOrderField.md) | Field to order templates by | +| [AddTemplateDocumentRequest](documentation/models/AddTemplateDocumentRequest.md) | | +| [ListTemplateDocumentsResponse](documentation/models/ListTemplateDocumentsResponse.md) | | +| [AddTemplateSigningStepsRequest](documentation/models/AddTemplateSigningStepsRequest.md) | | +| [RenameTemplateRequest](documentation/models/RenameTemplateRequest.md) | | +| [SetTemplateCommentRequest](documentation/models/SetTemplateCommentRequest.md) | | +| [ListTemplateAnnotationsResponse](documentation/models/ListTemplateAnnotationsResponse.md) | | +| [ListTemplateDocumentAnnotationsResponse](documentation/models/ListTemplateDocumentAnnotationsResponse.md) | | +| [Webhook](documentation/models/Webhook.md) | | | [WebhookEvent](documentation/models/WebhookEvent.md) | Event of the webhook | -| [DownloadEnvelopeSignedDocumentsParameters](documentation/models/DownloadEnvelopeSignedDocumentsParameters.md) | | +| [CreateWebhookRequest](documentation/models/CreateWebhookRequest.md) | | +| [ListWebhooksResponse](documentation/models/ListWebhooksResponse.md) | | +| [ListWebhooksRequest](documentation/models/ListWebhooksRequest.md) | | diff --git a/documentation/models/AddAnnotationRequest.md b/documentation/models/AddAnnotationRequest.md index 882fa09..f6a200a 100644 --- a/documentation/models/AddAnnotationRequest.md +++ b/documentation/models/AddAnnotationRequest.md @@ -2,19 +2,19 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :------------------ | :------- | :---------------------------------------------------------------------------------------------- | -| documentId | String | ✅ | ID of the document | -| page | Long | ✅ | Page number where the annotation is placed | -| x | Double | ✅ | X coordinate of the annotation (in % of the page width from 0 to 100) from the top left corner | -| y | Double | ✅ | Y coordinate of the annotation (in % of the page height from 0 to 100) from the top left corner | -| width | Double | ✅ | Width of the annotation (in % of the page width from 0 to 100) | -| height | Double | ✅ | Height of the annotation (in % of the page height from 0 to 100) | -| type | AnnotationType | ✅ | Type of the annotation | -| recipientId | String | ❌ | ID of the recipient | -| required | Boolean | ❌ | | -| signature | AnnotationSignature | ❌ | Signature annotation (null if annotation is not a signature) | -| initials | AnnotationInitials | ❌ | Initials annotation (null if annotation is not initials) | -| text | AnnotationText | ❌ | Text annotation (null if annotation is not a text) | -| datetime | AnnotationDateTime | ❌ | Date annotation (null if annotation is not a date) | -| checkbox | AnnotationCheckbox | ❌ | Checkbox annotation (null if annotation is not a checkbox) | +| Name | Type | Required | Description | +| :---------- | :-------------------------------------------- | :------- | :---------------------------------------------------------------------------------------------- | +| documentId | String | ✅ | ID of the document | +| page | Long | ✅ | Page number where the annotation is placed | +| x | Double | ✅ | X coordinate of the annotation (in % of the page width from 0 to 100) from the top left corner | +| y | Double | ✅ | Y coordinate of the annotation (in % of the page height from 0 to 100) from the top left corner | +| width | Double | ✅ | Width of the annotation (in % of the page width from 0 to 100) | +| height | Double | ✅ | Height of the annotation (in % of the page height from 0 to 100) | +| type | [AnnotationType](AnnotationType.md) | ✅ | Type of the annotation | +| recipientId | String | ❌ | ID of the recipient | +| required | Boolean | ❌ | | +| signature | [AnnotationSignature](AnnotationSignature.md) | ❌ | Signature annotation (null if annotation is not a signature) | +| initials | [AnnotationInitials](AnnotationInitials.md) | ❌ | Initials annotation (null if annotation is not initials) | +| text | [AnnotationText](AnnotationText.md) | ❌ | Text annotation (null if annotation is not a text) | +| datetime | [AnnotationDateTime](AnnotationDateTime.md) | ❌ | Date annotation (null if annotation is not a date) | +| checkbox | [AnnotationCheckbox](AnnotationCheckbox.md) | ❌ | Checkbox annotation (null if annotation is not a checkbox) | diff --git a/documentation/models/AddEnvelopeSigningStepsRequest.md b/documentation/models/AddEnvelopeSigningStepsRequest.md index d82965f..473c87d 100644 --- a/documentation/models/AddEnvelopeSigningStepsRequest.md +++ b/documentation/models/AddEnvelopeSigningStepsRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :----------- | :------------------ | :------- | :-------------------- | -| signingSteps | List\ | ❌ | List of signing steps | +| Name | Type | Required | Description | +| :----------- | :---------------------------------- | :------- | :-------------------- | +| signingSteps | List<[SigningStep](SigningStep.md)> | ❌ | List of signing steps | diff --git a/documentation/models/AddTemplateSigningStepsRequest.md b/documentation/models/AddTemplateSigningStepsRequest.md index e7e0be5..98b477f 100644 --- a/documentation/models/AddTemplateSigningStepsRequest.md +++ b/documentation/models/AddTemplateSigningStepsRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :----------- | :-------------------------- | :------- | :-------------------- | -| signingSteps | List\ | ✅ | List of signing steps | +| Name | Type | Required | Description | +| :----------- | :-------------------------------------------------- | :------- | :-------------------- | +| signingSteps | List<[TemplateSigningStep](TemplateSigningStep.md)> | ✅ | List of signing steps | diff --git a/documentation/models/Annotation.md b/documentation/models/Annotation.md index 3ff9d54..ec8a185 100644 --- a/documentation/models/Annotation.md +++ b/documentation/models/Annotation.md @@ -2,20 +2,20 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :------------------ | :------- | :---------------------------------------------------------------------------------------------- | -| id | String | ❌ | Unique identifier of the annotation | -| recipientId | String | ❌ | ID of the recipient | -| documentId | String | ❌ | ID of the document | -| page | Long | ❌ | Page number where the annotation is placed | -| x | Double | ❌ | X coordinate of the annotation (in % of the page width from 0 to 100) from the top left corner | -| y | Double | ❌ | Y coordinate of the annotation (in % of the page height from 0 to 100) from the top left corner | -| width | Double | ❌ | Width of the annotation (in % of the page width from 0 to 100) | -| height | Double | ❌ | Height of the annotation (in % of the page height from 0 to 100) | -| required | Boolean | ❌ | Whether the annotation is required | -| type | AnnotationType | ❌ | Type of the annotation | -| signature | AnnotationSignature | ❌ | Signature annotation (null if annotation is not a signature) | -| initials | AnnotationInitials | ❌ | Initials annotation (null if annotation is not initials) | -| text | AnnotationText | ❌ | Text annotation (null if annotation is not a text) | -| datetime | AnnotationDateTime | ❌ | Date annotation (null if annotation is not a date) | -| checkbox | AnnotationCheckbox | ❌ | Checkbox annotation (null if annotation is not a checkbox) | +| Name | Type | Required | Description | +| :---------- | :-------------------------------------------- | :------- | :---------------------------------------------------------------------------------------------- | +| id | String | ❌ | Unique identifier of the annotation | +| recipientId | String | ❌ | ID of the recipient | +| documentId | String | ❌ | ID of the document | +| page | Long | ❌ | Page number where the annotation is placed | +| x | Double | ❌ | X coordinate of the annotation (in % of the page width from 0 to 100) from the top left corner | +| y | Double | ❌ | Y coordinate of the annotation (in % of the page height from 0 to 100) from the top left corner | +| width | Double | ❌ | Width of the annotation (in % of the page width from 0 to 100) | +| height | Double | ❌ | Height of the annotation (in % of the page height from 0 to 100) | +| required | Boolean | ❌ | Whether the annotation is required | +| type | [AnnotationType](AnnotationType.md) | ❌ | Type of the annotation | +| signature | [AnnotationSignature](AnnotationSignature.md) | ❌ | Signature annotation (null if annotation is not a signature) | +| initials | [AnnotationInitials](AnnotationInitials.md) | ❌ | Initials annotation (null if annotation is not initials) | +| text | [AnnotationText](AnnotationText.md) | ❌ | Text annotation (null if annotation is not a text) | +| datetime | [AnnotationDateTime](AnnotationDateTime.md) | ❌ | Date annotation (null if annotation is not a date) | +| checkbox | [AnnotationCheckbox](AnnotationCheckbox.md) | ❌ | Checkbox annotation (null if annotation is not a checkbox) | diff --git a/documentation/models/AnnotationCheckbox.md b/documentation/models/AnnotationCheckbox.md index 3412f72..d6e5aef 100644 --- a/documentation/models/AnnotationCheckbox.md +++ b/documentation/models/AnnotationCheckbox.md @@ -4,7 +4,7 @@ Checkbox annotation (null if annotation is not a checkbox) **Properties** -| Name | Type | Required | Description | -| :------ | :---------------------- | :------- | :------------------------------ | -| checked | Boolean | ❌ | Whether the checkbox is checked | -| style | AnnotationCheckboxStyle | ❌ | Style of the checkbox | +| Name | Type | Required | Description | +| :------ | :---------------------------------------------------- | :------- | :------------------------------ | +| checked | Boolean | ❌ | Whether the checkbox is checked | +| style | [AnnotationCheckboxStyle](AnnotationCheckboxStyle.md) | ❌ | Style of the checkbox | diff --git a/documentation/models/AnnotationDateTime.md b/documentation/models/AnnotationDateTime.md index e6bc022..97337dd 100644 --- a/documentation/models/AnnotationDateTime.md +++ b/documentation/models/AnnotationDateTime.md @@ -4,12 +4,12 @@ Date annotation (null if annotation is not a date) **Properties** -| Name | Type | Required | Description | -| :-------- | :----------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| size | Double | ❌ | Font size of the text in pt | -| font | AnnotationFont | ❌ | | -| color | String | ❌ | Color of the text in hex format | -| autoFill | Boolean | ❌ | Whether the date should be automatically filled | -| timezone | String | ❌ | Timezone of the date | -| timestamp | Long | ❌ | Unix timestamp of the date | -| format | AnnotationDateTimeFormat | ❌ | Format of the date time (DMY_NUMERIC_SLASH is day/month/year with slashes, MDY_NUMERIC_SLASH is month/day/year with slashes, YMD_NUMERIC_SLASH is year/month/day with slashes, DMY_NUMERIC_DASH_SHORT is day/month/year with dashes, DMY_NUMERIC_DASH is day/month/year with dashes, YMD_NUMERIC_DASH is year/month/day with dashes, MDY_TEXT_DASH_SHORT is month/day/year with dashes, MDY_TEXT_SPACE_SHORT is month/day/year with spaces, MDY_TEXT_SPACE is month/day/year with spaces) | +| Name | Type | Required | Description | +| :-------- | :------------------------------------------------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| size | Double | ❌ | Font size of the text in pt | +| font | [AnnotationFont](AnnotationFont.md) | ❌ | | +| color | String | ❌ | Color of the text in hex format | +| autoFill | Boolean | ❌ | Whether the date should be automatically filled | +| timezone | String | ❌ | Timezone of the date | +| timestamp | Long | ❌ | Unix timestamp of the date | +| format | [AnnotationDateTimeFormat](AnnotationDateTimeFormat.md) | ❌ | Format of the date time (DMY_NUMERIC_SLASH is day/month/year with slashes, MDY_NUMERIC_SLASH is month/day/year with slashes, YMD_NUMERIC_SLASH is year/month/day with slashes, DMY_NUMERIC_DASH_SHORT is day/month/year with dashes, DMY_NUMERIC_DASH is day/month/year with dashes, YMD_NUMERIC_DASH is year/month/day with dashes, MDY_TEXT_DASH_SHORT is month/day/year with dashes, MDY_TEXT_SPACE_SHORT is month/day/year with spaces, MDY_TEXT_SPACE is month/day/year with spaces) | diff --git a/documentation/models/AnnotationFont.md b/documentation/models/AnnotationFont.md index 3673e62..2efe893 100644 --- a/documentation/models/AnnotationFont.md +++ b/documentation/models/AnnotationFont.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :------------------- | :------- | :------------------------- | -| family | AnnotationFontFamily | ❌ | Font family of the text | -| italic | Boolean | ❌ | Whether the text is italic | -| bold | Boolean | ❌ | Whether the text is bold | +| Name | Type | Required | Description | +| :----- | :---------------------------------------------- | :------- | :------------------------- | +| family | [AnnotationFontFamily](AnnotationFontFamily.md) | ❌ | Font family of the text | +| italic | Boolean | ❌ | Whether the text is italic | +| bold | Boolean | ❌ | Whether the text is bold | diff --git a/documentation/models/AnnotationText.md b/documentation/models/AnnotationText.md index d64b5b3..5d3379c 100644 --- a/documentation/models/AnnotationText.md +++ b/documentation/models/AnnotationText.md @@ -4,11 +4,11 @@ Text annotation (null if annotation is not a text) **Properties** -| Name | Type | Required | Description | -| :--------------- | :------------- | :------- | :--------------------------------- | -| size | Double | ❌ | Font size of the text in pt | -| color | Double | ❌ | Text color in 32bit representation | -| value | String | ❌ | Text content of the annotation | -| tooltip | String | ❌ | Tooltip of the annotation | -| dynamicFieldName | String | ❌ | Name of the dynamic field | -| font | AnnotationFont | ❌ | | +| Name | Type | Required | Description | +| :--------------- | :---------------------------------- | :------- | :--------------------------------- | +| size | Double | ❌ | Font size of the text in pt | +| color | Double | ❌ | Text color in 32bit representation | +| value | String | ❌ | Text content of the annotation | +| tooltip | String | ❌ | Tooltip of the annotation | +| dynamicFieldName | String | ❌ | Name of the dynamic field | +| font | [AnnotationFont](AnnotationFont.md) | ❌ | | diff --git a/documentation/models/AttachmentPlaceholder.md b/documentation/models/AttachmentPlaceholder.md index 2f0faf7..ec08771 100644 --- a/documentation/models/AttachmentPlaceholder.md +++ b/documentation/models/AttachmentPlaceholder.md @@ -2,12 +2,12 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :-------------------------------- | :------- | :--------------------------------------------------------- | -| recipientId | String | ❌ | ID of the recipient | -| id | String | ❌ | ID of the attachment placeholder | -| name | String | ❌ | Name of the attachment placeholder | -| hint | String | ❌ | Hint of the attachment placeholder | -| required | Boolean | ❌ | Whether the attachment placeholder is required | -| multiple | Boolean | ❌ | Whether the attachment placeholder can have multiple files | -| files | List\ | ❌ | | +| Name | Type | Required | Description | +| :---------- | :-------------------------------------------------------------- | :------- | :--------------------------------------------------------- | +| recipientId | String | ❌ | ID of the recipient | +| id | String | ❌ | ID of the attachment placeholder | +| name | String | ❌ | Name of the attachment placeholder | +| hint | String | ❌ | Hint of the attachment placeholder | +| required | Boolean | ❌ | Whether the attachment placeholder is required | +| multiple | Boolean | ❌ | Whether the attachment placeholder can have multiple files | +| files | List<[AttachmentPlaceholderFile](AttachmentPlaceholderFile.md)> | ❌ | | diff --git a/documentation/models/AttachmentPlaceholdersPerRecipient.md b/documentation/models/AttachmentPlaceholdersPerRecipient.md index 21033e2..ac9c748 100644 --- a/documentation/models/AttachmentPlaceholdersPerRecipient.md +++ b/documentation/models/AttachmentPlaceholdersPerRecipient.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :------------ | :---------------------------- | :------- | :-------------------- | -| recipientId | String | ❌ | ID of the recipient | -| recipientName | String | ❌ | Name of the recipient | -| placeholders | List\ | ❌ | | +| Name | Type | Required | Description | +| :------------ | :------------------------------------------------------ | :------- | :-------------------- | +| recipientId | String | ❌ | ID of the recipient | +| recipientName | String | ❌ | Name of the recipient | +| placeholders | List<[AttachmentPlaceholder](AttachmentPlaceholder.md)> | ❌ | | diff --git a/documentation/models/CreateEnvelopeRequest.md b/documentation/models/CreateEnvelopeRequest.md index 72567f4..6ad5add 100644 --- a/documentation/models/CreateEnvelopeRequest.md +++ b/documentation/models/CreateEnvelopeRequest.md @@ -2,10 +2,10 @@ **Properties** -| Name | Type | Required | Description | -| :------------ | :-------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | String | ✅ | Name of the envelope | -| legalityLevel | EnvelopeLegalityLevel | ✅ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | -| expiresAt | Long | ❌ | Unix timestamp of the expiration date | -| comment | String | ❌ | Comment for the envelope | -| sandbox | Boolean | ❌ | Whether the envelope is created in sandbox mode | +| Name | Type | Required | Description | +| :------------ | :------------------------------------------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | String | ✅ | Name of the envelope | +| legalityLevel | [EnvelopeLegalityLevel](EnvelopeLegalityLevel.md) | ✅ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | +| expiresAt | Long | ❌ | Unix timestamp of the expiration date | +| comment | String | ❌ | Comment for the envelope | +| sandbox | Boolean | ❌ | Whether the envelope is created in sandbox mode | diff --git a/documentation/models/CreateWebhookRequest.md b/documentation/models/CreateWebhookRequest.md index 7d96423..11c8767 100644 --- a/documentation/models/CreateWebhookRequest.md +++ b/documentation/models/CreateWebhookRequest.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :----------- | :------- | :------------------------ | -| event | WebhookEvent | ✅ | Event of the webhook | -| target | String | ✅ | URL of the webhook target | +| Name | Type | Required | Description | +| :----- | :------------------------------ | :------- | :------------------------ | +| event | [WebhookEvent](WebhookEvent.md) | ✅ | Event of the webhook | +| target | String | ✅ | URL of the webhook target | diff --git a/documentation/models/Document.md b/documentation/models/Document.md index 6771a50..35a9c4d 100644 --- a/documentation/models/Document.md +++ b/documentation/models/Document.md @@ -2,10 +2,10 @@ **Properties** -| Name | Type | Required | Description | -| :-------- | :----------- | :------- | :-------------------------------- | -| id | String | ❌ | Unique identifier of the document | -| name | String | ❌ | Name of the document | -| filename | String | ❌ | Filename of the document | -| pageCount | Long | ❌ | Number of pages in the document | -| pages | List\ | ❌ | List of pages in the document | +| Name | Type | Required | Description | +| :-------- | :-------------------- | :------- | :-------------------------------- | +| id | String | ❌ | Unique identifier of the document | +| name | String | ❌ | Name of the document | +| filename | String | ❌ | Filename of the document | +| pageCount | Long | ❌ | Number of pages in the document | +| pages | List<[Page](Page.md)> | ❌ | List of pages in the document | diff --git a/documentation/models/Envelope.md b/documentation/models/Envelope.md index 1fa2794..89ea796 100644 --- a/documentation/models/Envelope.md +++ b/documentation/models/Envelope.md @@ -2,21 +2,21 @@ **Properties** -| Name | Type | Required | Description | -| :------------ | :-------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | String | ❌ | Unique identifier of the envelope | -| name | String | ❌ | Name of the envelope | -| comment | String | ❌ | Comment for the envelope | -| pages | Long | ❌ | Total number of pages in the envelope | -| flowType | EnvelopeFlowType | ❌ | Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) | -| legalityLevel | EnvelopeLegalityLevel | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | -| status | EnvelopeStatus | ❌ | Status of the envelope | -| createdAt | Long | ❌ | Unix timestamp of the creation date | -| updatedAt | Long | ❌ | Unix timestamp of the last modification date | -| expiresAt | Long | ❌ | Unix timestamp of the expiration date | -| numRecipients | Long | ❌ | Number of recipients in the envelope | -| isDuplicable | Boolean | ❌ | Whether the envelope can be duplicated | -| signingSteps | List\ | ❌ | | -| documents | List\ | ❌ | | -| notification | EnvelopeNotification | ❌ | | -| attachments | EnvelopeAttachments | ❌ | | +| Name | Type | Required | Description | +| :------------ | :------------------------------------------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id | String | ❌ | Unique identifier of the envelope | +| name | String | ❌ | Name of the envelope | +| comment | String | ❌ | Comment for the envelope | +| pages | Long | ❌ | Total number of pages in the envelope | +| flowType | [EnvelopeFlowType](EnvelopeFlowType.md) | ❌ | Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) | +| legalityLevel | [EnvelopeLegalityLevel](EnvelopeLegalityLevel.md) | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | +| status | [EnvelopeStatus](EnvelopeStatus.md) | ❌ | Status of the envelope | +| createdAt | Long | ❌ | Unix timestamp of the creation date | +| updatedAt | Long | ❌ | Unix timestamp of the last modification date | +| expiresAt | Long | ❌ | Unix timestamp of the expiration date | +| numRecipients | Long | ❌ | Number of recipients in the envelope | +| isDuplicable | Boolean | ❌ | Whether the envelope can be duplicated | +| signingSteps | List<[SigningStep](SigningStep.md)> | ❌ | | +| documents | List<[Document](Document.md)> | ❌ | | +| notification | [EnvelopeNotification](EnvelopeNotification.md) | ❌ | | +| attachments | [EnvelopeAttachments](EnvelopeAttachments.md) | ❌ | | diff --git a/documentation/models/EnvelopeAttachments.md b/documentation/models/EnvelopeAttachments.md index c7f21df..94cdc4e 100644 --- a/documentation/models/EnvelopeAttachments.md +++ b/documentation/models/EnvelopeAttachments.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :--------- | :----------------------------------------- | :------- | :---------- | -| settings | AttachmentSettings | ❌ | | -| recipients | List\ | ❌ | | +| Name | Type | Required | Description | +| :--------- | :-------------------------------------------------------------------------------- | :------- | :---------- | +| settings | [AttachmentSettings](AttachmentSettings.md) | ❌ | | +| recipients | List<[AttachmentPlaceholdersPerRecipient](AttachmentPlaceholdersPerRecipient.md)> | ❌ | | diff --git a/documentation/models/ListEnvelopeDocumentAnnotationsResponse.md b/documentation/models/ListEnvelopeDocumentAnnotationsResponse.md index 8dc60a3..b9c818c 100644 --- a/documentation/models/ListEnvelopeDocumentAnnotationsResponse.md +++ b/documentation/models/ListEnvelopeDocumentAnnotationsResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :----------------- | :------- | :---------- | -| annotations | List\ | ❌ | | +| Name | Type | Required | Description | +| :---------- | :-------------------------------- | :------- | :---------- | +| annotations | List<[Annotation](Annotation.md)> | ❌ | | diff --git a/documentation/models/ListEnvelopeDocumentsResponse.md b/documentation/models/ListEnvelopeDocumentsResponse.md index d67e61c..784ee77 100644 --- a/documentation/models/ListEnvelopeDocumentsResponse.md +++ b/documentation/models/ListEnvelopeDocumentsResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :-------- | :--------------- | :------- | :---------- | -| documents | List\ | ❌ | | +| Name | Type | Required | Description | +| :-------- | :---------------------------- | :------- | :---------- | +| documents | List<[Document](Document.md)> | ❌ | | diff --git a/documentation/models/ListEnvelopesRequest.md b/documentation/models/ListEnvelopesRequest.md index a9f935d..5038591 100644 --- a/documentation/models/ListEnvelopesRequest.md +++ b/documentation/models/ListEnvelopesRequest.md @@ -2,22 +2,22 @@ **Properties** -| Name | Type | Required | Description | -| :------------- | :--------------------- | :------- | :------------------------------------------------ | -| name | String | ❌ | Name of the envelope | -| tags | List\ | ❌ | List of tags | -| comment | String | ❌ | Comment of the envelope | -| ids | List\ | ❌ | List of envelope IDs | -| statuses | List\ | ❌ | List of envelope statuses | -| folderIds | List\ | ❌ | List of folder IDs | -| onlyRootFolder | Boolean | ❌ | Whether to only list envelopes in the root folder | -| dateFrom | Long | ❌ | Unix timestamp of the start date | -| dateTo | Long | ❌ | Unix timestamp of the end date | -| uid | String | ❌ | Unique identifier of the user | -| first | Long | ❌ | | -| last | Long | ❌ | | -| after | String | ❌ | | -| before | String | ❌ | | -| orderField | EnvelopeOrderField | ❌ | Field to order envelopes by | -| ascending | Boolean | ❌ | Whether to order envelopes in ascending order | -| includeTrash | Boolean | ❌ | Whether to include envelopes in the trash | +| Name | Type | Required | Description | +| :------------- | :------------------------------------------ | :------- | :------------------------------------------------ | +| name | String | ❌ | Name of the envelope | +| tags | List | ❌ | List of tags | +| comment | String | ❌ | Comment of the envelope | +| ids | List | ❌ | List of envelope IDs | +| statuses | List<[EnvelopeStatus](EnvelopeStatus.md)> | ❌ | List of envelope statuses | +| folderIds | List | ❌ | List of folder IDs | +| onlyRootFolder | Boolean | ❌ | Whether to only list envelopes in the root folder | +| dateFrom | Long | ❌ | Unix timestamp of the start date | +| dateTo | Long | ❌ | Unix timestamp of the end date | +| uid | String | ❌ | Unique identifier of the user | +| first | Long | ❌ | | +| last | Long | ❌ | | +| after | String | ❌ | | +| before | String | ❌ | | +| orderField | [EnvelopeOrderField](EnvelopeOrderField.md) | ❌ | Field to order envelopes by | +| ascending | Boolean | ❌ | Whether to order envelopes in ascending order | +| includeTrash | Boolean | ❌ | Whether to include envelopes in the trash | diff --git a/documentation/models/ListEnvelopesResponse.md b/documentation/models/ListEnvelopesResponse.md index 86f63b1..359b9eb 100644 --- a/documentation/models/ListEnvelopesResponse.md +++ b/documentation/models/ListEnvelopesResponse.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :-------------- | :--------------- | :------- | :------------------------------- | -| hasNextPage | Boolean | ❌ | Whether there is a next page | -| hasPreviousPage | Boolean | ❌ | Whether there is a previous page | -| envelopes | List\ | ❌ | | +| Name | Type | Required | Description | +| :-------------- | :---------------------------- | :------- | :------------------------------- | +| hasNextPage | Boolean | ❌ | Whether there is a next page | +| hasPreviousPage | Boolean | ❌ | Whether there is a previous page | +| envelopes | List<[Envelope](Envelope.md)> | ❌ | | diff --git a/documentation/models/ListTemplateAnnotationsResponse.md b/documentation/models/ListTemplateAnnotationsResponse.md index 1faab8a..603e96f 100644 --- a/documentation/models/ListTemplateAnnotationsResponse.md +++ b/documentation/models/ListTemplateAnnotationsResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :----------------- | :------- | :---------- | -| annotations | List\ | ❌ | | +| Name | Type | Required | Description | +| :---------- | :-------------------------------- | :------- | :---------- | +| annotations | List<[Annotation](Annotation.md)> | ❌ | | diff --git a/documentation/models/ListTemplateDocumentAnnotationsResponse.md b/documentation/models/ListTemplateDocumentAnnotationsResponse.md index 80d0186..54ee521 100644 --- a/documentation/models/ListTemplateDocumentAnnotationsResponse.md +++ b/documentation/models/ListTemplateDocumentAnnotationsResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :---------- | :----------------- | :------- | :---------- | -| annotations | List\ | ❌ | | +| Name | Type | Required | Description | +| :---------- | :-------------------------------- | :------- | :---------- | +| annotations | List<[Annotation](Annotation.md)> | ❌ | | diff --git a/documentation/models/ListTemplateDocumentsResponse.md b/documentation/models/ListTemplateDocumentsResponse.md index ba70722..678a935 100644 --- a/documentation/models/ListTemplateDocumentsResponse.md +++ b/documentation/models/ListTemplateDocumentsResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :-------- | :--------------- | :------- | :---------- | -| documents | List\ | ❌ | | +| Name | Type | Required | Description | +| :-------- | :---------------------------- | :------- | :---------- | +| documents | List<[Document](Document.md)> | ❌ | | diff --git a/documentation/models/ListTemplatesRequest.md b/documentation/models/ListTemplatesRequest.md index c1ed5c3..8a8186a 100644 --- a/documentation/models/ListTemplatesRequest.md +++ b/documentation/models/ListTemplatesRequest.md @@ -2,14 +2,14 @@ **Properties** -| Name | Type | Required | Description | -| :--------- | :----------------- | :------- | :-------------------------------------------- | -| name | String | ❌ | Name of the template | -| tags | List\ | ❌ | List of tag templates | -| ids | List\ | ❌ | List of templates IDs | -| first | Long | ❌ | | -| last | Long | ❌ | | -| after | String | ❌ | | -| before | String | ❌ | | -| orderField | TemplateOrderField | ❌ | Field to order templates by | -| ascending | Boolean | ❌ | Whether to order templates in ascending order | +| Name | Type | Required | Description | +| :--------- | :------------------------------------------ | :------- | :-------------------------------------------- | +| name | String | ❌ | Name of the template | +| tags | List | ❌ | List of tag templates | +| ids | List | ❌ | List of templates IDs | +| first | Long | ❌ | | +| last | Long | ❌ | | +| after | String | ❌ | | +| before | String | ❌ | | +| orderField | [TemplateOrderField](TemplateOrderField.md) | ❌ | Field to order templates by | +| ascending | Boolean | ❌ | Whether to order templates in ascending order | diff --git a/documentation/models/ListTemplatesResponse.md b/documentation/models/ListTemplatesResponse.md index a4260ff..849fe1f 100644 --- a/documentation/models/ListTemplatesResponse.md +++ b/documentation/models/ListTemplatesResponse.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :-------------- | :--------------- | :------- | :------------------------------- | -| hasNextPage | Boolean | ❌ | Whether there is a next page | -| hasPreviousPage | Boolean | ❌ | Whether there is a previous page | -| templates | List\ | ❌ | | +| Name | Type | Required | Description | +| :-------------- | :---------------------------- | :------- | :------------------------------- | +| hasNextPage | Boolean | ❌ | Whether there is a next page | +| hasPreviousPage | Boolean | ❌ | Whether there is a previous page | +| templates | List<[Template](Template.md)> | ❌ | | diff --git a/documentation/models/ListWebhooksRequest.md b/documentation/models/ListWebhooksRequest.md index 5c9e4b1..3c29cd1 100644 --- a/documentation/models/ListWebhooksRequest.md +++ b/documentation/models/ListWebhooksRequest.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :-------- | :----------- | :------- | :------------------- | -| webhookId | String | ❌ | ID of the webhook | -| event | WebhookEvent | ❌ | Event of the webhook | +| Name | Type | Required | Description | +| :-------- | :------------------------------ | :------- | :------------------- | +| webhookId | String | ❌ | ID of the webhook | +| event | [WebhookEvent](WebhookEvent.md) | ❌ | Event of the webhook | diff --git a/documentation/models/ListWebhooksResponse.md b/documentation/models/ListWebhooksResponse.md index dc23ed7..ecc5869 100644 --- a/documentation/models/ListWebhooksResponse.md +++ b/documentation/models/ListWebhooksResponse.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :------- | :-------------- | :------- | :---------- | -| webhooks | List\ | ❌ | | +| Name | Type | Required | Description | +| :------- | :-------------------------- | :------- | :---------- | +| webhooks | List<[Webhook](Webhook.md)> | ❌ | | diff --git a/documentation/models/Recipient.md b/documentation/models/Recipient.md index d099a1a..ca778c4 100644 --- a/documentation/models/Recipient.md +++ b/documentation/models/Recipient.md @@ -2,11 +2,11 @@ **Properties** -| Name | Type | Required | Description | -| :----------- | :-------------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | String | ✅ | Name of the recipient | -| email | String | ✅ | Email of the recipient | -| role | RecipientRole | ✅ | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | -| id | String | ❌ | Unique identifier of the recipient | -| uid | String | ❌ | Unique identifier of the user associated with the recipient | -| verification | RecipientVerification | ❌ | | +| Name | Type | Required | Description | +| :----------- | :------------------------------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | String | ✅ | Name of the recipient | +| email | String | ✅ | Email of the recipient | +| role | [RecipientRole](RecipientRole.md) | ✅ | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | +| id | String | ❌ | Unique identifier of the recipient | +| uid | String | ❌ | Unique identifier of the user associated with the recipient | +| verification | [RecipientVerification](RecipientVerification.md) | ❌ | | diff --git a/documentation/models/RecipientVerification.md b/documentation/models/RecipientVerification.md index fd70b87..43868aa 100644 --- a/documentation/models/RecipientVerification.md +++ b/documentation/models/RecipientVerification.md @@ -2,7 +2,7 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :------------------------ | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | RecipientVerificationType | ❌ | Type of verification the recipient must complete before accessing the envelope. - `PASSCODE`: requires a code to be entered. - `SMS`: sends a code via SMS. - `ID_VERIFICATION`: prompts the recipient to complete an automated ID and selfie check. | -| value | String | ❌ | Required for `PASSCODE` and `SMS` verification. - `PASSCODE`: code required by the recipient to sign the document. - `SMS`: recipient's phone number. - `ID_VERIFICATION`: leave empty. | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | [RecipientVerificationType](RecipientVerificationType.md) | ❌ | Type of verification the recipient must complete before accessing the envelope. - `PASSCODE`: requires a code to be entered. - `SMS`: sends a code via SMS. - `ID_VERIFICATION`: prompts the recipient to complete an automated ID and selfie check. | +| value | String | ❌ | Required for `PASSCODE` and `SMS` verification. - `PASSCODE`: code required by the recipient to sign the document. - `SMS`: recipient's phone number. - `ID_VERIFICATION`: leave empty. | diff --git a/documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md b/documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md index b81d86e..3047107 100644 --- a/documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md +++ b/documentation/models/SetEnvelopeAttachmentsPlaceholdersRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :----------- | :----------------------------------- | :------- | :---------- | -| placeholders | List\ | ✅ | | +| Name | Type | Required | Description | +| :----------- | :-------------------------------------------------------------------- | :------- | :---------- | +| placeholders | List<[AttachmentPlaceholderRequest](AttachmentPlaceholderRequest.md)> | ✅ | | diff --git a/documentation/models/SetEnvelopeAttachmentsSettingsRequest.md b/documentation/models/SetEnvelopeAttachmentsSettingsRequest.md index 214f26e..edfdc4a 100644 --- a/documentation/models/SetEnvelopeAttachmentsSettingsRequest.md +++ b/documentation/models/SetEnvelopeAttachmentsSettingsRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :------- | :----------------- | :------- | :---------- | -| settings | AttachmentSettings | ✅ | | +| Name | Type | Required | Description | +| :------- | :------------------------------------------ | :------- | :---------- | +| settings | [AttachmentSettings](AttachmentSettings.md) | ✅ | | diff --git a/documentation/models/SetEnvelopeDynamicFieldsRequest.md b/documentation/models/SetEnvelopeDynamicFieldsRequest.md index 3216a82..26e609d 100644 --- a/documentation/models/SetEnvelopeDynamicFieldsRequest.md +++ b/documentation/models/SetEnvelopeDynamicFieldsRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :------------ | :------------------- | :------- | :--------------------- | -| dynamicFields | List\ | ✅ | List of dynamic fields | +| Name | Type | Required | Description | +| :------------ | :------------------------------------ | :------- | :--------------------- | +| dynamicFields | List<[DynamicField](DynamicField.md)> | ✅ | List of dynamic fields | diff --git a/documentation/models/SetEnvelopeLegalityLevelRequest.md b/documentation/models/SetEnvelopeLegalityLevelRequest.md index d4af02d..d61bf1c 100644 --- a/documentation/models/SetEnvelopeLegalityLevelRequest.md +++ b/documentation/models/SetEnvelopeLegalityLevelRequest.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :------------ | :-------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| legalityLevel | EnvelopeLegalityLevel | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | +| Name | Type | Required | Description | +| :------------ | :------------------------------------------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| legalityLevel | [EnvelopeLegalityLevel](EnvelopeLegalityLevel.md) | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | diff --git a/documentation/models/SigningStep.md b/documentation/models/SigningStep.md index 6b52072..77c1fa1 100644 --- a/documentation/models/SigningStep.md +++ b/documentation/models/SigningStep.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :--------- | :---------------- | :------- | :----------------- | -| recipients | List\ | ❌ | List of recipients | +| Name | Type | Required | Description | +| :--------- | :------------------------------ | :------- | :----------------- | +| recipients | List<[Recipient](Recipient.md)> | ❌ | List of recipients | diff --git a/documentation/models/Template.md b/documentation/models/Template.md index e3605e5..44b53da 100644 --- a/documentation/models/Template.md +++ b/documentation/models/Template.md @@ -2,19 +2,19 @@ **Properties** -| Name | Type | Required | Description | -| :-------------- | :-------------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | String | ❌ | Unique identifier of the template | -| name | String | ❌ | Name of the template | -| comment | String | ❌ | Comment for the template | -| pages | Long | ❌ | Total number of pages in the template | -| legalityLevel | EnvelopeLegalityLevel | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | -| createdAt | Long | ❌ | Unix timestamp of the creation date | -| updatedAt | Long | ❌ | Unix timestamp of the last modification date | -| expirationDelay | Long | ❌ | Expiration delay added to the current time when an envelope is created from this template | -| numRecipients | Long | ❌ | Number of recipients in the envelope | -| signingSteps | List\ | ❌ | | -| documents | List\ | ❌ | | -| notification | EnvelopeNotification | ❌ | | -| dynamicFields | List\ | ❌ | List of dynamic fields | -| attachments | EnvelopeAttachments | ❌ | | +| Name | Type | Required | Description | +| :-------------- | :-------------------------------------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id | String | ❌ | Unique identifier of the template | +| name | String | ❌ | Name of the template | +| comment | String | ❌ | Comment for the template | +| pages | Long | ❌ | Total number of pages in the template | +| legalityLevel | [EnvelopeLegalityLevel](EnvelopeLegalityLevel.md) | ❌ | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) | +| createdAt | Long | ❌ | Unix timestamp of the creation date | +| updatedAt | Long | ❌ | Unix timestamp of the last modification date | +| expirationDelay | Long | ❌ | Expiration delay added to the current time when an envelope is created from this template | +| numRecipients | Long | ❌ | Number of recipients in the envelope | +| signingSteps | List<[TemplateSigningStep](TemplateSigningStep.md)> | ❌ | | +| documents | List<[Document](Document.md)> | ❌ | | +| notification | [EnvelopeNotification](EnvelopeNotification.md) | ❌ | | +| dynamicFields | List | ❌ | List of dynamic fields | +| attachments | [EnvelopeAttachments](EnvelopeAttachments.md) | ❌ | | diff --git a/documentation/models/TemplateRecipient.md b/documentation/models/TemplateRecipient.md index 52f5228..a9a2c46 100644 --- a/documentation/models/TemplateRecipient.md +++ b/documentation/models/TemplateRecipient.md @@ -2,10 +2,10 @@ **Properties** -| Name | Type | Required | Description | -| :---- | :-------------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | String | ❌ | Unique identifier of the recipient | -| uid | String | ❌ | Unique identifier of the user associated with the recipient | -| name | String | ❌ | Name of the recipient | -| email | String | ❌ | Email of the recipient | -| role | TemplateRecipientRole | ❌ | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | +| Name | Type | Required | Description | +| :---- | :------------------------------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id | String | ❌ | Unique identifier of the recipient | +| uid | String | ❌ | Unique identifier of the user associated with the recipient | +| name | String | ❌ | Name of the recipient | +| email | String | ❌ | Email of the recipient | +| role | [TemplateRecipientRole](TemplateRecipientRole.md) | ❌ | Role of the recipient (SIGNER signs the document, RECEIVES_COPY receives a copy of the document, IN_PERSON_SIGNER signs the document in person, SENDER sends the document) | diff --git a/documentation/models/TemplateSigningStep.md b/documentation/models/TemplateSigningStep.md index e9d33d2..aa1d56b 100644 --- a/documentation/models/TemplateSigningStep.md +++ b/documentation/models/TemplateSigningStep.md @@ -2,6 +2,6 @@ **Properties** -| Name | Type | Required | Description | -| :--------- | :------------------------ | :------- | :----------------- | -| recipients | List\ | ❌ | List of recipients | +| Name | Type | Required | Description | +| :--------- | :---------------------------------------------- | :------- | :----------------- | +| recipients | List<[TemplateRecipient](TemplateRecipient.md)> | ❌ | List of recipients | diff --git a/documentation/models/Webhook.md b/documentation/models/Webhook.md index ebcebb5..93d9ba7 100644 --- a/documentation/models/Webhook.md +++ b/documentation/models/Webhook.md @@ -2,8 +2,8 @@ **Properties** -| Name | Type | Required | Description | -| :----- | :----------- | :------- | :------------------------------- | -| id | String | ❌ | Unique identifier of the webhook | -| event | WebhookEvent | ❌ | Event of the webhook | -| target | String | ❌ | Target URL of the webhook | +| Name | Type | Required | Description | +| :----- | :------------------------------ | :------- | :------------------------------- | +| id | String | ❌ | Unique identifier of the webhook | +| event | [WebhookEvent](WebhookEvent.md) | ❌ | Event of the webhook | +| target | String | ❌ | Target URL of the webhook | diff --git a/documentation/services/SignplusService.md b/documentation/services/SignplusService.md index 4763cc8..44967a5 100644 --- a/documentation/services/SignplusService.md +++ b/documentation/services/SignplusService.md @@ -135,13 +135,17 @@ public class Main { Signplus signplus = new Signplus(config); - CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest = CreateEnvelopeFromTemplateRequest.builder() - .name("name") - .comment("comment") - .sandbox(true) - .build(); - - Envelope response = signplus.signplus.createEnvelopeFromTemplate("template_id", createEnvelopeFromTemplateRequest); + CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest = + CreateEnvelopeFromTemplateRequest.builder() + .name("name") + .comment("comment") + .sandbox(true) + .build(); + + Envelope response = signplus.signplus.createEnvelopeFromTemplate( + "template_id", + createEnvelopeFromTemplateRequest + ); System.out.println(response); } @@ -200,16 +204,16 @@ public class Main { .ids(idsList) .statuses(statusesList) .folderIds(folderIdsList) - .onlyRootFolder(true) - .dateFrom(5L) - .dateTo(9L) + .onlyRootFolder(false) + .dateFrom(0L) + .dateTo(1L) .uid("uid") - .first(9L) - .last(7L) + .first(6L) + .last(6L) .after("after") .before("before") .orderField(EnvelopeOrderField.CREATION_DATE) - .ascending(true) + .ascending(false) .includeTrash(true) .build(); @@ -324,11 +328,13 @@ public class Main { Signplus signplus = new Signplus(config); - DownloadEnvelopeSignedDocumentsParameters requestParameters = DownloadEnvelopeSignedDocumentsParameters.builder() - .certificateOfCompletion(true) - .build(); + DownloadEnvelopeSignedDocumentsParameters requestParameters = + DownloadEnvelopeSignedDocumentsParameters.builder().certificateOfCompletion(true).build(); - byte[] response = signplus.signplus.downloadEnvelopeSignedDocuments("envelope_id", requestParameters); + byte[] response = signplus.signplus.downloadEnvelopeSignedDocuments( + "envelope_id", + requestParameters + ); System.out.println(response); } @@ -466,7 +472,7 @@ Add envelope document | :------------------------- | :-------------------------------------------------------------------- | :------- | :----------------------------- | | envelopeId | String | ✅ | | | addEnvelopeDocumentRequest | [AddEnvelopeDocumentRequest](../models/AddEnvelopeDocumentRequest.md) | ✅ | Request Body | -| \_filename | [String](../models/String.md) | ✅ | Filename for the uploaded file | +| \_filename | String | ✅ | Filename for the uploaded file | **Return Type** @@ -487,13 +493,16 @@ public class Main { Signplus signplus = new Signplus(config); - AddEnvelopeDocumentRequest addEnvelopeDocumentRequest = AddEnvelopeDocumentRequest.builder().file(file).build(); - AddEnvelopeDocumentRequest addEnvelopeDocumentRequest = AddEnvelopeDocumentRequest.builder().file(file).build(); + byte[] file = new byte[] { 0, 1, 2, 3, 4, 5 }; + + AddEnvelopeDocumentRequest addEnvelopeDocumentRequest = AddEnvelopeDocumentRequest.builder() + .file(file) + .build(); Document response = signplus.signplus.addEnvelopeDocument( "envelope_id", addEnvelopeDocumentRequest, - addEnvelopeDocumentRequest + "filename.txt" ); System.out.println(response); @@ -542,11 +551,13 @@ public class Main { List dynamicFieldsList = Arrays.asList(dynamicField); - SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest = SetEnvelopeDynamicFieldsRequest.builder() - .dynamicFields(dynamicFieldsList) - .build(); + SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest = + SetEnvelopeDynamicFieldsRequest.builder().dynamicFields(dynamicFieldsList).build(); - Envelope response = signplus.signplus.setEnvelopeDynamicFields("envelope_id", setEnvelopeDynamicFieldsRequest); + Envelope response = signplus.signplus.setEnvelopeDynamicFields( + "envelope_id", + setEnvelopeDynamicFieldsRequest + ); System.out.println(response); } @@ -614,11 +625,13 @@ public class Main { List signingStepsList = Arrays.asList(signingStep); - AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest = AddEnvelopeSigningStepsRequest.builder() - .signingSteps(signingStepsList) - .build(); + AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest = + AddEnvelopeSigningStepsRequest.builder().signingSteps(signingStepsList).build(); - Envelope response = signplus.signplus.addEnvelopeSigningSteps("envelope_id", addEnvelopeSigningStepsRequest); + Envelope response = signplus.signplus.addEnvelopeSigningSteps( + "envelope_id", + addEnvelopeSigningStepsRequest + ); System.out.println(response); } @@ -660,7 +673,9 @@ public class Main { Signplus signplus = new Signplus(config); - AttachmentSettings attachmentSettings = AttachmentSettings.builder().visibleToRecipients(false).build(); + AttachmentSettings attachmentSettings = AttachmentSettings.builder() + .visibleToRecipients(true) + .build(); SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest = SetEnvelopeAttachmentsSettingsRequest.builder().settings(attachmentSettings).build(); @@ -712,16 +727,19 @@ public class Main { Signplus signplus = new Signplus(config); - AttachmentPlaceholderRequest attachmentPlaceholderRequest = AttachmentPlaceholderRequest.builder() - .recipientId("recipient_id") - .id("id") - .name("name") - .hint("hint") - .required(false) - .multiple(true) - .build(); - - List placeholdersList = Arrays.asList(attachmentPlaceholderRequest); + AttachmentPlaceholderRequest attachmentPlaceholderRequest = + AttachmentPlaceholderRequest.builder() + .recipientId("recipient_id") + .id("id") + .name("name") + .hint("hint") + .required(true) + .multiple(true) + .build(); + + List placeholdersList = Arrays.asList( + attachmentPlaceholderRequest + ); SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest = SetEnvelopeAttachmentsPlaceholdersRequest.builder().placeholders(placeholdersList).build(); @@ -926,7 +944,9 @@ public class Main { Signplus signplus = new Signplus(config); - RenameEnvelopeRequest renameEnvelopeRequest = RenameEnvelopeRequest.builder().name("name").build(); + RenameEnvelopeRequest renameEnvelopeRequest = RenameEnvelopeRequest.builder() + .name("name") + .build(); Envelope response = signplus.signplus.renameEnvelope("envelope_id", renameEnvelopeRequest); @@ -973,7 +993,10 @@ public class Main { .comment("comment") .build(); - Envelope response = signplus.signplus.setEnvelopeComment("envelope_id", setEnvelopeCommentRequest); + Envelope response = signplus.signplus.setEnvelopeComment( + "envelope_id", + setEnvelopeCommentRequest + ); System.out.println(response); } @@ -1017,10 +1040,13 @@ public class Main { EnvelopeNotification envelopeNotification = EnvelopeNotification.builder() .subject("subject") .message("message") - .reminderInterval(1L) + .reminderInterval(4L) .build(); - Envelope response = signplus.signplus.setEnvelopeNotification("envelope_id", envelopeNotification); + Envelope response = signplus.signplus.setEnvelopeNotification( + "envelope_id", + envelopeNotification + ); System.out.println(response); } @@ -1061,11 +1087,13 @@ public class Main { Signplus signplus = new Signplus(config); - SetEnvelopeExpirationRequest setEnvelopeExpirationRequest = SetEnvelopeExpirationRequest.builder() - .expiresAt(0L) - .build(); + SetEnvelopeExpirationRequest setEnvelopeExpirationRequest = + SetEnvelopeExpirationRequest.builder().expiresAt(8L).build(); - Envelope response = signplus.signplus.setEnvelopeExpirationDate("envelope_id", setEnvelopeExpirationRequest); + Envelope response = signplus.signplus.setEnvelopeExpirationDate( + "envelope_id", + setEnvelopeExpirationRequest + ); System.out.println(response); } @@ -1107,11 +1135,13 @@ public class Main { Signplus signplus = new Signplus(config); - SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest = SetEnvelopeLegalityLevelRequest.builder() - .legalityLevel(EnvelopeLegalityLevel.SES) - .build(); + SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest = + SetEnvelopeLegalityLevelRequest.builder().legalityLevel(EnvelopeLegalityLevel.SES).build(); - Envelope response = signplus.signplus.setEnvelopeLegalityLevel("envelope_id", setEnvelopeLegalityLevelRequest); + Envelope response = signplus.signplus.setEnvelopeLegalityLevel( + "envelope_id", + setEnvelopeLegalityLevelRequest + ); System.out.println(response); } @@ -1191,10 +1221,8 @@ public class Main { Signplus signplus = new Signplus(config); - ListEnvelopeDocumentAnnotationsResponse response = signplus.signplus.getEnvelopeDocumentAnnotations( - "envelope_id", - "document_id" - ); + ListEnvelopeDocumentAnnotationsResponse response = + signplus.signplus.getEnvelopeDocumentAnnotations("envelope_id", "document_id"); System.out.println(response); } @@ -1251,13 +1279,13 @@ public class Main { AnnotationFont annotationFont = AnnotationFont.builder() .family(AnnotationFontFamily.UNKNOWN) - .italic(true) + .italic(false) .bold(true) .build(); AnnotationText annotationText = AnnotationText.builder() - .size(5.96D) - .color(8.73D) + .size(9.98D) + .color(3.73D) .value("value") .tooltip("tooltip") .dynamicFieldName("dynamic_field_name") @@ -1265,28 +1293,28 @@ public class Main { .build(); AnnotationDateTime annotationDateTime = AnnotationDateTime.builder() - .size(0.26D) + .size(8.01D) .font(annotationFont) .color("color") - .autoFill(true) + .autoFill(false) .timezone("timezone") - .timestamp(1L) + .timestamp(5L) .format(AnnotationDateTimeFormat.DMY_NUMERIC_SLASH) .build(); AnnotationCheckbox annotationCheckbox = AnnotationCheckbox.builder() - .checked(true) + .checked(false) .style(AnnotationCheckboxStyle.CIRCLE_CHECK) .build(); AddAnnotationRequest addAnnotationRequest = AddAnnotationRequest.builder() .recipientId("recipient_id") .documentId("document_id") - .page(2L) - .x(1.99D) - .y(8.2D) - .width(4.89D) - .height(9.43D) + .page(7L) + .x(0.75D) + .y(7.6D) + .width(6.94D) + .height(2.06D) .required(false) .type(AnnotationType.TEXT) .signature(annotationSignature) @@ -1296,7 +1324,10 @@ public class Main { .checkbox(annotationCheckbox) .build(); - Annotation response = signplus.signplus.addEnvelopeAnnotation("envelope_id", addAnnotationRequest); + Annotation response = signplus.signplus.addEnvelopeAnnotation( + "envelope_id", + addAnnotationRequest + ); System.out.println(response); } @@ -1369,7 +1400,9 @@ public class Main { Signplus signplus = new Signplus(config); - CreateTemplateRequest createTemplateRequest = CreateTemplateRequest.builder().name("name").build(); + CreateTemplateRequest createTemplateRequest = CreateTemplateRequest.builder() + .name("name") + .build(); Template response = signplus.signplus.createTemplate(createTemplateRequest); @@ -1422,12 +1455,12 @@ public class Main { .name("name") .tags(tagsList) .ids(idsList) - .first(1L) - .last(6L) + .first(5L) + .last(3L) .after("after") .before("before") .orderField(TemplateOrderField.TEMPLATE_ID) - .ascending(false) + .ascending(true) .build(); ListTemplatesResponse response = signplus.signplus.listTemplates(listTemplatesRequest); @@ -1561,7 +1594,7 @@ Add template document | :------------------------- | :-------------------------------------------------------------------- | :------- | :----------------------------- | | templateId | String | ✅ | | | addTemplateDocumentRequest | [AddTemplateDocumentRequest](../models/AddTemplateDocumentRequest.md) | ✅ | Request Body | -| \_filename | [String](../models/String.md) | ✅ | Filename for the uploaded file | +| \_filename | String | ✅ | Filename for the uploaded file | **Return Type** @@ -1582,13 +1615,16 @@ public class Main { Signplus signplus = new Signplus(config); - AddTemplateDocumentRequest addTemplateDocumentRequest = AddTemplateDocumentRequest.builder().file(file).build(); - AddTemplateDocumentRequest addTemplateDocumentRequest = AddTemplateDocumentRequest.builder().file(file).build(); + byte[] file = new byte[] { 0, 1, 2, 3, 4, 5 }; + + AddTemplateDocumentRequest addTemplateDocumentRequest = AddTemplateDocumentRequest.builder() + .file(file) + .build(); Document response = signplus.signplus.addTemplateDocument( "template_id", addTemplateDocumentRequest, - addTemplateDocumentRequest + "filename.txt" ); System.out.println(response); @@ -1724,15 +1760,19 @@ public class Main { List recipientsList = Arrays.asList(templateRecipient); - TemplateSigningStep templateSigningStep = TemplateSigningStep.builder().recipients(recipientsList).build(); + TemplateSigningStep templateSigningStep = TemplateSigningStep.builder() + .recipients(recipientsList) + .build(); List signingStepsList = Arrays.asList(templateSigningStep); - AddTemplateSigningStepsRequest addTemplateSigningStepsRequest = AddTemplateSigningStepsRequest.builder() - .signingSteps(signingStepsList) - .build(); + AddTemplateSigningStepsRequest addTemplateSigningStepsRequest = + AddTemplateSigningStepsRequest.builder().signingSteps(signingStepsList).build(); - Template response = signplus.signplus.addTemplateSigningSteps("template_id", addTemplateSigningStepsRequest); + Template response = signplus.signplus.addTemplateSigningSteps( + "template_id", + addTemplateSigningStepsRequest + ); System.out.println(response); } @@ -1773,7 +1813,9 @@ public class Main { Signplus signplus = new Signplus(config); - RenameTemplateRequest renameTemplateRequest = RenameTemplateRequest.builder().name("name").build(); + RenameTemplateRequest renameTemplateRequest = RenameTemplateRequest.builder() + .name("name") + .build(); Template response = signplus.signplus.renameTemplate("template_id", renameTemplateRequest); @@ -1820,7 +1862,10 @@ public class Main { .comment("comment") .build(); - Template response = signplus.signplus.setTemplateComment("template_id", setTemplateCommentRequest); + Template response = signplus.signplus.setTemplateComment( + "template_id", + setTemplateCommentRequest + ); System.out.println(response); } @@ -1864,10 +1909,13 @@ public class Main { EnvelopeNotification envelopeNotification = EnvelopeNotification.builder() .subject("subject") .message("message") - .reminderInterval(1L) + .reminderInterval(4L) .build(); - Template response = signplus.signplus.setTemplateNotification("template_id", envelopeNotification); + Template response = signplus.signplus.setTemplateNotification( + "template_id", + envelopeNotification + ); System.out.println(response); } @@ -1906,7 +1954,9 @@ public class Main { Signplus signplus = new Signplus(config); - ListTemplateAnnotationsResponse response = signplus.signplus.getTemplateAnnotations("template_id"); + ListTemplateAnnotationsResponse response = signplus.signplus.getTemplateAnnotations( + "template_id" + ); System.out.println(response); } @@ -1946,10 +1996,8 @@ public class Main { Signplus signplus = new Signplus(config); - ListTemplateDocumentAnnotationsResponse response = signplus.signplus.getDocumentTemplateAnnotations( - "template_id", - "document_id" - ); + ListTemplateDocumentAnnotationsResponse response = + signplus.signplus.getDocumentTemplateAnnotations("template_id", "document_id"); System.out.println(response); } @@ -2006,13 +2054,13 @@ public class Main { AnnotationFont annotationFont = AnnotationFont.builder() .family(AnnotationFontFamily.UNKNOWN) - .italic(true) + .italic(false) .bold(true) .build(); AnnotationText annotationText = AnnotationText.builder() - .size(5.96D) - .color(8.73D) + .size(9.98D) + .color(3.73D) .value("value") .tooltip("tooltip") .dynamicFieldName("dynamic_field_name") @@ -2020,28 +2068,28 @@ public class Main { .build(); AnnotationDateTime annotationDateTime = AnnotationDateTime.builder() - .size(0.26D) + .size(8.01D) .font(annotationFont) .color("color") - .autoFill(true) + .autoFill(false) .timezone("timezone") - .timestamp(1L) + .timestamp(5L) .format(AnnotationDateTimeFormat.DMY_NUMERIC_SLASH) .build(); AnnotationCheckbox annotationCheckbox = AnnotationCheckbox.builder() - .checked(true) + .checked(false) .style(AnnotationCheckboxStyle.CIRCLE_CHECK) .build(); AddAnnotationRequest addAnnotationRequest = AddAnnotationRequest.builder() .recipientId("recipient_id") .documentId("document_id") - .page(2L) - .x(1.99D) - .y(8.2D) - .width(4.89D) - .height(9.43D) + .page(7L) + .x(0.75D) + .y(7.6D) + .width(6.94D) + .height(2.06D) .required(false) .type(AnnotationType.TEXT) .signature(annotationSignature) @@ -2051,7 +2099,10 @@ public class Main { .checkbox(annotationCheckbox) .build(); - Annotation response = signplus.signplus.addTemplateAnnotation("template_id", addAnnotationRequest); + Annotation response = signplus.signplus.addTemplateAnnotation( + "template_id", + addAnnotationRequest + ); System.out.println(response); } @@ -2126,7 +2177,9 @@ public class Main { Signplus signplus = new Signplus(config); - AttachmentSettings attachmentSettings = AttachmentSettings.builder().visibleToRecipients(false).build(); + AttachmentSettings attachmentSettings = AttachmentSettings.builder() + .visibleToRecipients(true) + .build(); SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest = SetEnvelopeAttachmentsSettingsRequest.builder().settings(attachmentSettings).build(); @@ -2178,16 +2231,19 @@ public class Main { Signplus signplus = new Signplus(config); - AttachmentPlaceholderRequest attachmentPlaceholderRequest = AttachmentPlaceholderRequest.builder() - .recipientId("recipient_id") - .id("id") - .name("name") - .hint("hint") - .required(false) - .multiple(true) - .build(); - - List placeholdersList = Arrays.asList(attachmentPlaceholderRequest); + AttachmentPlaceholderRequest attachmentPlaceholderRequest = + AttachmentPlaceholderRequest.builder() + .recipientId("recipient_id") + .id("id") + .name("name") + .hint("hint") + .required(true) + .multiple(true) + .build(); + + List placeholdersList = Arrays.asList( + attachmentPlaceholderRequest + ); SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest = SetEnvelopeAttachmentsPlaceholdersRequest.builder().placeholders(placeholdersList).build(); diff --git a/documentation/snippets/snippets.json b/documentation/snippets/snippets.json new file mode 100644 index 0000000..9d3db63 --- /dev/null +++ b/documentation/snippets/snippets.json @@ -0,0 +1,282 @@ +{ + "endpoints": { + "/envelope": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.CreateEnvelopeRequest;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.EnvelopeLegalityLevel;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tCreateEnvelopeRequest createEnvelopeRequest = CreateEnvelopeRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.legalityLevel(EnvelopeLegalityLevel.SES)\n\t\t\t.expiresAt(8L)\n\t\t\t.comment(\"comment\")\n\t\t\t.sandbox(false)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.createEnvelope(createEnvelopeRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/from_template/{template_id}": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.CreateEnvelopeFromTemplateRequest;\nimport com.alohi.signplus.models.Envelope;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tCreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest = CreateEnvelopeFromTemplateRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.comment(\"comment\")\n\t\t\t.sandbox(true)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.createEnvelopeFromTemplate(\"template_id\", createEnvelopeFromTemplateRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelopes": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.EnvelopeOrderField;\nimport com.alohi.signplus.models.EnvelopeStatus;\nimport com.alohi.signplus.models.ListEnvelopesRequest;\nimport com.alohi.signplus.models.ListEnvelopesResponse;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tList tagsList = Arrays.asList(\"tags\");\n\t\t\n\t\tList idsList = Arrays.asList(\"ids\");\n\t\t\n\t\tList statusesList = Arrays.asList(EnvelopeStatus.DRAFT);\n\t\t\n\t\tList folderIdsList = Arrays.asList(\"folder_ids\");\n\t\t\n\t\tListEnvelopesRequest listEnvelopesRequest = ListEnvelopesRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.tags(tagsList)\n\t\t\t.comment(\"comment\")\n\t\t\t.ids(idsList)\n\t\t\t.statuses(statusesList)\n\t\t\t.folderIds(folderIdsList)\n\t\t\t.onlyRootFolder(false)\n\t\t\t.dateFrom(0L)\n\t\t\t.dateTo(1L)\n\t\t\t.uid(\"uid\")\n\t\t\t.first(6L)\n\t\t\t.last(6L)\n\t\t\t.after(\"after\")\n\t\t\t.before(\"before\")\n\t\t\t.orderField(EnvelopeOrderField.CREATION_DATE)\n\t\t\t.ascending(false)\n\t\t\t.includeTrash(true)\n\t\t\t.build();\n\n\t\tListEnvelopesResponse response = signplus.signplus.listEnvelopes(listEnvelopesRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelope response = signplus.signplus.getEnvelope(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n", + "delete": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tsignplus.signplus.deleteEnvelope(\"envelope_id\");\n }\n}\n" + }, + "/envelope/{envelope_id}/signed_documents": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.DownloadEnvelopeSignedDocumentsParameters;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tDownloadEnvelopeSignedDocumentsParameters requestParameters = DownloadEnvelopeSignedDocumentsParameters.builder()\n\t\t\t.certificateOfCompletion(true)\n\t\t\t.build();\n\n\t\tbyte[] response = signplus.signplus.downloadEnvelopeSignedDocuments(\"envelope_id\", requestParameters);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/certificate": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tbyte[] response = signplus.signplus.downloadEnvelopeCertificate(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/document/{document_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Document;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tDocument response = signplus.signplus.getEnvelopeDocument(\"envelope_id\", \"document_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/documents": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListEnvelopeDocumentsResponse;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListEnvelopeDocumentsResponse response = signplus.signplus.getEnvelopeDocuments(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/document": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddEnvelopeDocumentRequest;\nimport com.alohi.signplus.models.Document;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tbyte[] file = new byte[] { 0, 1, 2, 3, 4, 5 };\n\t\t\n\t\tAddEnvelopeDocumentRequest addEnvelopeDocumentRequest = AddEnvelopeDocumentRequest.builder()\n\t\t\t.file(file)\n\t\t\t.build();\n\n\t\tDocument response = signplus.signplus.addEnvelopeDocument(\"envelope_id\", addEnvelopeDocumentRequest, \"filename.txt\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/dynamic_fields": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.DynamicField;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.SetEnvelopeDynamicFieldsRequest;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tDynamicField dynamicField = DynamicField.builder()\n\t\t\t.name(\"name\")\n\t\t\t.value(\"value\")\n\t\t\t.build();\n\t\t\n\t\tList dynamicFieldsList = Arrays.asList(dynamicField);\n\t\t\n\t\tSetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest = SetEnvelopeDynamicFieldsRequest.builder()\n\t\t\t.dynamicFields(dynamicFieldsList)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.setEnvelopeDynamicFields(\"envelope_id\", setEnvelopeDynamicFieldsRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/signing_steps": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddEnvelopeSigningStepsRequest;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.Recipient;\nimport com.alohi.signplus.models.RecipientRole;\nimport com.alohi.signplus.models.RecipientVerification;\nimport com.alohi.signplus.models.RecipientVerificationType;\nimport com.alohi.signplus.models.SigningStep;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tRecipientVerification recipientVerification = RecipientVerification.builder()\n\t\t\t.type(RecipientVerificationType.SMS)\n\t\t\t.value(\"value\")\n\t\t\t.build();\n\t\t\n\t\tRecipient recipient = Recipient.builder()\n\t\t\t.id(\"id\")\n\t\t\t.uid(\"uid\")\n\t\t\t.name(\"name\")\n\t\t\t.email(\"email\")\n\t\t\t.role(RecipientRole.SIGNER)\n\t\t\t.verification(recipientVerification)\n\t\t\t.build();\n\t\t\n\t\tList recipientsList = Arrays.asList(recipient);\n\t\t\n\t\tSigningStep signingStep = SigningStep.builder()\n\t\t\t.recipients(recipientsList)\n\t\t\t.build();\n\t\t\n\t\tList signingStepsList = Arrays.asList(signingStep);\n\t\t\n\t\tAddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest = AddEnvelopeSigningStepsRequest.builder()\n\t\t\t.signingSteps(signingStepsList)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.addEnvelopeSigningSteps(\"envelope_id\", addEnvelopeSigningStepsRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/attachments/settings": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AttachmentSettings;\nimport com.alohi.signplus.models.EnvelopeAttachments;\nimport com.alohi.signplus.models.SetEnvelopeAttachmentsSettingsRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAttachmentSettings attachmentSettings = AttachmentSettings.builder()\n\t\t\t.visibleToRecipients(true)\n\t\t\t.build();\n\t\t\n\t\tSetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest = SetEnvelopeAttachmentsSettingsRequest.builder()\n\t\t\t.settings(attachmentSettings)\n\t\t\t.build();\n\n\t\tEnvelopeAttachments response = signplus.signplus.setEnvelopeAttachmentsSettings(\"envelope_id\", setEnvelopeAttachmentsSettingsRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/attachments/placeholders": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AttachmentPlaceholderRequest;\nimport com.alohi.signplus.models.EnvelopeAttachments;\nimport com.alohi.signplus.models.SetEnvelopeAttachmentsPlaceholdersRequest;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAttachmentPlaceholderRequest attachmentPlaceholderRequest = AttachmentPlaceholderRequest.builder()\n\t\t\t.recipientId(\"recipient_id\")\n\t\t\t.id(\"id\")\n\t\t\t.name(\"name\")\n\t\t\t.hint(\"hint\")\n\t\t\t.required(true)\n\t\t\t.multiple(true)\n\t\t\t.build();\n\t\t\n\t\tList placeholdersList = Arrays.asList(attachmentPlaceholderRequest);\n\t\t\n\t\tSetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest = SetEnvelopeAttachmentsPlaceholdersRequest.builder()\n\t\t\t.placeholders(placeholdersList)\n\t\t\t.build();\n\n\t\tEnvelopeAttachments response = signplus.signplus.setEnvelopeAttachmentsPlaceholders(\"envelope_id\", setEnvelopeAttachmentsPlaceholdersRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/attachments/{file_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tbyte[] response = signplus.signplus.getAttachmentFile(\"envelope_id\", \"file_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/send": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelope response = signplus.signplus.sendEnvelope(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/duplicate": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelope response = signplus.signplus.duplicateEnvelope(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/void": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelope response = signplus.signplus.voidEnvelope(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/rename": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.RenameEnvelopeRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tRenameEnvelopeRequest renameEnvelopeRequest = RenameEnvelopeRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.renameEnvelope(\"envelope_id\", renameEnvelopeRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/set_comment": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.SetEnvelopeCommentRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tSetEnvelopeCommentRequest setEnvelopeCommentRequest = SetEnvelopeCommentRequest.builder()\n\t\t\t.comment(\"comment\")\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.setEnvelopeComment(\"envelope_id\", setEnvelopeCommentRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/set_notification": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.EnvelopeNotification;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelopeNotification envelopeNotification = EnvelopeNotification.builder()\n\t\t\t.subject(\"subject\")\n\t\t\t.message(\"message\")\n\t\t\t.reminderInterval(4L)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.setEnvelopeNotification(\"envelope_id\", envelopeNotification);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/set_expiration_date": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.SetEnvelopeExpirationRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tSetEnvelopeExpirationRequest setEnvelopeExpirationRequest = SetEnvelopeExpirationRequest.builder()\n\t\t\t.expiresAt(8L)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.setEnvelopeExpirationDate(\"envelope_id\", setEnvelopeExpirationRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/set_legality_level": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Envelope;\nimport com.alohi.signplus.models.EnvelopeLegalityLevel;\nimport com.alohi.signplus.models.SetEnvelopeLegalityLevelRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tSetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest = SetEnvelopeLegalityLevelRequest.builder()\n\t\t\t.legalityLevel(EnvelopeLegalityLevel.SES)\n\t\t\t.build();\n\n\t\tEnvelope response = signplus.signplus.setEnvelopeLegalityLevel(\"envelope_id\", setEnvelopeLegalityLevelRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/annotations": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Annotation;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tList response = signplus.signplus.getEnvelopeAnnotations(\"envelope_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/annotations/{document_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListEnvelopeDocumentAnnotationsResponse;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListEnvelopeDocumentAnnotationsResponse response = signplus.signplus.getEnvelopeDocumentAnnotations(\"envelope_id\", \"document_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/annotation": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddAnnotationRequest;\nimport com.alohi.signplus.models.Annotation;\nimport com.alohi.signplus.models.AnnotationCheckbox;\nimport com.alohi.signplus.models.AnnotationCheckboxStyle;\nimport com.alohi.signplus.models.AnnotationDateTime;\nimport com.alohi.signplus.models.AnnotationDateTimeFormat;\nimport com.alohi.signplus.models.AnnotationFont;\nimport com.alohi.signplus.models.AnnotationFontFamily;\nimport com.alohi.signplus.models.AnnotationInitials;\nimport com.alohi.signplus.models.AnnotationSignature;\nimport com.alohi.signplus.models.AnnotationText;\nimport com.alohi.signplus.models.AnnotationType;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAnnotationSignature annotationSignature = AnnotationSignature.builder()\n\t\t\t.id(\"id\")\n\t\t\t.build();\n\t\t\n\t\tAnnotationInitials annotationInitials = AnnotationInitials.builder()\n\t\t\t.id(\"id\")\n\t\t\t.build();\n\t\t\n\t\tAnnotationFont annotationFont = AnnotationFont.builder()\n\t\t\t.family(AnnotationFontFamily.UNKNOWN)\n\t\t\t.italic(false)\n\t\t\t.bold(true)\n\t\t\t.build();\n\t\t\n\t\tAnnotationText annotationText = AnnotationText.builder()\n\t\t\t.size(9.98D)\n\t\t\t.color(3.73D)\n\t\t\t.value(\"value\")\n\t\t\t.tooltip(\"tooltip\")\n\t\t\t.dynamicFieldName(\"dynamic_field_name\")\n\t\t\t.font(annotationFont)\n\t\t\t.build();\n\t\t\n\t\tAnnotationDateTime annotationDateTime = AnnotationDateTime.builder()\n\t\t\t.size(8.01D)\n\t\t\t.font(annotationFont)\n\t\t\t.color(\"color\")\n\t\t\t.autoFill(false)\n\t\t\t.timezone(\"timezone\")\n\t\t\t.timestamp(5L)\n\t\t\t.format(AnnotationDateTimeFormat.DMY_NUMERIC_SLASH)\n\t\t\t.build();\n\t\t\n\t\tAnnotationCheckbox annotationCheckbox = AnnotationCheckbox.builder()\n\t\t\t.checked(false)\n\t\t\t.style(AnnotationCheckboxStyle.CIRCLE_CHECK)\n\t\t\t.build();\n\t\t\n\t\tAddAnnotationRequest addAnnotationRequest = AddAnnotationRequest.builder()\n\t\t\t.recipientId(\"recipient_id\")\n\t\t\t.documentId(\"document_id\")\n\t\t\t.page(7L)\n\t\t\t.x(0.75D)\n\t\t\t.y(7.6D)\n\t\t\t.width(6.94D)\n\t\t\t.height(2.06D)\n\t\t\t.required(false)\n\t\t\t.type(AnnotationType.TEXT)\n\t\t\t.signature(annotationSignature)\n\t\t\t.initials(annotationInitials)\n\t\t\t.text(annotationText)\n\t\t\t.datetime(annotationDateTime)\n\t\t\t.checkbox(annotationCheckbox)\n\t\t\t.build();\n\n\t\tAnnotation response = signplus.signplus.addEnvelopeAnnotation(\"envelope_id\", addAnnotationRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/envelope/{envelope_id}/annotation/{annotation_id}": { + "delete": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tsignplus.signplus.deleteEnvelopeAnnotation(\"envelope_id\", \"annotation_id\");\n }\n}\n" + }, + "/template": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.CreateTemplateRequest;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tCreateTemplateRequest createTemplateRequest = CreateTemplateRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.build();\n\n\t\tTemplate response = signplus.signplus.createTemplate(createTemplateRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/templates": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListTemplatesRequest;\nimport com.alohi.signplus.models.ListTemplatesResponse;\nimport com.alohi.signplus.models.TemplateOrderField;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tList tagsList = Arrays.asList(\"tags\");\n\t\t\n\t\tList idsList = Arrays.asList(\"ids\");\n\t\t\n\t\tListTemplatesRequest listTemplatesRequest = ListTemplatesRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.tags(tagsList)\n\t\t\t.ids(idsList)\n\t\t\t.first(5L)\n\t\t\t.last(3L)\n\t\t\t.after(\"after\")\n\t\t\t.before(\"before\")\n\t\t\t.orderField(TemplateOrderField.TEMPLATE_ID)\n\t\t\t.ascending(true)\n\t\t\t.build();\n\n\t\tListTemplatesResponse response = signplus.signplus.listTemplates(listTemplatesRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tTemplate response = signplus.signplus.getTemplate(\"template_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n", + "delete": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tsignplus.signplus.deleteTemplate(\"template_id\");\n }\n}\n" + }, + "/template/{template_id}/duplicate": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tTemplate response = signplus.signplus.duplicateTemplate(\"template_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/document": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddTemplateDocumentRequest;\nimport com.alohi.signplus.models.Document;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tbyte[] file = new byte[] { 0, 1, 2, 3, 4, 5 };\n\t\t\n\t\tAddTemplateDocumentRequest addTemplateDocumentRequest = AddTemplateDocumentRequest.builder()\n\t\t\t.file(file)\n\t\t\t.build();\n\n\t\tDocument response = signplus.signplus.addTemplateDocument(\"template_id\", addTemplateDocumentRequest, \"filename.txt\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/document/{document_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.Document;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tDocument response = signplus.signplus.getTemplateDocument(\"template_id\", \"document_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/documents": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListTemplateDocumentsResponse;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListTemplateDocumentsResponse response = signplus.signplus.getTemplateDocuments(\"template_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/signing_steps": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddTemplateSigningStepsRequest;\nimport com.alohi.signplus.models.Template;\nimport com.alohi.signplus.models.TemplateRecipient;\nimport com.alohi.signplus.models.TemplateRecipientRole;\nimport com.alohi.signplus.models.TemplateSigningStep;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tTemplateRecipient templateRecipient = TemplateRecipient.builder()\n\t\t\t.id(\"id\")\n\t\t\t.uid(\"uid\")\n\t\t\t.name(\"name\")\n\t\t\t.email(\"email\")\n\t\t\t.role(TemplateRecipientRole.SIGNER)\n\t\t\t.build();\n\t\t\n\t\tList recipientsList = Arrays.asList(templateRecipient);\n\t\t\n\t\tTemplateSigningStep templateSigningStep = TemplateSigningStep.builder()\n\t\t\t.recipients(recipientsList)\n\t\t\t.build();\n\t\t\n\t\tList signingStepsList = Arrays.asList(templateSigningStep);\n\t\t\n\t\tAddTemplateSigningStepsRequest addTemplateSigningStepsRequest = AddTemplateSigningStepsRequest.builder()\n\t\t\t.signingSteps(signingStepsList)\n\t\t\t.build();\n\n\t\tTemplate response = signplus.signplus.addTemplateSigningSteps(\"template_id\", addTemplateSigningStepsRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/rename": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.RenameTemplateRequest;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tRenameTemplateRequest renameTemplateRequest = RenameTemplateRequest.builder()\n\t\t\t.name(\"name\")\n\t\t\t.build();\n\n\t\tTemplate response = signplus.signplus.renameTemplate(\"template_id\", renameTemplateRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/set_comment": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.SetTemplateCommentRequest;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tSetTemplateCommentRequest setTemplateCommentRequest = SetTemplateCommentRequest.builder()\n\t\t\t.comment(\"comment\")\n\t\t\t.build();\n\n\t\tTemplate response = signplus.signplus.setTemplateComment(\"template_id\", setTemplateCommentRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/set_notification": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.EnvelopeNotification;\nimport com.alohi.signplus.models.Template;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tEnvelopeNotification envelopeNotification = EnvelopeNotification.builder()\n\t\t\t.subject(\"subject\")\n\t\t\t.message(\"message\")\n\t\t\t.reminderInterval(4L)\n\t\t\t.build();\n\n\t\tTemplate response = signplus.signplus.setTemplateNotification(\"template_id\", envelopeNotification);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/annotations": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListTemplateAnnotationsResponse;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListTemplateAnnotationsResponse response = signplus.signplus.getTemplateAnnotations(\"template_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/annotations/{document_id}": { + "get": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListTemplateDocumentAnnotationsResponse;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListTemplateDocumentAnnotationsResponse response = signplus.signplus.getDocumentTemplateAnnotations(\"template_id\", \"document_id\");\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/annotation": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AddAnnotationRequest;\nimport com.alohi.signplus.models.Annotation;\nimport com.alohi.signplus.models.AnnotationCheckbox;\nimport com.alohi.signplus.models.AnnotationCheckboxStyle;\nimport com.alohi.signplus.models.AnnotationDateTime;\nimport com.alohi.signplus.models.AnnotationDateTimeFormat;\nimport com.alohi.signplus.models.AnnotationFont;\nimport com.alohi.signplus.models.AnnotationFontFamily;\nimport com.alohi.signplus.models.AnnotationInitials;\nimport com.alohi.signplus.models.AnnotationSignature;\nimport com.alohi.signplus.models.AnnotationText;\nimport com.alohi.signplus.models.AnnotationType;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAnnotationSignature annotationSignature = AnnotationSignature.builder()\n\t\t\t.id(\"id\")\n\t\t\t.build();\n\t\t\n\t\tAnnotationInitials annotationInitials = AnnotationInitials.builder()\n\t\t\t.id(\"id\")\n\t\t\t.build();\n\t\t\n\t\tAnnotationFont annotationFont = AnnotationFont.builder()\n\t\t\t.family(AnnotationFontFamily.UNKNOWN)\n\t\t\t.italic(false)\n\t\t\t.bold(true)\n\t\t\t.build();\n\t\t\n\t\tAnnotationText annotationText = AnnotationText.builder()\n\t\t\t.size(9.98D)\n\t\t\t.color(3.73D)\n\t\t\t.value(\"value\")\n\t\t\t.tooltip(\"tooltip\")\n\t\t\t.dynamicFieldName(\"dynamic_field_name\")\n\t\t\t.font(annotationFont)\n\t\t\t.build();\n\t\t\n\t\tAnnotationDateTime annotationDateTime = AnnotationDateTime.builder()\n\t\t\t.size(8.01D)\n\t\t\t.font(annotationFont)\n\t\t\t.color(\"color\")\n\t\t\t.autoFill(false)\n\t\t\t.timezone(\"timezone\")\n\t\t\t.timestamp(5L)\n\t\t\t.format(AnnotationDateTimeFormat.DMY_NUMERIC_SLASH)\n\t\t\t.build();\n\t\t\n\t\tAnnotationCheckbox annotationCheckbox = AnnotationCheckbox.builder()\n\t\t\t.checked(false)\n\t\t\t.style(AnnotationCheckboxStyle.CIRCLE_CHECK)\n\t\t\t.build();\n\t\t\n\t\tAddAnnotationRequest addAnnotationRequest = AddAnnotationRequest.builder()\n\t\t\t.recipientId(\"recipient_id\")\n\t\t\t.documentId(\"document_id\")\n\t\t\t.page(7L)\n\t\t\t.x(0.75D)\n\t\t\t.y(7.6D)\n\t\t\t.width(6.94D)\n\t\t\t.height(2.06D)\n\t\t\t.required(false)\n\t\t\t.type(AnnotationType.TEXT)\n\t\t\t.signature(annotationSignature)\n\t\t\t.initials(annotationInitials)\n\t\t\t.text(annotationText)\n\t\t\t.datetime(annotationDateTime)\n\t\t\t.checkbox(annotationCheckbox)\n\t\t\t.build();\n\n\t\tAnnotation response = signplus.signplus.addTemplateAnnotation(\"template_id\", addAnnotationRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/annotation/{annotation_id}": { + "delete": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tsignplus.signplus.deleteTemplateAnnotation(\"template_id\", \"annotation_id\");\n }\n}\n" + }, + "/template/{template_id}/attachments/settings": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AttachmentSettings;\nimport com.alohi.signplus.models.EnvelopeAttachments;\nimport com.alohi.signplus.models.SetEnvelopeAttachmentsSettingsRequest;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAttachmentSettings attachmentSettings = AttachmentSettings.builder()\n\t\t\t.visibleToRecipients(true)\n\t\t\t.build();\n\t\t\n\t\tSetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest = SetEnvelopeAttachmentsSettingsRequest.builder()\n\t\t\t.settings(attachmentSettings)\n\t\t\t.build();\n\n\t\tEnvelopeAttachments response = signplus.signplus.setTemplateAttachmentsSettings(\"template_id\", setEnvelopeAttachmentsSettingsRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/template/{template_id}/attachments/placeholders": { + "put": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.AttachmentPlaceholderRequest;\nimport com.alohi.signplus.models.EnvelopeAttachments;\nimport com.alohi.signplus.models.SetEnvelopeAttachmentsPlaceholdersRequest;\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tAttachmentPlaceholderRequest attachmentPlaceholderRequest = AttachmentPlaceholderRequest.builder()\n\t\t\t.recipientId(\"recipient_id\")\n\t\t\t.id(\"id\")\n\t\t\t.name(\"name\")\n\t\t\t.hint(\"hint\")\n\t\t\t.required(true)\n\t\t\t.multiple(true)\n\t\t\t.build();\n\t\t\n\t\tList placeholdersList = Arrays.asList(attachmentPlaceholderRequest);\n\t\t\n\t\tSetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest = SetEnvelopeAttachmentsPlaceholdersRequest.builder()\n\t\t\t.placeholders(placeholdersList)\n\t\t\t.build();\n\n\t\tEnvelopeAttachments response = signplus.signplus.setTemplateAttachmentsPlaceholders(\"template_id\", setEnvelopeAttachmentsPlaceholdersRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/webhook": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.CreateWebhookRequest;\nimport com.alohi.signplus.models.Webhook;\nimport com.alohi.signplus.models.WebhookEvent;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tCreateWebhookRequest createWebhookRequest = CreateWebhookRequest.builder()\n\t\t\t.event(WebhookEvent.ENVELOPE_EXPIRED)\n\t\t\t.target(\"target\")\n\t\t\t.build();\n\n\t\tWebhook response = signplus.signplus.createWebhook(createWebhookRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/webhooks": { + "post": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.models.ListWebhooksRequest;\nimport com.alohi.signplus.models.ListWebhooksResponse;\nimport com.alohi.signplus.models.WebhookEvent;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tListWebhooksRequest listWebhooksRequest = ListWebhooksRequest.builder()\n\t\t\t.webhookId(\"webhook_id\")\n\t\t\t.event(WebhookEvent.ENVELOPE_EXPIRED)\n\t\t\t.build();\n\n\t\tListWebhooksResponse response = signplus.signplus.listWebhooks(listWebhooksRequest);\n\t\t\t\n\t\tSystem.out.println(response);\n }\n}\n" + }, + "/webhook/{webhook_id}": { + "delete": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n public static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\n\t\tsignplus.signplus.deleteWebhook(\"webhook_id\");\n }\n}\n" + } + }, + "methodResponses": { + "/envelope": { + "post": "System.out.println(response);" + }, + "/envelope/from_template/{template_id}": { + "post": "System.out.println(response);" + }, + "/envelopes": { + "post": "System.out.println(response);" + }, + "/envelope/{envelope_id}": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/signed_documents": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/certificate": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/document/{document_id}": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/documents": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/document": { + "post": "System.out.println(response);" + }, + "/envelope/{envelope_id}/dynamic_fields": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/signing_steps": { + "post": "System.out.println(response);" + }, + "/envelope/{envelope_id}/attachments/settings": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/attachments/placeholders": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/attachments/{file_id}": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/send": { + "post": "System.out.println(response);" + }, + "/envelope/{envelope_id}/duplicate": { + "post": "System.out.println(response);" + }, + "/envelope/{envelope_id}/void": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/rename": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/set_comment": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/set_notification": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/set_expiration_date": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/set_legality_level": { + "put": "System.out.println(response);" + }, + "/envelope/{envelope_id}/annotations": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/annotations/{document_id}": { + "get": "System.out.println(response);" + }, + "/envelope/{envelope_id}/annotation": { + "post": "System.out.println(response);" + }, + "/template": { + "post": "System.out.println(response);" + }, + "/templates": { + "post": "System.out.println(response);" + }, + "/template/{template_id}": { + "get": "System.out.println(response);" + }, + "/template/{template_id}/duplicate": { + "post": "System.out.println(response);" + }, + "/template/{template_id}/document": { + "post": "System.out.println(response);" + }, + "/template/{template_id}/document/{document_id}": { + "get": "System.out.println(response);" + }, + "/template/{template_id}/documents": { + "get": "System.out.println(response);" + }, + "/template/{template_id}/signing_steps": { + "post": "System.out.println(response);" + }, + "/template/{template_id}/rename": { + "put": "System.out.println(response);" + }, + "/template/{template_id}/set_comment": { + "put": "System.out.println(response);" + }, + "/template/{template_id}/set_notification": { + "put": "System.out.println(response);" + }, + "/template/{template_id}/annotations": { + "get": "System.out.println(response);" + }, + "/template/{template_id}/annotations/{document_id}": { + "get": "System.out.println(response);" + }, + "/template/{template_id}/annotation": { + "post": "System.out.println(response);" + }, + "/template/{template_id}/attachments/settings": { + "put": "System.out.println(response);" + }, + "/template/{template_id}/attachments/placeholders": { + "put": "System.out.println(response);" + }, + "/webhook": { + "post": "System.out.println(response);" + }, + "/webhooks": { + "post": "System.out.println(response);" + } + }, + "example": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\nimport com.alohi.signplus.exceptions.ApiError;\nimport com.alohi.signplus.models.Envelope;\n \npublic class Main {\n public static void main(String[] args) {\n SignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n Signplus signplus = new Signplus(config);\n\n\n try {\n Envelope response = signplus.signplus.getEnvelope(\"envelope_id\");\n \n System.out.println(response);\n } catch (ApiError e) {\n e.printStackTrace();\n }\n\n System.exit(0);\n }\n}\n", + "authentication": { + "bearer": { + "constructor": "import com.alohi.signplus.Signplus;\nimport com.alohi.signplus.config.SignplusConfig;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tSignplusConfig config = SignplusConfig.builder()\n\t\t\t.accessToken(\"YOUR_ACCESS_TOKEN\")\n\t\t\t.build();\n\n\t\tSignplus signplus = new Signplus(config);\n\t}\n}", + "setter": "signplus.setAccessToken('YOUR_ACCESS_TOKEN');" + } + } +} diff --git a/examples/.gitignore b/examples/.gitignore index beceff9..a7e1cf7 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -29,6 +29,9 @@ build/ gradle-app.setting !gradle-wrapper.jar +# Kotlin +.kotlin + # IntelliJ out/ .idea/ diff --git a/examples/pom.xml b/examples/pom.xml index cdea5a0..ff2a369 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -22,7 +22,7 @@ com.alohi signplus - 2.4.0 + 4.0.0 @@ -49,7 +49,7 @@ maven-surefire-plugin - 2.22.1 + 2.22.2 maven-jar-plugin diff --git a/pom.xml b/pom.xml index 4616a63..abe2ec1 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.alohi signplus - 2.4.0 + 4.0.0 ${project.groupId}:${project.artifactId} @@ -18,7 +18,9 @@ scm:git:git://github.com/alohihq/signplus-java.git - scm:git:ssh://github.com/alohihq/signplus-java.git + + scm:git:ssh://github.com/alohihq/signplus-java.git + https://github.com/alohihq/signplus-java @@ -54,7 +56,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.42 provided @@ -183,7 +185,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.42 diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..42070c2 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,39 @@ +// Prettier configuration for code-formatter lambda +// Aligned with sdk-gen/prettier.config.ts + +module.exports = { + printWidth: 100, + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + quoteProps: 'as-needed', + jsxSingleQuote: false, + trailingComma: 'all', + bracketSpacing: true, + arrowParens: 'always', + overrides: [ + { + files: '.editorconfig', + options: { parser: 'yaml' }, + }, + { + files: 'LICENSE', + options: { parser: 'markdown' }, + }, + { + files: '*.php', + options: { + parser: 'php', + phpVersion: '8.0', + trailingCommaPHP: false, + }, + }, + { + files: '*.md', + options: { + parser: 'markdown', + }, + }, + ], +}; diff --git a/src/main/java/com/alohi/signplus/Signplus.java b/src/main/java/com/alohi/signplus/Signplus.java index 79ef2a6..522601b 100644 --- a/src/main/java/com/alohi/signplus/Signplus.java +++ b/src/main/java/com/alohi/signplus/Signplus.java @@ -8,18 +8,29 @@ import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; -/** Integrate legally-binding electronic signature to your workflow */ +/** + * Integrate legally-binding electronic signature to your workflow + */ public class Signplus { public final SignplusService signplus; private final SignplusConfig config; + /** + * Constructs a new instance of Signplus with default configuration. + */ public Signplus() { // Default configs this(SignplusConfig.builder().build()); } + /** + * Constructs a new instance of Signplus with custom configuration. + * Initializes all services, HTTP client, and optional OAuth token manager. + * + * @param config The SDK configuration including base URL, authentication, timeout, and retry settings + */ public Signplus(SignplusConfig config) { this.config = config; @@ -32,14 +43,29 @@ public Signplus(SignplusConfig config) { this.signplus = new SignplusService(httpClient, config); } + /** + * Sets the environment for all API requests. + * + * @param environment The environment to use (e.g., DEFAULT, PRODUCTION, STAGING) + */ public void setEnvironment(Environment environment) { setBaseUrl(environment.getUrl()); } + /** + * Sets the base URL for all API requests. + * + * @param baseUrl The base URL to use for API requests + */ public void setBaseUrl(String baseUrl) { this.config.setBaseUrl(baseUrl); } + /** + * Sets the access token (Bearer token) for all API requests. + * + * @param token The access token to use for authentication + */ public void setAccessToken(String token) { this.config.setAccessToken(token); } diff --git a/src/main/java/com/alohi/signplus/config/RequestConfig.java b/src/main/java/com/alohi/signplus/config/RequestConfig.java new file mode 100644 index 0000000..b6b451c --- /dev/null +++ b/src/main/java/com/alohi/signplus/config/RequestConfig.java @@ -0,0 +1,60 @@ +package com.alohi.signplus.config; + +import com.alohi.signplus.http.Environment; +import lombok.Builder; +import lombok.Data; + +/** + * Configuration class for request-level, method-level, and service-level overrides. + * + *

Provides a hierarchical configuration override mechanism with the following priority + * (highest to lowest): + *

    + *
  1. Request config - passed directly to a method call
  2. + *
  3. Method config - set via {@code setConfig()} on a service
  4. + *
  5. Service config - set via {@code setConfig()} on a service
  6. + *
  7. SDK config - set at SDK initialization
  8. + *
+ * + *

All fields are optional (nullable). Only non-null fields will override the corresponding + * SDK-level configuration values. + */ +@Builder +@Data +public class RequestConfig { + + /** Override the base URL for API requests. */ + private String baseUrl; + + /** Override the environment for API requests. */ + private Environment environment; + + /** Override the request timeout in milliseconds. */ + private Long timeout; + + /** Override the access token (Bearer token) for authentication. */ + private String accessToken; + + /** Override the retry configuration. */ + private RetryConfig retryConfig; + + /** + * Merges multiple {@link RequestConfig} instances in order. Later configs take precedence + * over earlier ones for any non-null field. + * + * @param configs The configs to merge (in order of increasing priority) + * @return A new merged {@link RequestConfig} + */ + public static RequestConfig merge(RequestConfig... configs) { + RequestConfigBuilder builder = RequestConfig.builder(); + for (RequestConfig cfg : configs) { + if (cfg == null) continue; + if (cfg.getBaseUrl() != null) builder.baseUrl(cfg.getBaseUrl()); + if (cfg.getEnvironment() != null) builder.environment(cfg.getEnvironment()); + if (cfg.getTimeout() != null) builder.timeout(cfg.getTimeout()); + if (cfg.getAccessToken() != null) builder.accessToken(cfg.getAccessToken()); + if (cfg.getRetryConfig() != null) builder.retryConfig(cfg.getRetryConfig()); + } + return builder.build(); + } +} diff --git a/src/main/java/com/alohi/signplus/config/RetryConfig.java b/src/main/java/com/alohi/signplus/config/RetryConfig.java index 99c602c..a2b139f 100644 --- a/src/main/java/com/alohi/signplus/config/RetryConfig.java +++ b/src/main/java/com/alohi/signplus/config/RetryConfig.java @@ -5,10 +5,16 @@ import java.net.SocketException; import java.net.SocketTimeoutException; import java.util.Arrays; +import java.util.Collections; import java.util.List; import lombok.Builder; import lombok.Data; +/** + * Configuration for automatic retry behavior on failed requests. + * Defines retry limits, backoff strategy, and conditions for retrying requests. + * Uses builder pattern for flexible configuration with sensible defaults. + */ @Data @Builder public class RetryConfig { @@ -29,7 +35,7 @@ public class RetryConfig { private int jitter = 50; @Builder.Default - private List statusCodesToRetry = Arrays.asList(408, 429, 500, 502, 503, 504); + private List statusCodesToRetry = Collections.emptyList(); @Builder.Default private List httpMethodsToRetry = Arrays.asList( diff --git a/src/main/java/com/alohi/signplus/config/SignplusConfig.java b/src/main/java/com/alohi/signplus/config/SignplusConfig.java index 3c0ae4c..b46b0e0 100644 --- a/src/main/java/com/alohi/signplus/config/SignplusConfig.java +++ b/src/main/java/com/alohi/signplus/config/SignplusConfig.java @@ -6,13 +6,18 @@ import lombok.NonNull; import lombok.Setter; +/** + * Configuration class for SDK client settings. + * Provides builder pattern for configuring base URLs, authentication, timeouts, and retry behavior. + * All configuration options have sensible defaults and can be customized as needed. + */ @Builder @Data public class SignplusConfig { @NonNull @Builder.Default - private String userAgent = "signplus/1.0.0"; + private String userAgent = "postman-codegen/1.5.1 signplus/4.0.0 (java)"; @Setter private String baseUrl; diff --git a/src/main/java/com/alohi/signplus/http/Environment.java b/src/main/java/com/alohi/signplus/http/Environment.java index 983c71b..6d91236 100644 --- a/src/main/java/com/alohi/signplus/http/Environment.java +++ b/src/main/java/com/alohi/signplus/http/Environment.java @@ -1,10 +1,10 @@ package com.alohi.signplus.http; import lombok.Getter; -import okhttp3.HttpUrl; /** - * SDK Environments + * Predefined environment configurations for the SDK. + * Each environment represents a different base URL (e.g., production, staging, development). */ @Getter public enum Environment { @@ -13,11 +13,6 @@ public enum Environment { private final String url; Environment(String url) { - if (HttpUrl.parse(url) == null) { - throw new IllegalArgumentException( - String.format("Environment url [%s] is not valid. Please use the following format https://api.example.com", url) - ); - } this.url = url; } } diff --git a/src/main/java/com/alohi/signplus/http/HttpMethod.java b/src/main/java/com/alohi/signplus/http/HttpMethod.java index 1cc6f4c..134e29c 100644 --- a/src/main/java/com/alohi/signplus/http/HttpMethod.java +++ b/src/main/java/com/alohi/signplus/http/HttpMethod.java @@ -3,21 +3,39 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; +/** + * Enum representing HTTP methods (verbs) used in API requests. + * Provides utility methods for determining method characteristics. + */ @Getter @RequiredArgsConstructor public enum HttpMethod { + /** HTTP GET method for retrieving resources */ GET("GET"), + /** HTTP POST method for creating resources */ POST("POST"), + /** HTTP PUT method for updating/replacing resources */ PUT("PUT"), + /** HTTP PATCH method for partially updating resources */ PATCH("PATCH"), + /** HTTP DELETE method for removing resources */ DELETE("DELETE"), + /** HTTP HEAD method for retrieving headers only */ HEAD("HEAD"), + /** HTTP OPTIONS method for describing communication options */ OPTIONS("OPTIONS"), + /** HTTP TRACE method for diagnostic purposes */ TRACE("TRACE"), + /** HTTP CONNECT method for establishing tunnels */ CONNECT("CONNECT"); private final String method; + /** + * Determines if this HTTP method requires a request body. + * + * @return true if POST, PUT, or PATCH; false otherwise + */ public boolean requiresRequestBody() { return method.equals("POST") || method.equals("PUT") || method.equals("PATCH"); } diff --git a/src/main/java/com/alohi/signplus/http/ModelConverter.java b/src/main/java/com/alohi/signplus/http/ModelConverter.java index 4cc126f..9474b88 100644 --- a/src/main/java/com/alohi/signplus/http/ModelConverter.java +++ b/src/main/java/com/alohi/signplus/http/ModelConverter.java @@ -1,16 +1,29 @@ package com.alohi.signplus.http; +import com.alohi.signplus.http.util.ContentTypes; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.exc.MismatchedInputException; +import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.util.logging.Level; +import java.util.logging.Logger; +import okhttp3.MediaType; import okhttp3.Response; import okhttp3.ResponseBody; import org.openapitools.jackson.nullable.JsonNullableModule; +/** + * Utility class for converting between JSON and Java models. + * Uses Jackson ObjectMapper with preconfigured settings for SDK serialization/deserialization. + * Handles responses as Class types or TypeReferences with proper error logging. + */ public final class ModelConverter { + private static final Logger logger = Logger.getLogger(ModelConverter.class.getName()); private static final ObjectMapper mapper = new ObjectMapper(); static { @@ -27,39 +40,106 @@ public final class ModelConverter { private ModelConverter() {} + /** + * Converts an HTTP response body to a Java object of the specified class. + * + * @param The type of the model class + * @param response The HTTP response to convert + * @param clazz The target class to deserialize into + * @return The deserialized object, or null if conversion fails + */ public static T convert(final Response response, final Class clazz) { - final ResponseBody body = response.body(); try { - return mapper.readValue(body.string(), clazz); + return convert(response.body().bytes(), clazz); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to read response body: " + e.getMessage(), e); + return null; + } + } + + /** + * Converts raw byte array to a Java object of the specified class. + * + * @param The type of the model class + * @param bodyBytes The response body as bytes + * @param clazz The target class to deserialize into + * @return The deserialized object, or null if conversion fails or body is empty + */ + public static T convert(final byte[] bodyBytes, final Class clazz) { + try { + if (bodyBytes == null || bodyBytes.length == 0) { + logger.log(Level.FINE, "Received empty response body, returning null"); + return null; + } + + return mapper.readValue(bodyBytes, clazz); + } catch (Exception e) { + logger.log(Level.SEVERE, "Failed to read response body: " + e.getMessage(), e); return null; } } public static T convert(final String response, final Class clazz) { try { + // Handle empty responses + if (response == null || response.trim().isEmpty()) { + logger.log(Level.FINE, "Received empty response string, returning null"); + return null; + } return mapper.readValue(response, clazz); + } catch (MismatchedInputException e) { + logger.log( + Level.SEVERE, + "Failed to parse response - invalid or malformed JSON: " + e.getMessage(), + e + ); + return null; } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Unexpected error parsing response: " + e.getMessage(), e); return null; } } public static T convert(Response response, TypeReference typeReference) { try { - return convert(response.body().string(), typeReference); + return convert(response.body().bytes(), typeReference); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to read response body: " + e.getMessage(), e); + return null; + } + } + + public static T convert(byte[] bodyBytes, TypeReference typeReference) { + try { + if (bodyBytes == null || bodyBytes.length == 0) { + logger.log(Level.FINE, "Received empty response body, returning null"); + return null; + } + + return mapper.readValue(bodyBytes, typeReference); + } catch (Exception e) { + logger.log(Level.SEVERE, "Failed to read response body: " + e.getMessage(), e); return null; } } public static T convert(String response, TypeReference typeReference) { try { + // Handle empty responses + if (response == null || response.trim().isEmpty()) { + logger.log(Level.FINE, "Received empty response string, returning null"); + return null; + } return mapper.readValue(response, typeReference); + } catch (MismatchedInputException e) { + logger.log( + Level.SEVERE, + "Failed to parse response - invalid or malformed JSON: " + e.getMessage(), + e + ); + return null; } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Unexpected error parsing response: " + e.getMessage(), e); return null; } } @@ -68,7 +148,7 @@ public static String readString(Response response) { try { return response.body().string(); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to read response body as string: " + e.getMessage(), e); return null; } } @@ -77,17 +157,96 @@ public static byte[] readBytes(Response response) { try { return response.body().bytes(); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to read response body as bytes: " + e.getMessage(), e); return null; } } + public static String toBodyString(byte[] bodyBytes) { + try { + return new String(bodyBytes, StandardCharsets.UTF_8); + } catch (Exception e) { + logger.log(Level.SEVERE, "Failed to convert body bytes to string: " + e.getMessage(), e); + return ""; + } + } + + /** + * Serializes a Java model object to JSON string. + * + * @param model The model object to serialize + * @return The JSON string representation, or null if serialization fails + */ public static String modelToJson(final Object model) { try { return mapper.writeValueAsString(model); } catch (Exception e) { - e.printStackTrace(); + logger.log(Level.SEVERE, "Failed to serialize model to JSON: " + e.getMessage(), e); return null; } } + + /** + * Converts response body bytes to a OneOf type by determining the appropriate factory method + * based on the content type and using reflection to invoke it. + * + * @param The type of the OneOf model class + * @param bodyBytes The response body as bytes + * @param typeReference The target TypeReference to deserialize into + * @param contentType The content type of the response + * @return The deserialized object, or null if conversion fails + */ + public static T convertOneOf( + final byte[] bodyBytes, + final TypeReference typeReference, + final MediaType contentType + ) { + try { + String methodName; + Class parameterType; + Object data; + + if (ContentTypes.isTextual(contentType)) { + methodName = "ofString"; + parameterType = String.class; + data = toBodyString(bodyBytes); + } else if (ContentTypes.isBinary(contentType)) { + methodName = "ofBinary"; + parameterType = byte[].class; + data = bodyBytes; + } else { + return convert(bodyBytes, typeReference); + } + + Class clazz = (Class) typeReference.getType(); + + Method method = clazz.getDeclaredMethod(methodName, parameterType); + method.setAccessible(true); + + return (T) method.invoke(null, data); + } catch (Exception e) { + logger.log(Level.SEVERE, "Failed to convert OneOf response: " + e.getMessage(), e); + return null; + } + } + + /** + * Converts response body string to a OneOf type by determining the appropriate factory method + * based on the content type and using reflection to invoke it. + * + * @param The type of the OneOf model class + * @param body The response body as string + * @param typeReference The target TypeReference to deserialize into + * @param contentType The content type of the response + * @return The deserialized object, or null if conversion fails + */ + public static T convertOneOf( + final String body, + final TypeReference typeReference, + final MediaType contentType + ) { + byte[] bodyBytes = body.getBytes(StandardCharsets.UTF_8); + + return convertOneOf(bodyBytes, typeReference, contentType); + } } diff --git a/src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java b/src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java index 17b66f8..ab9cc19 100644 --- a/src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java +++ b/src/main/java/com/alohi/signplus/http/interceptors/DefaultHeadersInterceptor.java @@ -9,19 +9,41 @@ import okhttp3.Request.Builder; import okhttp3.Response; +/** + * OkHttp interceptor that adds default headers to all requests. + * Currently adds the User-Agent header based on SDK configuration. + */ public class DefaultHeadersInterceptor implements Interceptor { private final Map defaultHeaders = new HashMap<>(); + /** + * Constructs a new DefaultHeadersInterceptor. + * + * @param config The SDK configuration containing default header values + */ public DefaultHeadersInterceptor(SignplusConfig config) { defaultHeaders.put("User-Agent", config.getUserAgent()); } + /** + * Intercepts a request to add default headers before proceeding. + * + * @param chain The OkHttp interceptor chain + * @return The HTTP response + * @throws IOException if an I/O error occurs during request execution + */ @Override public Response intercept(Chain chain) throws IOException { return chain.proceed(addDefaultHeadersToRequest(chain.request())); } + /** + * Adds default headers to a request. + * + * @param request The HTTP request to modify + * @return The modified request with default headers added + */ private Request addDefaultHeadersToRequest(Request request) { if (defaultHeaders.isEmpty()) { return request; diff --git a/src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java b/src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java index 9cf3c8b..bef865e 100644 --- a/src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java +++ b/src/main/java/com/alohi/signplus/http/interceptors/RetryInterceptor.java @@ -8,11 +8,23 @@ import okhttp3.Request; import okhttp3.Response; +/** + * OkHttp interceptor that automatically retries failed HTTP requests. + * Supports configurable retry attempts, backoff delays, and specific status codes or exceptions to retry. + */ @AllArgsConstructor public class RetryInterceptor implements Interceptor { private RetryConfig config; + /** + * Intercepts an HTTP request and retries it according to the configured retry policy. + * Implements exponential backoff between retry attempts. + * + * @param chain The OkHttp interceptor chain + * @return The HTTP response from a successful attempt + * @throws IOException if all retry attempts fail or a non-retryable exception occurs + */ @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); @@ -31,7 +43,10 @@ public Response intercept(Chain chain) throws IOException { } tryCount++; } catch (IOException e) { - if (!config.getExceptionsToRetry().contains(e.getClass()) || tryCount == config.getMaxRetries()) { + if ( + !config.getExceptionsToRetry().contains(e.getClass()) || + tryCount == config.getMaxRetries() + ) { throw e; } } @@ -48,13 +63,31 @@ public Response intercept(Chain chain) throws IOException { return response; } + /** + * Calculates the delay before the next retry attempt using exponential backoff. + * + * @param tryCount The current retry attempt number (1-indexed) + * @return The delay in milliseconds, capped at the configured maximum delay + */ private int calculateDelay(int tryCount) { - final int delay = (int) (config.getInitialDelay() * Math.pow(config.getBackoffFactor(), tryCount - 1)); + final int delay = (int) (config.getInitialDelay() * + Math.pow(config.getBackoffFactor(), tryCount - 1)); return Math.min(delay, config.getMaxDelay()); } + /** + * Determines if a response should be retried based on status code and HTTP method. + * By default, retries all 5xx server errors and specific 4xx client errors (408 Timeout, 429 Rate Limit). + * + * @param response The HTTP response to check + * @return true if the response should be retried, false otherwise + */ private boolean isRetryable(Response response) { - final boolean isRetryableStatusCode = config.getStatusCodesToRetry().contains(response.code()); + final int statusCode = response.code(); + final boolean isRetryableStatusCode = !config.getStatusCodesToRetry().isEmpty() + ? config.getStatusCodesToRetry().contains(statusCode) + : statusCode >= 500 || statusCode == 408 || statusCode == 429; + final boolean isRetryableMethod = config .getHttpMethodsToRetry() .stream() diff --git a/src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java b/src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java index 82ca9a9..2120022 100644 --- a/src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java +++ b/src/main/java/com/alohi/signplus/http/serialization/PathSerializationStyle.java @@ -1,10 +1,18 @@ package com.alohi.signplus.http.serialization; +/** + * Serialization styles supported for path parameters in OpenAPI specifications. + * Defines how values are encoded when embedded in URL paths. + */ public enum PathSerializationStyle { + /** Simple style - comma-separated values (default for path parameters) */ SIMPLE(SerializationStyle.SIMPLE), + /** Label style - dot-prefixed values (.value or .id.name) */ LABEL(SerializationStyle.LABEL), + /** Matrix style - semicolon-prefixed key-value pairs (;key=value) */ MATRIX(SerializationStyle.MATRIX); + /** The underlying serialization style */ public final SerializationStyle style; PathSerializationStyle(SerializationStyle style) { diff --git a/src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java b/src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java index 4b58850..0401034 100644 --- a/src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java +++ b/src/main/java/com/alohi/signplus/http/serialization/QuerySerializationStyle.java @@ -1,11 +1,20 @@ package com.alohi.signplus.http.serialization; +/** + * Serialization styles supported for query parameters in OpenAPI specifications. + * Defines how values are encoded as URL query strings. + */ public enum QuerySerializationStyle { + /** Form style - ampersand-separated key-value pairs (default for query parameters) */ FORM(SerializationStyle.FORM), + /** Space-delimited style - values separated by spaces (encoded as %20) */ SPACE_DELIMITED(SerializationStyle.SPACE_DELIMITED), + /** Pipe-delimited style - values separated by pipe characters (|) */ PIPE_DELIMITED(SerializationStyle.PIPE_DELIMITED), + /** Deep object style - nested objects with bracket notation (obj[field]=value) */ DEEP_OBJECT(SerializationStyle.DEEP_OBJECT); + /** The underlying serialization style */ public final SerializationStyle style; QuerySerializationStyle(SerializationStyle style) { diff --git a/src/main/java/com/alohi/signplus/http/serialization/SerializationStyle.java b/src/main/java/com/alohi/signplus/http/serialization/SerializationStyle.java index 8ae3e00..db39a31 100644 --- a/src/main/java/com/alohi/signplus/http/serialization/SerializationStyle.java +++ b/src/main/java/com/alohi/signplus/http/serialization/SerializationStyle.java @@ -1,11 +1,22 @@ package com.alohi.signplus.http.serialization; +/** + * Enum representing OpenAPI parameter serialization styles. + * Defines how parameters are formatted for different parts of HTTP requests. + */ public enum SerializationStyle { + /** Simple style - comma-separated values (default for path/header parameters) */ SIMPLE, + /** Label style - dot-prefixed values for path parameters (.value or .id.name) */ LABEL, + /** Matrix style - semicolon-prefixed key-value pairs for path parameters (;key=value) */ MATRIX, + /** Form style - ampersand-separated key-value pairs (default for query parameters) */ FORM, + /** Space-delimited style - space-separated values for query parameters */ SPACE_DELIMITED, + /** Pipe-delimited style - pipe-separated values for query parameters */ PIPE_DELIMITED, + /** Deep object style - nested objects with bracket notation (id[key]=value) */ DEEP_OBJECT, } diff --git a/src/main/java/com/alohi/signplus/http/serialization/Serializer.java b/src/main/java/com/alohi/signplus/http/serialization/Serializer.java index 2f13436..4ee6d83 100644 --- a/src/main/java/com/alohi/signplus/http/serialization/Serializer.java +++ b/src/main/java/com/alohi/signplus/http/serialization/Serializer.java @@ -4,21 +4,50 @@ import java.util.Map; import java.util.stream.Collectors; +/** + * Utility class for serializing parameters according to OpenAPI serialization styles. + * Supports simple, label, matrix, form, pipe-delimited, space-delimited, and deep object styles. + * Handles primitives, strings, lists, and complex objects with proper encoding. + */ public class Serializer { + /** + * Serializes a long value to a string with the specified style and encoding. + * + * @param key The parameter name + * @param value The long value to serialize + * @param style The serialization style to use + * @param encode Whether to URL-encode the value + * @return The serialized parameter string + */ public static String serialize(String key, long value, SerializationStyle style, boolean encode) { return serialize(key, String.valueOf(value), style, encode); } - public static String serialize(String key, double value, SerializationStyle style, boolean encode) { + public static String serialize( + String key, + double value, + SerializationStyle style, + boolean encode + ) { return serialize(key, String.valueOf(value), style, encode); } - public static String serialize(String key, boolean value, SerializationStyle style, boolean encode) { + public static String serialize( + String key, + boolean value, + SerializationStyle style, + boolean encode + ) { return serialize(key, String.valueOf(value), style, encode); } - public static String serialize(String key, String value, SerializationStyle style, boolean encode) { + public static String serialize( + String key, + String value, + SerializationStyle style, + boolean encode + ) { if (value == null) { value = "null"; } @@ -35,7 +64,24 @@ public static String serialize(String key, String value, SerializationStyle styl } } - public static String serialize(String key, Object value, SerializationStyle style, boolean explode, boolean encode) { + /** + * Serializes any object value according to the specified serialization style. + * Handles primitives, strings, lists, and complex objects with proper OpenAPI serialization. + * + * @param key The parameter name + * @param value The value to serialize (can be primitive, String, List, or object) + * @param style The serialization style to use (SIMPLE, LABEL, MATRIX, FORM, etc.) + * @param explode Whether to use exploded form for arrays/objects + * @param encode Whether to URL-encode values + * @return The serialized parameter string + */ + public static String serialize( + String key, + Object value, + SerializationStyle style, + boolean explode, + boolean encode + ) { if (value == null) { return serialize(key, "null", style, encode); } @@ -77,7 +123,10 @@ private static String serializeList( return ""; } - List serializedValues = value.stream().map(v -> serializeValue(v, encode)).collect(Collectors.toList()); + List serializedValues = value + .stream() + .map(v -> serializeValue(v, encode)) + .collect(Collectors.toList()); switch (style) { case SIMPLE: return String.join(",", serializedValues); @@ -87,7 +136,10 @@ private static String serializeList( return String.format(".%s", String.join(separator, serializedValues)); case MATRIX: return explode - ? serializedValues.stream().map(v -> String.format(";%s=%s", key, v)).collect(Collectors.joining("")) + ? serializedValues + .stream() + .map(v -> String.format(";%s=%s", key, v)) + .collect(Collectors.joining("")) : String.format(";%s=", key) + String.join(",", serializedValues); } @@ -185,7 +237,22 @@ private static String serializeObject( } } - public static String serializeDeepObject(String key, Object value, boolean topLevel, boolean encode) { + /** + * Serializes an object using deep object style (e.g., id[key]=value&id[key][deepKey]=deepValue). + * Recursively handles nested objects with bracket notation. + * + * @param key The parameter name + * @param value The value to serialize + * @param topLevel Whether this is the top-level call (affects bracket notation) + * @param encode Whether to URL-encode values + * @return The serialized deep object string + */ + public static String serializeDeepObject( + String key, + Object value, + boolean topLevel, + boolean encode + ) { if (!Util.isObject(value)) { return String.format("[%s]=%s", key, serializeValue(value, encode)); } diff --git a/src/main/java/com/alohi/signplus/http/serialization/Util.java b/src/main/java/com/alohi/signplus/http/serialization/Util.java index da7d8b2..b29eff0 100644 --- a/src/main/java/com/alohi/signplus/http/serialization/Util.java +++ b/src/main/java/com/alohi/signplus/http/serialization/Util.java @@ -12,6 +12,10 @@ import lombok.SneakyThrows; import org.openapitools.jackson.nullable.JsonNullableModule; +/** + * Utility class for serialization helper methods. + * Provides functions for type checking, URL encoding, and property extraction. + */ public class Util { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); @@ -21,8 +25,18 @@ public class Util { OBJECT_MAPPER.registerModule(new JsonNullableModule()); } + /** + * Extracts properties from an object using JSON property names. + * Uses Jackson annotations to determine the correct property names. + * + * @param value The object to extract properties from + * @return A map of JSON property names to their values + */ public static Map getPropertiesWithJsonPropertyNames(Object value) { - Map properties = OBJECT_MAPPER.convertValue(value, new TypeReference>() {}); + Map properties = OBJECT_MAPPER.convertValue( + value, + new TypeReference>() {} + ); // Use the json property name if it exists, otherwise use the regular property name return properties @@ -43,11 +57,23 @@ public static Map getPropertiesWithJsonPropertyNames(Object valu ); } + /** + * URL-encodes a string value using UTF-8 encoding. + * + * @param value The string to encode + * @return The URL-encoded string + */ @SneakyThrows public static String urlEncode(String value) { return URLEncoder.encode(value, StandardCharsets.UTF_8.toString()); } + /** + * Checks if a value is a primitive type (number, boolean, string, or character). + * + * @param value The value to check + * @return true if the value is a primitive type, false otherwise + */ public static boolean isPrimitive(Object value) { return ( value instanceof Long || @@ -60,6 +86,12 @@ public static boolean isPrimitive(Object value) { ); } + /** + * Checks if a value is a complex object (not primitive and not iterable). + * + * @param value The value to check + * @return true if the value is a complex object, false otherwise + */ public static boolean isObject(Object value) { return !isPrimitive(value) && !(value instanceof Iterable); } diff --git a/src/main/java/com/alohi/signplus/http/util/ContentTypes.java b/src/main/java/com/alohi/signplus/http/util/ContentTypes.java new file mode 100644 index 0000000..8bba0f9 --- /dev/null +++ b/src/main/java/com/alohi/signplus/http/util/ContentTypes.java @@ -0,0 +1,85 @@ +package com.alohi.signplus.http.util; + +import okhttp3.MediaType; +import okhttp3.Response; + +public class ContentTypes { + + private static final MediaType FALLBACK_CONTENT_TYPE = MediaType.parse("application/json"); + + /** + * Determines if the given MediaType is textual. + * In this case, JSON is not considered textual. + * @param contentType The MediaType to check + * @return true if the content type is textual, false otherwise + */ + public static boolean isTextual(MediaType contentType) { + if (contentType == null) { + return false; + } + + String type = contentType.type(); + String subtype = contentType.subtype(); + + if ("text".equals(type)) { + return true; + } + + if ("application".equals(type) && (subtype.equals("xml") || subtype.endsWith("+xml"))) { + return true; + } + + if ("image".equals(type) && "svg+xml".equals(subtype)) { + return true; + } + + if ("application".equals(type) && "javascript".equals(subtype)) { + return true; + } + + return false; + } + + /** + * Determines if the given MediaType is binary. + * Binary types include: application/octet-stream, PDFs, images (except svg+xml), and wildcard + * + * @param contentType The MediaType to check + * @return true if the content type is binary, false otherwise + */ + public static boolean isBinary(MediaType contentType) { + if (contentType == null) { + return false; + } + + String type = contentType.type(); + String subtype = contentType.subtype(); + + // wildcard + if ("*".equals(type) && "*".equals(subtype)) { + return true; + } + + if ("application".equals(type) && "octet-stream".equals(subtype)) { + return true; + } + + if ("application".equals(type) && "pdf".equals(subtype)) { + return true; + } + + if ("image".equals(type) && !"svg+xml".equals(subtype)) { + return true; + } + + return false; + } + + public static MediaType readContentType(Response response) { + if (response.body() != null && response.body().contentType() != null) { + return response.body().contentType(); + } + + return FALLBACK_CONTENT_TYPE; + } +} diff --git a/src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java b/src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java index bc88221..f44ce82 100644 --- a/src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java +++ b/src/main/java/com/alohi/signplus/http/util/HttpArgumentConverter.java @@ -21,12 +21,20 @@ public static String toStringArgument(final Object value) { if (value == null) { return ""; } - if (value instanceof String || value instanceof Number || value instanceof Boolean || value instanceof Enum) { + if ( + value instanceof String || + value instanceof Number || + value instanceof Boolean || + value instanceof Enum + ) { return String.valueOf(value); } if (value instanceof List) { List list = (List) value; - return list.stream().map(HttpArgumentConverter::toStringArgument).collect(Collectors.joining(",")); + return list + .stream() + .map(HttpArgumentConverter::toStringArgument) + .collect(Collectors.joining(",")); } return modelToJson(value); diff --git a/src/main/java/com/alohi/signplus/http/util/RequestBuilder.java b/src/main/java/com/alohi/signplus/http/util/RequestBuilder.java index 5027ea6..656044f 100644 --- a/src/main/java/com/alohi/signplus/http/util/RequestBuilder.java +++ b/src/main/java/com/alohi/signplus/http/util/RequestBuilder.java @@ -6,7 +6,12 @@ import com.alohi.signplus.http.serialization.QuerySerializationStyle; import com.alohi.signplus.http.serialization.SerializationStyle; import com.alohi.signplus.http.serialization.Serializer; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import lombok.NonNull; import okhttp3.HttpUrl; import okhttp3.MediaType; @@ -14,6 +19,11 @@ import okhttp3.RequestBody; import org.jetbrains.annotations.NotNull; +/** + * Fluent builder for constructing OkHttp Request objects with SDK-specific features. + * Handles path/query parameter serialization, header management, authentication, + * and request body construction according to OpenAPI serialization styles. + */ public class RequestBuilder { @NonNull @@ -31,6 +41,8 @@ public class RequestBuilder { private final HashMap headers = new HashMap<>(); + private final List cookies = new ArrayList<>(); + private RequestBody body; /** @@ -39,21 +51,37 @@ public class RequestBuilder { * @param path The path template to use for the request. Should have path parameters as * placeholders surrounded by brackets (Eg. "/users/{id}", where "id" is a path parameter). */ - public RequestBuilder(@NotNull HttpMethod httpMethod, @NotNull String baseUrl, @NotNull String path) { + public RequestBuilder( + @NotNull HttpMethod httpMethod, + @NotNull String baseUrl, + @NotNull String path + ) { this.httpMethod = httpMethod; this.baseUrl = baseUrl; this.path = path; } /** - * Sets a path parameter. If the parameter is not present in the URL template, it will be ignored. + * Sets a path parameter using the default SIMPLE serialization style. + * If the parameter is not present in the URL template, it will be ignored. + * + * @param key The path parameter name + * @param value The parameter value + * @return This builder instance for chaining */ public RequestBuilder setPathParameter(@NonNull String key, @NonNull Object value) { return setPathParameter(key, value, PathSerializationStyle.SIMPLE, false); } /** - * Sets a path parameter. If the parameter is not present in the URL template, it will be ignored. + * Sets a path parameter with custom serialization style and explode option. + * If the parameter is not present in the URL template, it will be ignored. + * + * @param key The path parameter name + * @param value The parameter value + * @param style The serialization style to use + * @param explode Whether to explode arrays/objects into separate values + * @return This builder instance for chaining */ public RequestBuilder setPathParameter( @NonNull String key, @@ -67,14 +95,24 @@ public RequestBuilder setPathParameter( } /** - * Sets a query parameter. + * Sets a query parameter using the default FORM serialization style with explode enabled. + * + * @param key The query parameter name + * @param value The parameter value + * @return This builder instance for chaining */ public RequestBuilder setQueryParameter(@NonNull String key, @NonNull Object value) { return setQueryParameter(key, value, QuerySerializationStyle.FORM, true); } /** - * Sets a query parameter. + * Sets a query parameter with custom serialization style and explode option. + * + * @param key The query parameter name + * @param value The parameter value + * @param style The serialization style to use + * @param explode Whether to explode arrays/objects into separate parameters + * @return This builder instance for chaining */ public RequestBuilder setQueryParameter( @NonNull String key, @@ -87,12 +125,25 @@ public RequestBuilder setQueryParameter( return this; } + /** + * Sets a query parameter using the default FORM style if the value is not null. + * + * @param key The query parameter name + * @param value The parameter value (ignored if null) + * @return This builder instance for chaining + */ public RequestBuilder setOptionalQueryParameter(@NonNull String key, Object value) { return setOptionalQueryParameter(key, value, QuerySerializationStyle.FORM, true); } /** - * Sets a query parameter if the value is not null. + * Sets a query parameter with custom serialization if the value is not null. + * + * @param key The query parameter name + * @param value The parameter value (ignored if null) + * @param style The serialization style to use + * @param explode Whether to explode arrays/objects into separate parameters + * @return This builder instance for chaining */ public RequestBuilder setOptionalQueryParameter( @NonNull String key, @@ -107,30 +158,54 @@ public RequestBuilder setOptionalQueryParameter( } /** - * Sets a header. + * Sets a header using SIMPLE serialization style without explode. + * + * @param key The header name + * @param value The header value + * @return This builder instance for chaining */ public RequestBuilder setHeader(@NonNull String key, @NonNull Object value) { return setHeader(key, value, false); } /** - * Sets a header. + * Sets a header using SIMPLE serialization style with custom explode option. + * + * @param key The header name + * @param value The header value + * @param explode Whether to explode arrays/objects + * @return This builder instance for chaining */ public RequestBuilder setHeader(@NonNull String key, @NonNull Object value, boolean explode) { - String serializedValue = Serializer.serialize(key, value, SerializationStyle.SIMPLE, explode, false); + String serializedValue = Serializer.serialize( + key, + value, + SerializationStyle.SIMPLE, + explode, + false + ); headers.put(key, serializedValue); return this; } /** - * Sets a header if the value is not null. + * Sets a header if the value is not null, using SIMPLE style without explode. + * + * @param key The header name + * @param value The header value (ignored if null) + * @return This builder instance for chaining */ public RequestBuilder setOptionalHeader(@NonNull String key, Object value) { return setOptionalHeader(key, value, false); } /** - * Sets a header if the value is not null. + * Sets a header if the value is not null, with custom explode option. + * + * @param key The header name + * @param value The header value (ignored if null) + * @param explode Whether to explode arrays/objects + * @return This builder instance for chaining */ public RequestBuilder setOptionalHeader(@NonNull String key, Object value, boolean explode) { if (value != null) { @@ -140,7 +215,73 @@ public RequestBuilder setOptionalHeader(@NonNull String key, Object value, boole } /** - * Sets the body of the request. + * Adds a cookie parameter using FORM serialization style with explode enabled. + * Multiple cookies are combined into a single Cookie header at build time. + * + * @param key The cookie name + * @param value The cookie value + * @return This builder instance for chaining + */ + public RequestBuilder setCookie(@NonNull String key, @NonNull Object value) { + return setCookie(key, value, true); + } + + /** + * Adds a cookie parameter using FORM serialization style with custom explode option. + * Multiple cookies are combined into a single Cookie header at build time. + * + * @param key The cookie name + * @param value The cookie value + * @param explode Whether to explode arrays/objects + * @return This builder instance for chaining + */ + public RequestBuilder setCookie(@NonNull String key, @NonNull Object value, boolean explode) { + String serializedValue = Serializer.serialize( + key, + value, + SerializationStyle.FORM, + explode, + false + ); + if (explode && serializedValue.contains("&")) { + Collections.addAll(cookies, serializedValue.split("&")); + } else { + cookies.add(serializedValue); + } + return this; + } + + /** + * Adds a cookie parameter if the value is not null, using FORM style with explode enabled. + * + * @param key The cookie name + * @param value The cookie value (ignored if null) + * @return This builder instance for chaining + */ + public RequestBuilder setOptionalCookie(@NonNull String key, Object value) { + return setOptionalCookie(key, value, true); + } + + /** + * Adds a cookie parameter if the value is not null, with custom explode option. + * + * @param key The cookie name + * @param value The cookie value (ignored if null) + * @param explode Whether to explode arrays/objects + * @return This builder instance for chaining + */ + public RequestBuilder setOptionalCookie(@NonNull String key, Object value, boolean explode) { + if (value != null) { + return setCookie(key, value, explode); + } + return this; + } + + /** + * Sets the raw request body. + * + * @param body The request body + * @return This builder instance for chaining */ public RequestBuilder setBody(RequestBody body) { this.body = body; @@ -148,25 +289,37 @@ public RequestBuilder setBody(RequestBody body) { } /** - * Sets the content of the request as JSON. + * Sets the request body as JSON using the default application/json media type. + * + * @param content The object to serialize as JSON + * @return This builder instance for chaining */ public RequestBuilder setJsonContent(Object content) { return setJsonContent(content, MediaType.parse("application/json; charset=utf-8")); } /** - * Sets the content of the request as JSON. + * Sets the request body as JSON with a custom media type. + * + * @param content The object to serialize as JSON + * @param mediaType The media type to use + * @return This builder instance for chaining */ public RequestBuilder setJsonContent(Object content, MediaType mediaType) { if (content == null) { return this; } - setBody(RequestBody.create(Objects.requireNonNull(ModelConverter.modelToJson(content)), mediaType)); + setBody( + RequestBody.create(Objects.requireNonNull(ModelConverter.modelToJson(content)), mediaType) + ); return this; } - /* + /** * Sets the access token authentication header with a "Bearer" prefix. + * + * @param token The access token + * @return This builder instance for chaining */ public RequestBuilder setAccessTokenAuth(String token) { if (token == null) { @@ -175,8 +328,12 @@ public RequestBuilder setAccessTokenAuth(String token) { return setAccessTokenAuth(token, "Bearer"); } - /* + /** * Sets the access token authentication header with a custom prefix. + * + * @param token The access token + * @param prefix The authorization prefix (e.g., "Bearer", "Token") + * @return This builder instance for chaining */ public RequestBuilder setAccessTokenAuth(String token, String prefix) { if (token == null || prefix == null) { @@ -186,7 +343,10 @@ public RequestBuilder setAccessTokenAuth(String token, String prefix) { } /** - * @return The {@code Request} instance. + * Builds and returns the configured OkHttp Request instance. + * Applies all path parameters, query parameters, headers, and body to create the final request. + * + * @return The configured Request instance ready to execute */ public Request build() { String url = buildUrl(); @@ -196,6 +356,10 @@ public Request build() { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } + if (!cookies.isEmpty()) { + requestBuilder.addHeader("Cookie", String.join("; ", cookies)); + } + if (httpMethod.requiresRequestBody() && this.body == null) { this.body = RequestBody.create(new byte[0]); } @@ -205,6 +369,11 @@ public Request build() { return requestBuilder.build(); } + /** + * Constructs the full URL by combining base URL, path, path parameters, and query parameters. + * + * @return The complete URL string + */ private String buildUrl() { String path = this.path; @@ -214,7 +383,11 @@ private String buildUrl() { path = path.replace("{" + key + "}", value); } - String url = Objects.requireNonNull(HttpUrl.parse(baseUrl)).newBuilder().addPathSegments(path).build().toString(); + String url = Objects.requireNonNull(HttpUrl.parse(baseUrl)) + .newBuilder() + .addPathSegments(path) + .build() + .toString(); if (!queryParameters.isEmpty()) { url += "?" + String.join("&", queryParameters); diff --git a/src/main/java/com/alohi/signplus/json/TypeUtils.java b/src/main/java/com/alohi/signplus/json/TypeUtils.java index 86b31a8..1871304 100644 --- a/src/main/java/com/alohi/signplus/json/TypeUtils.java +++ b/src/main/java/com/alohi/signplus/json/TypeUtils.java @@ -5,8 +5,18 @@ import java.util.ArrayList; import java.util.List; +/** + * Utility methods for type handling and reflection operations in JSON serialization. + * Provides helpers for extracting JSON property names and creating generic lists. + */ public class TypeUtils { + /** + * Extracts the JSON property name from a field, using the @JsonProperty annotation if present. + * + * @param type The field to extract the name from + * @return The JSON property name (from annotation) or the field name + */ public static String getJsonPropertyName(Field type) { JsonProperty annotation = type.getAnnotation(JsonProperty.class); if (annotation != null) { @@ -15,6 +25,15 @@ public static String getJsonPropertyName(Field type) { return type.getName(); } + /** + * Creates a generic list with type safety from an array of objects. + * Used for deserializing JSON arrays to strongly-typed Java lists. + * + * @param The element type of the list + * @param type The class of the element type + * @param params The objects to add to the list + * @return A typed list containing the provided elements + */ public static List createGenericList(Class type, Object... params) { List list = new ArrayList<>(); for (Object param : params) { diff --git a/src/main/java/com/alohi/signplus/models/AnnotationType.java b/src/main/java/com/alohi/signplus/models/AnnotationType.java index aa86803..8c14317 100644 --- a/src/main/java/com/alohi/signplus/models/AnnotationType.java +++ b/src/main/java/com/alohi/signplus/models/AnnotationType.java @@ -23,6 +23,9 @@ public enum AnnotationType { @JsonCreator public static AnnotationType fromValue(String value) { - return Arrays.stream(AnnotationType.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(AnnotationType.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java b/src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java index a3307b4..b65fa2b 100644 --- a/src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java +++ b/src/main/java/com/alohi/signplus/models/AttachmentPlaceholdersPerRecipient.java @@ -77,7 +77,9 @@ public AttachmentPlaceholdersPerRecipientBuilder recipientName(String value) { private JsonNullable> placeholders = JsonNullable.undefined(); @JsonProperty("placeholders") - public AttachmentPlaceholdersPerRecipientBuilder placeholders(List value) { + public AttachmentPlaceholdersPerRecipientBuilder placeholders( + List value + ) { if (value == null) { throw new IllegalStateException("placeholders cannot be null"); } diff --git a/src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java b/src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java index 2a6255f..4f91ce9 100644 --- a/src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java +++ b/src/main/java/com/alohi/signplus/models/EnvelopeAttachments.java @@ -49,7 +49,8 @@ public EnvelopeAttachmentsBuilder settings(AttachmentSettings value) { return this; } - private JsonNullable> recipients = JsonNullable.undefined(); + private JsonNullable> recipients = + JsonNullable.undefined(); @JsonProperty("recipients") public EnvelopeAttachmentsBuilder recipients(List value) { diff --git a/src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java b/src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java index 5b4a176..0b5fce8 100644 --- a/src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java +++ b/src/main/java/com/alohi/signplus/models/EnvelopeFlowType.java @@ -20,6 +20,9 @@ public enum EnvelopeFlowType { @JsonCreator public static EnvelopeFlowType fromValue(String value) { - return Arrays.stream(EnvelopeFlowType.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(EnvelopeFlowType.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/EnvelopeOrderField.java b/src/main/java/com/alohi/signplus/models/EnvelopeOrderField.java index c540b7b..797264e 100644 --- a/src/main/java/com/alohi/signplus/models/EnvelopeOrderField.java +++ b/src/main/java/com/alohi/signplus/models/EnvelopeOrderField.java @@ -23,6 +23,9 @@ public enum EnvelopeOrderField { @JsonCreator public static EnvelopeOrderField fromValue(String value) { - return Arrays.stream(EnvelopeOrderField.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(EnvelopeOrderField.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/EnvelopeStatus.java b/src/main/java/com/alohi/signplus/models/EnvelopeStatus.java index a071370..5c54f1d 100644 --- a/src/main/java/com/alohi/signplus/models/EnvelopeStatus.java +++ b/src/main/java/com/alohi/signplus/models/EnvelopeStatus.java @@ -25,6 +25,9 @@ public enum EnvelopeStatus { @JsonCreator public static EnvelopeStatus fromValue(String value) { - return Arrays.stream(EnvelopeStatus.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(EnvelopeStatus.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/RecipientRole.java b/src/main/java/com/alohi/signplus/models/RecipientRole.java index 5990433..509dbb9 100644 --- a/src/main/java/com/alohi/signplus/models/RecipientRole.java +++ b/src/main/java/com/alohi/signplus/models/RecipientRole.java @@ -21,6 +21,9 @@ public enum RecipientRole { @JsonCreator public static RecipientRole fromValue(String value) { - return Arrays.stream(RecipientRole.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(RecipientRole.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/TemplateOrderField.java b/src/main/java/com/alohi/signplus/models/TemplateOrderField.java index 7758ebf..a6b4e04 100644 --- a/src/main/java/com/alohi/signplus/models/TemplateOrderField.java +++ b/src/main/java/com/alohi/signplus/models/TemplateOrderField.java @@ -22,6 +22,9 @@ public enum TemplateOrderField { @JsonCreator public static TemplateOrderField fromValue(String value) { - return Arrays.stream(TemplateOrderField.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(TemplateOrderField.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/models/WebhookEvent.java b/src/main/java/com/alohi/signplus/models/WebhookEvent.java index 9398e6e..4306662 100644 --- a/src/main/java/com/alohi/signplus/models/WebhookEvent.java +++ b/src/main/java/com/alohi/signplus/models/WebhookEvent.java @@ -23,6 +23,9 @@ public enum WebhookEvent { @JsonCreator public static WebhookEvent fromValue(String value) { - return Arrays.stream(WebhookEvent.values()).filter(item -> item.value.equals(value)).findFirst().orElse(null); + return Arrays.stream(WebhookEvent.values()) + .filter(item -> item.value.equals(value)) + .findFirst() + .orElse(null); } } diff --git a/src/main/java/com/alohi/signplus/services/BaseService.java b/src/main/java/com/alohi/signplus/services/BaseService.java index eb02e64..e14c8bb 100644 --- a/src/main/java/com/alohi/signplus/services/BaseService.java +++ b/src/main/java/com/alohi/signplus/services/BaseService.java @@ -1,18 +1,23 @@ package com.alohi.signplus.services; +import com.alohi.signplus.config.RequestConfig; import com.alohi.signplus.config.SignplusConfig; import com.alohi.signplus.exceptions.ApiError; import com.alohi.signplus.http.Environment; import com.alohi.signplus.http.ModelConverter; +import com.alohi.signplus.http.interceptors.RetryInterceptor; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.lang.reflect.Constructor; import java.net.SocketTimeoutException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import okhttp3.Call; @@ -22,13 +27,27 @@ import okhttp3.Response; import org.jetbrains.annotations.NotNull; +/** + * Base service class that all API service classes extend. + * Provides common functionality including HTTP request execution, error handling, + * and configuration management. + */ public class BaseService { private static final Logger logger = Logger.getLogger(BaseService.class.getName()); protected OkHttpClient httpClient; protected SignplusConfig config; protected Map> errorMappings; + protected ErrorMapping defaultErrorMapping; + /** Service-level configuration overrides */ + protected RequestConfig serviceConfig; + + /** + * Internal class for mapping HTTP status codes to error models and exception types. + * + * @param The error model type + */ private static class ErrorMapping { private final Class modelClass; @@ -40,24 +59,178 @@ public ErrorMapping(Class modelClass, Class exceptionClas } } + /** + * Constructs a new BaseService instance. + * + * @param httpClient The HTTP client to use for making requests + * @param config The SDK configuration + */ public BaseService(OkHttpClient httpClient, SignplusConfig config) { this.httpClient = httpClient; this.config = config; this.errorMappings = new HashMap<>(); } + /** + * Sets the base URL for API requests. + * + * @param baseUrl The base URL to use + */ public void setBaseUrl(String baseUrl) { this.config.setBaseUrl(baseUrl); } + /** + * Sets the environment for API requests. + * + * @param environment The environment to use (e.g., DEFAULT, PRODUCTION, STAGING) + */ public void setEnvironment(Environment environment) { this.config.setEnvironment(environment); } - protected void addErrorMapping(int status, Class modelClass, Class exceptionClass) { + /** + * Sets service-level configuration that applies to all methods in this service. + * Service-level overrides take precedence over SDK-level configuration but are + * overridden by method-level and request-level configurations. + * + * @param config The configuration overrides to apply at the service level + */ + public void setConfig(RequestConfig config) { + this.serviceConfig = config; + } + + /** + * Resolves configuration from the hierarchy: requestConfig > methodConfig > serviceConfig. + * Merges override configs into a single {@link RequestConfig}. SDK defaults are used as + * fallbacks where these overrides are not provided. + * + * @param methodConfig Method-level configuration override (may be null) + * @param requestConfig Request-level configuration override (may be null) + * @return Merged configuration with all overrides applied + */ + protected RequestConfig getResolvedConfig( + RequestConfig methodConfig, + RequestConfig requestConfig + ) { + return RequestConfig.merge(this.serviceConfig, methodConfig, requestConfig); + } + + /** + * Resolves the base URL from the configuration hierarchy. + * Priority: resolvedConfig.baseUrl > sdkConfig.baseUrl > resolvedConfig.environment > defaultEnvironment. + * + * @param resolvedConfig The merged request configuration (may be null) + * @param defaultEnvironment The default environment for this method + * @return The resolved base URL + */ + protected String resolveBaseUrl(RequestConfig resolvedConfig, Environment defaultEnvironment) { + if (resolvedConfig != null && resolvedConfig.getBaseUrl() != null) { + return resolvedConfig.getBaseUrl(); + } + if (this.config.getBaseUrl() != null) { + return this.config.getBaseUrl(); + } + if (resolvedConfig != null && resolvedConfig.getEnvironment() != null) { + return resolvedConfig.getEnvironment().getUrl(); + } + return defaultEnvironment.getUrl(); + } + + /** + * Resolves the access token from the configuration hierarchy. + * + * @param resolvedConfig The merged request configuration (may be null) + * @return The resolved access token + */ + protected String resolveAccessToken(RequestConfig resolvedConfig) { + if (resolvedConfig != null && resolvedConfig.getAccessToken() != null) { + return resolvedConfig.getAccessToken(); + } + return this.config.getAccessToken(); + } + + /** + * Creates an OkHttpClient with per-request overrides from the resolved configuration. + * Applies timeout and/or retry config overrides when present. + * If no overrides are present, returns the original client. + * + * @param resolvedConfig The resolved request configuration + * @return An OkHttpClient with the appropriate overrides applied + */ + protected OkHttpClient getHttpClientForRequest(RequestConfig resolvedConfig) { + if (resolvedConfig == null) { + return this.httpClient; + } + + boolean needsRebuild = resolvedConfig.getTimeout() != null; + needsRebuild = needsRebuild || resolvedConfig.getRetryConfig() != null; + + if (!needsRebuild) { + return this.httpClient; + } + + OkHttpClient.Builder builder = this.httpClient.newBuilder(); + + if (resolvedConfig.getTimeout() != null) { + builder.readTimeout(resolvedConfig.getTimeout(), TimeUnit.MILLISECONDS); + } + + if (resolvedConfig.getRetryConfig() != null) { + List interceptors = new ArrayList<>(builder.interceptors()); + interceptors.replaceAll(i -> + i instanceof RetryInterceptor ? new RetryInterceptor(resolvedConfig.getRetryConfig()) : i + ); + builder.interceptors().clear(); + interceptors.forEach(builder::addInterceptor); + } + + return builder.build(); + } + + /** + * Registers an error mapping for a specific HTTP status code. + * When a response with this status is received, the SDK will deserialize the error + * response to the specified model class and throw the specified exception type. + * + * @param The error model type + * @param status The HTTP status code to map + * @param modelClass The class to deserialize the error response into + * @param exceptionClass The exception class to throw + */ + protected void addErrorMapping( + int status, + Class modelClass, + Class exceptionClass + ) { this.errorMappings.put(status, new ErrorMapping<>(modelClass, exceptionClass)); } + /** + * Registers a default error mapping for unmapped HTTP status codes. + * When a response with an unmapped status is received the SDK will deserialize the error + * response to the specified model class and throw the specified exception type. + * + * @param The error model type + * @param modelClass The class to deserialize the error response into + * @param exceptionClass The exception class to throw + */ + protected void addDefaultErrorMapping( + Class modelClass, + Class exceptionClass + ) { + this.defaultErrorMapping = new ErrorMapping<>(modelClass, exceptionClass); + } + + /** + * Extracts an error message from a response and optional error model. + * Attempts to get the message from the error model's getMessage() method, + * falls back to the response message, or constructs a message from the status code and URL. + * + * @param response The HTTP response + * @param errorModel The deserialized error model (may be null) + * @return The extracted or constructed error message + */ private String extractErrorMessage(Response response, Object errorModel) { String message = null; @@ -74,16 +247,30 @@ private String extractErrorMessage(Response response, Object errorModel) { } if (Objects.isNull(message) || message.trim().isEmpty()) { - message = String.format("%d error in request to: %s", response.code(), response.request().url()); + message = String.format( + "%d error in request to: %s", + response.code(), + response.request().url() + ); } return message; } - protected Response execute(Request request) throws ApiError { + /** + * Executes an HTTP request synchronously. + * Handles error responses by checking error mappings and throwing appropriate exceptions. + * + * @param request The HTTP request to execute + * @param resolvedConfig The resolved request configuration (may contain timeout override) + * @return The HTTP response if successful + * @throws ApiError if the request fails or returns an error status code + */ + protected Response execute(Request request, RequestConfig resolvedConfig) throws ApiError { + OkHttpClient client = this.getHttpClientForRequest(resolvedConfig); Response response; try { - response = this.httpClient.newCall(request).execute(); + response = client.newCall(request).execute(); } catch (IOException e) { if (e instanceof SocketTimeoutException) { throw new ApiError("Request timed out", 408, null); @@ -96,13 +283,18 @@ protected Response execute(Request request) throws ApiError { } // Handle error response - ErrorMapping errorMapping = this.errorMappings.get(response.code()); + ErrorMapping errorMapping = + this.errorMappings.getOrDefault(response.code(), this.defaultErrorMapping); if (errorMapping != null) { Object errorModel = null; try { errorModel = ModelConverter.convert(response, errorMapping.modelClass); } catch (Exception e) { - logger.log(Level.WARNING, "Failed to deserialize error response to " + errorMapping.modelClass.getName(), e); + logger.log( + Level.WARNING, + "Failed to deserialize error response to " + errorMapping.modelClass.getName(), + e + ); } if (errorModel != null) { @@ -129,9 +321,24 @@ protected Response execute(Request request) throws ApiError { throw new ApiError(extractErrorMessage(response, null), response.code(), response); } - protected CompletableFuture executeAsync(Request request) { + /** + * Executes an HTTP request asynchronously. + * Returns a CompletableFuture that completes with the response or completes exceptionally + * if an error occurs. Handles error responses by checking error mappings. + * + * @param request The HTTP request to execute + * @param resolvedConfig The resolved request configuration (may contain timeout override) + * @return A CompletableFuture that completes with the HTTP response + */ + protected CompletableFuture executeAsync( + Request request, + RequestConfig resolvedConfig + ) { + OkHttpClient client = this.getHttpClientForRequest(resolvedConfig); CompletableFuture future = new CompletableFuture<>(); - this.httpClient.newCall(request).enqueue( + client + .newCall(request) + .enqueue( new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) { @@ -143,12 +350,13 @@ public void onResponse(@NotNull Call call, @NotNull Response response) { Object errorModel = ModelConverter.convert(response, errorMapping.modelClass); if (errorModel != null) { // Use reflection to create the exception - Constructor constructor = errorMapping.exceptionClass.getConstructor( - errorMapping.modelClass, - String.class, - int.class, - Response.class - ); + Constructor constructor = + errorMapping.exceptionClass.getConstructor( + errorMapping.modelClass, + String.class, + int.class, + Response.class + ); String message = extractErrorMessage(response, errorModel); future.completeExceptionally( constructor.newInstance(errorModel, message, response.code(), response) @@ -165,7 +373,11 @@ public void onResponse(@NotNull Call call, @NotNull Response response) { } // If no specific error model is mapped or conversion failed, throw generic ApiError - ApiError error = new ApiError(extractErrorMessage(response, null), response.code(), response); + ApiError error = new ApiError( + extractErrorMessage(response, null), + response.code(), + response + ); future.completeExceptionally(error); return; } diff --git a/src/main/java/com/alohi/signplus/services/SignplusService.java b/src/main/java/com/alohi/signplus/services/SignplusService.java index 9c5f450..5290d0f 100644 --- a/src/main/java/com/alohi/signplus/services/SignplusService.java +++ b/src/main/java/com/alohi/signplus/services/SignplusService.java @@ -1,5 +1,6 @@ package com.alohi.signplus.services; +import com.alohi.signplus.config.RequestConfig; import com.alohi.signplus.config.SignplusConfig; import com.alohi.signplus.exceptions.ApiError; import com.alohi.signplus.http.Environment; @@ -65,10 +66,689 @@ */ public class SignplusService extends BaseService { + private RequestConfig createEnvelopeConfig; + private RequestConfig createEnvelopeFromTemplateConfig; + private RequestConfig listEnvelopesConfig; + private RequestConfig getEnvelopeConfig; + private RequestConfig deleteEnvelopeConfig; + private RequestConfig downloadEnvelopeSignedDocumentsConfig; + private RequestConfig downloadEnvelopeCertificateConfig; + private RequestConfig getEnvelopeDocumentConfig; + private RequestConfig getEnvelopeDocumentsConfig; + private RequestConfig addEnvelopeDocumentConfig; + private RequestConfig setEnvelopeDynamicFieldsConfig; + private RequestConfig addEnvelopeSigningStepsConfig; + private RequestConfig setEnvelopeAttachmentsSettingsConfig; + private RequestConfig setEnvelopeAttachmentsPlaceholdersConfig; + private RequestConfig getAttachmentFileConfig; + private RequestConfig sendEnvelopeConfig; + private RequestConfig duplicateEnvelopeConfig; + private RequestConfig voidEnvelopeConfig; + private RequestConfig renameEnvelopeConfig; + private RequestConfig setEnvelopeCommentConfig; + private RequestConfig setEnvelopeNotificationConfig; + private RequestConfig setEnvelopeExpirationDateConfig; + private RequestConfig setEnvelopeLegalityLevelConfig; + private RequestConfig getEnvelopeAnnotationsConfig; + private RequestConfig getEnvelopeDocumentAnnotationsConfig; + private RequestConfig addEnvelopeAnnotationConfig; + private RequestConfig deleteEnvelopeAnnotationConfig; + private RequestConfig createTemplateConfig; + private RequestConfig listTemplatesConfig; + private RequestConfig getTemplateConfig; + private RequestConfig deleteTemplateConfig; + private RequestConfig duplicateTemplateConfig; + private RequestConfig addTemplateDocumentConfig; + private RequestConfig getTemplateDocumentConfig; + private RequestConfig getTemplateDocumentsConfig; + private RequestConfig addTemplateSigningStepsConfig; + private RequestConfig renameTemplateConfig; + private RequestConfig setTemplateCommentConfig; + private RequestConfig setTemplateNotificationConfig; + private RequestConfig getTemplateAnnotationsConfig; + private RequestConfig getDocumentTemplateAnnotationsConfig; + private RequestConfig addTemplateAnnotationConfig; + private RequestConfig deleteTemplateAnnotationConfig; + private RequestConfig setTemplateAttachmentsSettingsConfig; + private RequestConfig setTemplateAttachmentsPlaceholdersConfig; + private RequestConfig createWebhookConfig; + private RequestConfig listWebhooksConfig; + private RequestConfig deleteWebhookConfig; + + /** + * Constructs a new instance of SignplusService. + * + * @param httpClient The HTTP client to use for requests + * @param config The SDK configuration + */ public SignplusService(@NonNull OkHttpClient httpClient, SignplusConfig config) { super(httpClient, config); } + /** + * Sets method-level configuration for {@code createEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setCreateEnvelopeConfig(RequestConfig config) { + this.createEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code createEnvelopeFromTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setCreateEnvelopeFromTemplateConfig(RequestConfig config) { + this.createEnvelopeFromTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code listEnvelopes}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setListEnvelopesConfig(RequestConfig config) { + this.listEnvelopesConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetEnvelopeConfig(RequestConfig config) { + this.getEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code deleteEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDeleteEnvelopeConfig(RequestConfig config) { + this.deleteEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code downloadEnvelopeSignedDocuments}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDownloadEnvelopeSignedDocumentsConfig(RequestConfig config) { + this.downloadEnvelopeSignedDocumentsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code downloadEnvelopeCertificate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDownloadEnvelopeCertificateConfig(RequestConfig config) { + this.downloadEnvelopeCertificateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getEnvelopeDocument}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetEnvelopeDocumentConfig(RequestConfig config) { + this.getEnvelopeDocumentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getEnvelopeDocuments}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetEnvelopeDocumentsConfig(RequestConfig config) { + this.getEnvelopeDocumentsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addEnvelopeDocument}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddEnvelopeDocumentConfig(RequestConfig config) { + this.addEnvelopeDocumentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeDynamicFields}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeDynamicFieldsConfig(RequestConfig config) { + this.setEnvelopeDynamicFieldsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addEnvelopeSigningSteps}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddEnvelopeSigningStepsConfig(RequestConfig config) { + this.addEnvelopeSigningStepsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeAttachmentsSettings}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeAttachmentsSettingsConfig(RequestConfig config) { + this.setEnvelopeAttachmentsSettingsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeAttachmentsPlaceholders}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeAttachmentsPlaceholdersConfig(RequestConfig config) { + this.setEnvelopeAttachmentsPlaceholdersConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getAttachmentFile}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetAttachmentFileConfig(RequestConfig config) { + this.getAttachmentFileConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code sendEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSendEnvelopeConfig(RequestConfig config) { + this.sendEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code duplicateEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDuplicateEnvelopeConfig(RequestConfig config) { + this.duplicateEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code voidEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setVoidEnvelopeConfig(RequestConfig config) { + this.voidEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code renameEnvelope}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setRenameEnvelopeConfig(RequestConfig config) { + this.renameEnvelopeConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeComment}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeCommentConfig(RequestConfig config) { + this.setEnvelopeCommentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeNotification}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeNotificationConfig(RequestConfig config) { + this.setEnvelopeNotificationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeExpirationDate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeExpirationDateConfig(RequestConfig config) { + this.setEnvelopeExpirationDateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setEnvelopeLegalityLevel}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetEnvelopeLegalityLevelConfig(RequestConfig config) { + this.setEnvelopeLegalityLevelConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getEnvelopeAnnotations}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetEnvelopeAnnotationsConfig(RequestConfig config) { + this.getEnvelopeAnnotationsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getEnvelopeDocumentAnnotations}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetEnvelopeDocumentAnnotationsConfig(RequestConfig config) { + this.getEnvelopeDocumentAnnotationsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addEnvelopeAnnotation}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddEnvelopeAnnotationConfig(RequestConfig config) { + this.addEnvelopeAnnotationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code deleteEnvelopeAnnotation}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDeleteEnvelopeAnnotationConfig(RequestConfig config) { + this.deleteEnvelopeAnnotationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code createTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setCreateTemplateConfig(RequestConfig config) { + this.createTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code listTemplates}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setListTemplatesConfig(RequestConfig config) { + this.listTemplatesConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetTemplateConfig(RequestConfig config) { + this.getTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code deleteTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDeleteTemplateConfig(RequestConfig config) { + this.deleteTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code duplicateTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDuplicateTemplateConfig(RequestConfig config) { + this.duplicateTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addTemplateDocument}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddTemplateDocumentConfig(RequestConfig config) { + this.addTemplateDocumentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getTemplateDocument}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetTemplateDocumentConfig(RequestConfig config) { + this.getTemplateDocumentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getTemplateDocuments}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetTemplateDocumentsConfig(RequestConfig config) { + this.getTemplateDocumentsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addTemplateSigningSteps}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddTemplateSigningStepsConfig(RequestConfig config) { + this.addTemplateSigningStepsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code renameTemplate}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setRenameTemplateConfig(RequestConfig config) { + this.renameTemplateConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setTemplateComment}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetTemplateCommentConfig(RequestConfig config) { + this.setTemplateCommentConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setTemplateNotification}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetTemplateNotificationConfig(RequestConfig config) { + this.setTemplateNotificationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getTemplateAnnotations}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetTemplateAnnotationsConfig(RequestConfig config) { + this.getTemplateAnnotationsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code getDocumentTemplateAnnotations}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setGetDocumentTemplateAnnotationsConfig(RequestConfig config) { + this.getDocumentTemplateAnnotationsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code addTemplateAnnotation}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setAddTemplateAnnotationConfig(RequestConfig config) { + this.addTemplateAnnotationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code deleteTemplateAnnotation}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDeleteTemplateAnnotationConfig(RequestConfig config) { + this.deleteTemplateAnnotationConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setTemplateAttachmentsSettings}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetTemplateAttachmentsSettingsConfig(RequestConfig config) { + this.setTemplateAttachmentsSettingsConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code setTemplateAttachmentsPlaceholders}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setSetTemplateAttachmentsPlaceholdersConfig(RequestConfig config) { + this.setTemplateAttachmentsPlaceholdersConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code createWebhook}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setCreateWebhookConfig(RequestConfig config) { + this.createWebhookConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code listWebhooks}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setListWebhooksConfig(RequestConfig config) { + this.listWebhooksConfig = config; + return this; + } + + /** + * Sets method-level configuration for {@code deleteWebhook}. + * Method-level overrides take precedence over service-level configuration but are + * overridden by request-level configurations. + * + * @param config The configuration overrides to apply at the method level + * @return This service instance for method chaining + */ + public SignplusService setDeleteWebhookConfig(RequestConfig config) { + this.deleteWebhookConfig = config; + return this; + } + /** * Create new envelope * @@ -77,9 +757,24 @@ public SignplusService(@NonNull OkHttpClient httpClient, SignplusConfig config) */ public Envelope createEnvelope(@NonNull CreateEnvelopeRequest createEnvelopeRequest) throws ApiError, ValidationException { - Request request = this.buildCreateEnvelopeRequest(createEnvelopeRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.createEnvelope(createEnvelopeRequest, null); + } + + /** + * Create new envelope + * + * @param createEnvelopeRequest {@link CreateEnvelopeRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope createEnvelope( + @NonNull CreateEnvelopeRequest createEnvelopeRequest, + RequestConfig requestConfig + ) throws ApiError, ValidationException { + RequestConfig resolvedConfig = this.getResolvedConfig(this.createEnvelopeConfig, requestConfig); + Request request = this.buildCreateEnvelopeRequest(createEnvelopeRequest, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -88,25 +783,48 @@ public Envelope createEnvelope(@NonNull CreateEnvelopeRequest createEnvelopeRequ * @param createEnvelopeRequest {@link CreateEnvelopeRequest} Request Body * @return response of {@code CompletableFuture} */ - public CompletableFuture createEnvelopeAsync(@NonNull CreateEnvelopeRequest createEnvelopeRequest) - throws ApiError, ValidationException { - Request request = this.buildCreateEnvelopeRequest(createEnvelopeRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + public CompletableFuture createEnvelopeAsync( + @NonNull CreateEnvelopeRequest createEnvelopeRequest + ) throws ApiError, ValidationException { + return this.createEnvelopeAsync(createEnvelopeRequest, null); } - private Request buildCreateEnvelopeRequest(@NonNull CreateEnvelopeRequest createEnvelopeRequest) - throws ValidationException { + /** + * Create new envelope + * + * @param createEnvelopeRequest {@link CreateEnvelopeRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture createEnvelopeAsync( + @NonNull CreateEnvelopeRequest createEnvelopeRequest, + RequestConfig requestConfig + ) throws ApiError, ValidationException { + RequestConfig resolvedConfig = this.getResolvedConfig(this.createEnvelopeConfig, requestConfig); + Request request = this.buildCreateEnvelopeRequest(createEnvelopeRequest, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); + } + + private Request buildCreateEnvelopeRequest( + @NonNull CreateEnvelopeRequest createEnvelopeRequest, + RequestConfig resolvedConfig + ) throws ValidationException { new ViolationAggregator() - .add(new CreateEnvelopeRequestValidator("createEnvelopeRequest").required().validate(createEnvelopeRequest)) + .add( + new CreateEnvelopeRequestValidator("createEnvelopeRequest") + .required() + .validate(createEnvelopeRequest) + ) .validateAll(); return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setJsonContent(createEnvelopeRequest) .build(); } @@ -122,9 +840,32 @@ public Envelope createEnvelopeFromTemplate( @NonNull String templateId, @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest ) throws ApiError, ValidationException { - Request request = this.buildCreateEnvelopeFromTemplateRequest(templateId, createEnvelopeFromTemplateRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.createEnvelopeFromTemplate(templateId, createEnvelopeFromTemplateRequest, null); + } + + /** + * Create new envelope from template + * + * @param templateId String + * @param createEnvelopeFromTemplateRequest {@link CreateEnvelopeFromTemplateRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope createEnvelopeFromTemplate( + @NonNull String templateId, + @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest, + RequestConfig requestConfig + ) throws ApiError, ValidationException { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.createEnvelopeFromTemplateConfig, requestConfig); + Request request = + this.buildCreateEnvelopeFromTemplateRequest( + templateId, + createEnvelopeFromTemplateRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -138,15 +879,44 @@ public CompletableFuture createEnvelopeFromTemplateAsync( @NonNull String templateId, @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest ) throws ApiError, ValidationException { - Request request = this.buildCreateEnvelopeFromTemplateRequest(templateId, createEnvelopeFromTemplateRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.createEnvelopeFromTemplateAsync( + templateId, + createEnvelopeFromTemplateRequest, + null + ); + } + + /** + * Create new envelope from template + * + * @param templateId String + * @param createEnvelopeFromTemplateRequest {@link CreateEnvelopeFromTemplateRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture createEnvelopeFromTemplateAsync( + @NonNull String templateId, + @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest, + RequestConfig requestConfig + ) throws ApiError, ValidationException { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.createEnvelopeFromTemplateConfig, requestConfig); + Request request = + this.buildCreateEnvelopeFromTemplateRequest( + templateId, + createEnvelopeFromTemplateRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildCreateEnvelopeFromTemplateRequest( @NonNull String templateId, - @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest + @NonNull CreateEnvelopeFromTemplateRequest createEnvelopeFromTemplateRequest, + RequestConfig resolvedConfig ) throws ValidationException { new ViolationAggregator() .add( @@ -157,10 +927,10 @@ private Request buildCreateEnvelopeFromTemplateRequest( .validateAll(); return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/from_template/{template_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("template_id", templateId) .setJsonContent(createEnvelopeFromTemplateRequest) .build(); @@ -181,10 +951,26 @@ public ListEnvelopesResponse listEnvelopes() throws ApiError { * @param listEnvelopesRequest {@link ListEnvelopesRequest} Request Body * @return response of {@code ListEnvelopesResponse} */ - public ListEnvelopesResponse listEnvelopes(@NonNull ListEnvelopesRequest listEnvelopesRequest) throws ApiError { - Request request = this.buildListEnvelopesRequest(listEnvelopesRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + public ListEnvelopesResponse listEnvelopes(@NonNull ListEnvelopesRequest listEnvelopesRequest) + throws ApiError { + return this.listEnvelopes(listEnvelopesRequest, null); + } + + /** + * List envelopes + * + * @param listEnvelopesRequest {@link ListEnvelopesRequest} Request Body + * @return response of {@code ListEnvelopesResponse} + */ + public ListEnvelopesResponse listEnvelopes( + @NonNull ListEnvelopesRequest listEnvelopesRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.listEnvelopesConfig, requestConfig); + Request request = this.buildListEnvelopesRequest(listEnvelopesRequest, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -205,20 +991,38 @@ public CompletableFuture listEnvelopesAsync() throws ApiE public CompletableFuture listEnvelopesAsync( @NonNull ListEnvelopesRequest listEnvelopesRequest ) throws ApiError { - Request request = this.buildListEnvelopesRequest(listEnvelopesRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) - ); + return this.listEnvelopesAsync(listEnvelopesRequest, null); } - private Request buildListEnvelopesRequest(@NonNull ListEnvelopesRequest listEnvelopesRequest) { + /** + * List envelopes + * + * @param listEnvelopesRequest {@link ListEnvelopesRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture listEnvelopesAsync( + @NonNull ListEnvelopesRequest listEnvelopesRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.listEnvelopesConfig, requestConfig); + Request request = this.buildListEnvelopesRequest(listEnvelopesRequest, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); + } + + private Request buildListEnvelopesRequest( + @NonNull ListEnvelopesRequest listEnvelopesRequest, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelopes" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setJsonContent(listEnvelopesRequest) .build(); } @@ -230,9 +1034,22 @@ private Request buildListEnvelopesRequest(@NonNull ListEnvelopesRequest listEnve * @return response of {@code Envelope} */ public Envelope getEnvelope(@NonNull String envelopeId) throws ApiError { - Request request = this.buildGetEnvelopeRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.getEnvelope(envelopeId, null); + } + + /** + * Get envelope + * + * @param envelopeId String + * @return response of {@code Envelope} + */ + public Envelope getEnvelope(@NonNull String envelopeId, RequestConfig requestConfig) + throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.getEnvelopeConfig, requestConfig); + Request request = this.buildGetEnvelopeRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -242,19 +1059,38 @@ public Envelope getEnvelope(@NonNull String envelopeId) throws ApiError { * @return response of {@code CompletableFuture} */ public CompletableFuture getEnvelopeAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildGetEnvelopeRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.getEnvelopeAsync(envelopeId, null); + } + + /** + * Get envelope + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture getEnvelopeAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.getEnvelopeConfig, requestConfig); + Request request = this.buildGetEnvelopeRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } - private Request buildGetEnvelopeRequest(@NonNull String envelopeId) { + private Request buildGetEnvelopeRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -266,8 +1102,20 @@ private Request buildGetEnvelopeRequest(@NonNull String envelopeId) { * @return response of {@code void} */ public void deleteEnvelope(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDeleteEnvelopeRequest(envelopeId); - this.execute(request); + this.deleteEnvelope(envelopeId, null); + } + + /** + * Delete envelope + * + * @param envelopeId String + * @return response of {@code void} + */ + public void deleteEnvelope(@NonNull String envelopeId, RequestConfig requestConfig) + throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.deleteEnvelopeConfig, requestConfig); + Request request = this.buildDeleteEnvelopeRequest(envelopeId, resolvedConfig); + this.execute(request, resolvedConfig); } /** @@ -277,17 +1125,34 @@ public void deleteEnvelope(@NonNull String envelopeId) throws ApiError { * @return response of {@code CompletableFuture} */ public CompletableFuture deleteEnvelopeAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDeleteEnvelopeRequest(envelopeId); - return this.executeAsync(request).thenApplyAsync(response -> null); + return this.deleteEnvelopeAsync(envelopeId, null); + } + + /** + * Delete envelope + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture deleteEnvelopeAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.deleteEnvelopeConfig, requestConfig); + Request request = this.buildDeleteEnvelopeRequest(envelopeId, resolvedConfig); + return this.executeAsync(request, resolvedConfig).thenApplyAsync(response -> null); } - private Request buildDeleteEnvelopeRequest(@NonNull String envelopeId) { + private Request buildDeleteEnvelopeRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.DELETE, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -303,9 +1168,32 @@ public byte[] downloadEnvelopeSignedDocuments( @NonNull String envelopeId, @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters ) throws ApiError { - Request request = this.buildDownloadEnvelopeSignedDocumentsRequest(envelopeId, requestParameters); - Response response = this.execute(request); - return ModelConverter.readBytes(response); + return this.downloadEnvelopeSignedDocuments(envelopeId, requestParameters, null); + } + + /** + * Download signed documents for an envelope + * + * @param envelopeId String ID of the envelope + * @param requestParameters {@link DownloadEnvelopeSignedDocumentsParameters} Request Parameters Object + * @return response of {@code byte[]} + */ + public byte[] downloadEnvelopeSignedDocuments( + @NonNull String envelopeId, + @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.downloadEnvelopeSignedDocumentsConfig, requestConfig); + Request request = + this.buildDownloadEnvelopeSignedDocumentsRequest( + envelopeId, + requestParameters, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; } /** @@ -319,23 +1207,52 @@ public CompletableFuture downloadEnvelopeSignedDocumentsAsync( @NonNull String envelopeId, @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters ) throws ApiError { - Request request = this.buildDownloadEnvelopeSignedDocumentsRequest(envelopeId, requestParameters); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.readBytes(response)); + return this.downloadEnvelopeSignedDocumentsAsync(envelopeId, requestParameters, null); + } + + /** + * Download signed documents for an envelope + * + * @param envelopeId String ID of the envelope + * @param requestParameters {@link DownloadEnvelopeSignedDocumentsParameters} Request Parameters Object + * @return response of {@code CompletableFuture} + */ + public CompletableFuture downloadEnvelopeSignedDocumentsAsync( + @NonNull String envelopeId, + @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.downloadEnvelopeSignedDocumentsConfig, requestConfig); + Request request = + this.buildDownloadEnvelopeSignedDocumentsRequest( + envelopeId, + requestParameters, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; + }); } private Request buildDownloadEnvelopeSignedDocumentsRequest( @NonNull String envelopeId, - @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters + @NonNull DownloadEnvelopeSignedDocumentsParameters requestParameters, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/signed_documents" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) - .setOptionalQueryParameter("certificate_of_completion", requestParameters.getCertificateOfCompletion()) + .setOptionalQueryParameter( + "certificate_of_completion", + requestParameters.getCertificateOfCompletion() + ) .build(); } @@ -346,9 +1263,36 @@ private Request buildDownloadEnvelopeSignedDocumentsRequest( * @return response of {@code byte[]} */ public byte[] downloadEnvelopeCertificate(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDownloadEnvelopeCertificateRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.readBytes(response); + return this.downloadEnvelopeCertificate(envelopeId, null); + } + + /** + * Download certificate of completion for an envelope + * + * @param envelopeId String ID of the envelope + * @return response of {@code byte[]} + */ + public byte[] downloadEnvelopeCertificate( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.downloadEnvelopeCertificateConfig, requestConfig); + Request request = this.buildDownloadEnvelopeCertificateRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; + } + + /** + * Download certificate of completion for an envelope + * + * @param envelopeId String ID of the envelope + * @return response of {@code CompletableFuture} + */ + public CompletableFuture downloadEnvelopeCertificateAsync(@NonNull String envelopeId) + throws ApiError { + return this.downloadEnvelopeCertificateAsync(envelopeId, null); } /** @@ -357,19 +1301,30 @@ public byte[] downloadEnvelopeCertificate(@NonNull String envelopeId) throws Api * @param envelopeId String ID of the envelope * @return response of {@code CompletableFuture} */ - public CompletableFuture downloadEnvelopeCertificateAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDownloadEnvelopeCertificateRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.readBytes(response)); + public CompletableFuture downloadEnvelopeCertificateAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.downloadEnvelopeCertificateConfig, requestConfig); + Request request = this.buildDownloadEnvelopeCertificateRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; + }); } - private Request buildDownloadEnvelopeCertificateRequest(@NonNull String envelopeId) { + private Request buildDownloadEnvelopeCertificateRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/certificate" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -381,10 +1336,29 @@ private Request buildDownloadEnvelopeCertificateRequest(@NonNull String envelope * @param documentId String * @return response of {@code Document} */ - public Document getEnvelopeDocument(@NonNull String envelopeId, @NonNull String documentId) throws ApiError { - Request request = this.buildGetEnvelopeDocumentRequest(envelopeId, documentId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + public Document getEnvelopeDocument(@NonNull String envelopeId, @NonNull String documentId) + throws ApiError { + return this.getEnvelopeDocument(envelopeId, documentId, null); + } + + /** + * Get envelope document + * + * @param envelopeId String + * @param documentId String + * @return response of {@code Document} + */ + public Document getEnvelopeDocument( + @NonNull String envelopeId, + @NonNull String documentId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentConfig, requestConfig); + Request request = this.buildGetEnvelopeDocumentRequest(envelopeId, documentId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -394,21 +1368,46 @@ public Document getEnvelopeDocument(@NonNull String envelopeId, @NonNull String * @param documentId String * @return response of {@code CompletableFuture} */ - public CompletableFuture getEnvelopeDocumentAsync(@NonNull String envelopeId, @NonNull String documentId) - throws ApiError { - Request request = this.buildGetEnvelopeDocumentRequest(envelopeId, documentId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + public CompletableFuture getEnvelopeDocumentAsync( + @NonNull String envelopeId, + @NonNull String documentId + ) throws ApiError { + return this.getEnvelopeDocumentAsync(envelopeId, documentId, null); + } + + /** + * Get envelope document + * + * @param envelopeId String + * @param documentId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture getEnvelopeDocumentAsync( + @NonNull String envelopeId, + @NonNull String documentId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentConfig, requestConfig); + Request request = this.buildGetEnvelopeDocumentRequest(envelopeId, documentId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } - private Request buildGetEnvelopeDocumentRequest(@NonNull String envelopeId, @NonNull String documentId) { + private Request buildGetEnvelopeDocumentRequest( + @NonNull String envelopeId, + @NonNull String documentId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/document/{document_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setPathParameter("document_id", documentId) .build(); @@ -420,10 +1419,27 @@ private Request buildGetEnvelopeDocumentRequest(@NonNull String envelopeId, @Non * @param envelopeId String * @return response of {@code ListEnvelopeDocumentsResponse} */ - public ListEnvelopeDocumentsResponse getEnvelopeDocuments(@NonNull String envelopeId) throws ApiError { - Request request = this.buildGetEnvelopeDocumentsRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + public ListEnvelopeDocumentsResponse getEnvelopeDocuments(@NonNull String envelopeId) + throws ApiError { + return this.getEnvelopeDocuments(envelopeId, null); + } + + /** + * Get envelope documents + * + * @param envelopeId String + * @return response of {@code ListEnvelopeDocumentsResponse} + */ + public ListEnvelopeDocumentsResponse getEnvelopeDocuments( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentsConfig, requestConfig); + Request request = this.buildGetEnvelopeDocumentsRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -432,22 +1448,45 @@ public ListEnvelopeDocumentsResponse getEnvelopeDocuments(@NonNull String envelo * @param envelopeId String * @return response of {@code CompletableFuture} */ - public CompletableFuture getEnvelopeDocumentsAsync(@NonNull String envelopeId) - throws ApiError { - Request request = this.buildGetEnvelopeDocumentsRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) - ); + public CompletableFuture getEnvelopeDocumentsAsync( + @NonNull String envelopeId + ) throws ApiError { + return this.getEnvelopeDocumentsAsync(envelopeId, null); + } + + /** + * Get envelope documents + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture getEnvelopeDocumentsAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentsConfig, requestConfig); + Request request = this.buildGetEnvelopeDocumentsRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert( + bodyBytes, + new TypeReference() {} + ); + }); } - private Request buildGetEnvelopeDocumentsRequest(@NonNull String envelopeId) { + private Request buildGetEnvelopeDocumentsRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/documents" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -465,9 +1504,35 @@ public Document addEnvelopeDocument( @NonNull AddEnvelopeDocumentRequest addEnvelopeDocumentRequest, @NonNull String _filename ) throws ApiError { - Request request = this.buildAddEnvelopeDocumentRequest(envelopeId, addEnvelopeDocumentRequest, _filename); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.addEnvelopeDocument(envelopeId, addEnvelopeDocumentRequest, _filename, null); + } + + /** + * Add envelope document + * + * @param envelopeId String + * @param addEnvelopeDocumentRequest {@link AddEnvelopeDocumentRequest} Request Body + * @param _filename String Filename for the uploaded file + * @return response of {@code Document} + */ + public Document addEnvelopeDocument( + @NonNull String envelopeId, + @NonNull AddEnvelopeDocumentRequest addEnvelopeDocumentRequest, + @NonNull String _filename, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeDocumentConfig, requestConfig); + Request request = + this.buildAddEnvelopeDocumentRequest( + envelopeId, + addEnvelopeDocumentRequest, + _filename, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -483,31 +1548,63 @@ public CompletableFuture addEnvelopeDocumentAsync( @NonNull AddEnvelopeDocumentRequest addEnvelopeDocumentRequest, @NonNull String _filename ) throws ApiError { - Request request = this.buildAddEnvelopeDocumentRequest(envelopeId, addEnvelopeDocumentRequest, _filename); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.addEnvelopeDocumentAsync(envelopeId, addEnvelopeDocumentRequest, _filename, null); + } + + /** + * Add envelope document + * + * @param envelopeId String + * @param addEnvelopeDocumentRequest {@link AddEnvelopeDocumentRequest} Request Body + * @param _filename String Filename for the uploaded file + * @return response of {@code CompletableFuture} + */ + public CompletableFuture addEnvelopeDocumentAsync( + @NonNull String envelopeId, + @NonNull AddEnvelopeDocumentRequest addEnvelopeDocumentRequest, + @NonNull String _filename, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeDocumentConfig, requestConfig); + Request request = + this.buildAddEnvelopeDocumentRequest( + envelopeId, + addEnvelopeDocumentRequest, + _filename, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildAddEnvelopeDocumentRequest( @NonNull String envelopeId, @NonNull AddEnvelopeDocumentRequest addEnvelopeDocumentRequest, - @NonNull String _filename + @NonNull String _filename, + RequestConfig resolvedConfig ) { - MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder() + .setType(MultipartBody.FORM); if (addEnvelopeDocumentRequest.getFile() != null) { multipartBodyBuilder.addFormDataPart( "file", _filename, - RequestBody.create(addEnvelopeDocumentRequest.getFile(), MediaType.parse("application/octet-stream")) + RequestBody.create( + addEnvelopeDocumentRequest.getFile(), + MediaType.parse("application/octet-stream") + ) ); } return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/document" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setBody(multipartBodyBuilder.build()) .build(); @@ -524,9 +1621,32 @@ public Envelope setEnvelopeDynamicFields( @NonNull String envelopeId, @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest ) throws ApiError { - Request request = this.buildSetEnvelopeDynamicFieldsRequest(envelopeId, setEnvelopeDynamicFieldsRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.setEnvelopeDynamicFields(envelopeId, setEnvelopeDynamicFieldsRequest, null); + } + + /** + * Set envelope dynamic fields + * + * @param envelopeId String + * @param setEnvelopeDynamicFieldsRequest {@link SetEnvelopeDynamicFieldsRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeDynamicFields( + @NonNull String envelopeId, + @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeDynamicFieldsConfig, requestConfig); + Request request = + this.buildSetEnvelopeDynamicFieldsRequest( + envelopeId, + setEnvelopeDynamicFieldsRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -540,22 +1660,47 @@ public CompletableFuture setEnvelopeDynamicFieldsAsync( @NonNull String envelopeId, @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest ) throws ApiError { - Request request = this.buildSetEnvelopeDynamicFieldsRequest(envelopeId, setEnvelopeDynamicFieldsRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.setEnvelopeDynamicFieldsAsync(envelopeId, setEnvelopeDynamicFieldsRequest, null); + } + + /** + * Set envelope dynamic fields + * + * @param envelopeId String + * @param setEnvelopeDynamicFieldsRequest {@link SetEnvelopeDynamicFieldsRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeDynamicFieldsAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeDynamicFieldsConfig, requestConfig); + Request request = + this.buildSetEnvelopeDynamicFieldsRequest( + envelopeId, + setEnvelopeDynamicFieldsRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeDynamicFieldsRequest( @NonNull String envelopeId, - @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest + @NonNull SetEnvelopeDynamicFieldsRequest setEnvelopeDynamicFieldsRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/dynamic_fields" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(setEnvelopeDynamicFieldsRequest) .build(); @@ -566,15 +1711,52 @@ private Request buildSetEnvelopeDynamicFieldsRequest( * * @param envelopeId String * @param addEnvelopeSigningStepsRequest {@link AddEnvelopeSigningStepsRequest} Request Body - * @return response of {@code Envelope} + * @return response of {@code Envelope} + */ + public Envelope addEnvelopeSigningSteps( + @NonNull String envelopeId, + @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest + ) throws ApiError { + return this.addEnvelopeSigningSteps(envelopeId, addEnvelopeSigningStepsRequest, null); + } + + /** + * Add envelope signing steps + * + * @param envelopeId String + * @param addEnvelopeSigningStepsRequest {@link AddEnvelopeSigningStepsRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope addEnvelopeSigningSteps( + @NonNull String envelopeId, + @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeSigningStepsConfig, requestConfig); + Request request = + this.buildAddEnvelopeSigningStepsRequest( + envelopeId, + addEnvelopeSigningStepsRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + } + + /** + * Add envelope signing steps + * + * @param envelopeId String + * @param addEnvelopeSigningStepsRequest {@link AddEnvelopeSigningStepsRequest} Request Body + * @return response of {@code CompletableFuture} */ - public Envelope addEnvelopeSigningSteps( + public CompletableFuture addEnvelopeSigningStepsAsync( @NonNull String envelopeId, @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest ) throws ApiError { - Request request = this.buildAddEnvelopeSigningStepsRequest(envelopeId, addEnvelopeSigningStepsRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.addEnvelopeSigningStepsAsync(envelopeId, addEnvelopeSigningStepsRequest, null); } /** @@ -586,24 +1768,35 @@ public Envelope addEnvelopeSigningSteps( */ public CompletableFuture addEnvelopeSigningStepsAsync( @NonNull String envelopeId, - @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest + @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest, + RequestConfig requestConfig ) throws ApiError { - Request request = this.buildAddEnvelopeSigningStepsRequest(envelopeId, addEnvelopeSigningStepsRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeSigningStepsConfig, requestConfig); + Request request = + this.buildAddEnvelopeSigningStepsRequest( + envelopeId, + addEnvelopeSigningStepsRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildAddEnvelopeSigningStepsRequest( @NonNull String envelopeId, - @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest + @NonNull AddEnvelopeSigningStepsRequest addEnvelopeSigningStepsRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/signing_steps" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(addEnvelopeSigningStepsRequest) .build(); @@ -620,10 +1813,36 @@ public EnvelopeAttachments setEnvelopeAttachmentsSettings( @NonNull String envelopeId, @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest ) throws ApiError { + return this.setEnvelopeAttachmentsSettings( + envelopeId, + setEnvelopeAttachmentsSettingsRequest, + null + ); + } + + /** + * Set envelope attachment settings + * + * @param envelopeId String + * @param setEnvelopeAttachmentsSettingsRequest {@link SetEnvelopeAttachmentsSettingsRequest} Request Body + * @return response of {@code EnvelopeAttachments} + */ + public EnvelopeAttachments setEnvelopeAttachmentsSettings( + @NonNull String envelopeId, + @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeAttachmentsSettingsConfig, requestConfig); Request request = - this.buildSetEnvelopeAttachmentsSettingsRequest(envelopeId, setEnvelopeAttachmentsSettingsRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + this.buildSetEnvelopeAttachmentsSettingsRequest( + envelopeId, + setEnvelopeAttachmentsSettingsRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -637,24 +1856,51 @@ public CompletableFuture setEnvelopeAttachmentsSettingsAsyn @NonNull String envelopeId, @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest ) throws ApiError { + return this.setEnvelopeAttachmentsSettingsAsync( + envelopeId, + setEnvelopeAttachmentsSettingsRequest, + null + ); + } + + /** + * Set envelope attachment settings + * + * @param envelopeId String + * @param setEnvelopeAttachmentsSettingsRequest {@link SetEnvelopeAttachmentsSettingsRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeAttachmentsSettingsAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeAttachmentsSettingsConfig, requestConfig); Request request = - this.buildSetEnvelopeAttachmentsSettingsRequest(envelopeId, setEnvelopeAttachmentsSettingsRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) - ); + this.buildSetEnvelopeAttachmentsSettingsRequest( + envelopeId, + setEnvelopeAttachmentsSettingsRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeAttachmentsSettingsRequest( @NonNull String envelopeId, - @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest + @NonNull SetEnvelopeAttachmentsSettingsRequest setEnvelopeAttachmentsSettingsRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/attachments/settings" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(setEnvelopeAttachmentsSettingsRequest) .build(); @@ -671,10 +1917,36 @@ public EnvelopeAttachments setEnvelopeAttachmentsPlaceholders( @NonNull String envelopeId, @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest ) throws ApiError { + return this.setEnvelopeAttachmentsPlaceholders( + envelopeId, + setEnvelopeAttachmentsPlaceholdersRequest, + null + ); + } + + /** + * Placeholders to be set, completely replacing the existing ones. + * + * @param envelopeId String + * @param setEnvelopeAttachmentsPlaceholdersRequest {@link SetEnvelopeAttachmentsPlaceholdersRequest} Request Body + * @return response of {@code EnvelopeAttachments} + */ + public EnvelopeAttachments setEnvelopeAttachmentsPlaceholders( + @NonNull String envelopeId, + @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeAttachmentsPlaceholdersConfig, requestConfig); Request request = - this.buildSetEnvelopeAttachmentsPlaceholdersRequest(envelopeId, setEnvelopeAttachmentsPlaceholdersRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + this.buildSetEnvelopeAttachmentsPlaceholdersRequest( + envelopeId, + setEnvelopeAttachmentsPlaceholdersRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -688,24 +1960,51 @@ public CompletableFuture setEnvelopeAttachmentsPlaceholders @NonNull String envelopeId, @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest ) throws ApiError { + return this.setEnvelopeAttachmentsPlaceholdersAsync( + envelopeId, + setEnvelopeAttachmentsPlaceholdersRequest, + null + ); + } + + /** + * Placeholders to be set, completely replacing the existing ones. + * + * @param envelopeId String + * @param setEnvelopeAttachmentsPlaceholdersRequest {@link SetEnvelopeAttachmentsPlaceholdersRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeAttachmentsPlaceholdersAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeAttachmentsPlaceholdersConfig, requestConfig); Request request = - this.buildSetEnvelopeAttachmentsPlaceholdersRequest(envelopeId, setEnvelopeAttachmentsPlaceholdersRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) - ); + this.buildSetEnvelopeAttachmentsPlaceholdersRequest( + envelopeId, + setEnvelopeAttachmentsPlaceholdersRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeAttachmentsPlaceholdersRequest( @NonNull String envelopeId, - @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest + @NonNull SetEnvelopeAttachmentsPlaceholdersRequest setEnvelopeAttachmentsPlaceholdersRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/attachments/placeholders" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(setEnvelopeAttachmentsPlaceholdersRequest) .build(); @@ -718,10 +2017,29 @@ private Request buildSetEnvelopeAttachmentsPlaceholdersRequest( * @param fileId String * @return response of {@code byte[]} */ - public byte[] getAttachmentFile(@NonNull String envelopeId, @NonNull String fileId) throws ApiError { - Request request = this.buildGetAttachmentFileRequest(envelopeId, fileId); - Response response = this.execute(request); - return ModelConverter.readBytes(response); + public byte[] getAttachmentFile(@NonNull String envelopeId, @NonNull String fileId) + throws ApiError { + return this.getAttachmentFile(envelopeId, fileId, null); + } + + /** + * Get envelope attachment file + * + * @param envelopeId String + * @param fileId String + * @return response of {@code byte[]} + */ + public byte[] getAttachmentFile( + @NonNull String envelopeId, + @NonNull String fileId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getAttachmentFileConfig, requestConfig); + Request request = this.buildGetAttachmentFileRequest(envelopeId, fileId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; } /** @@ -731,20 +2049,46 @@ public byte[] getAttachmentFile(@NonNull String envelopeId, @NonNull String file * @param fileId String * @return response of {@code CompletableFuture} */ - public CompletableFuture getAttachmentFileAsync(@NonNull String envelopeId, @NonNull String fileId) - throws ApiError { - Request request = this.buildGetAttachmentFileRequest(envelopeId, fileId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.readBytes(response)); + public CompletableFuture getAttachmentFileAsync( + @NonNull String envelopeId, + @NonNull String fileId + ) throws ApiError { + return this.getAttachmentFileAsync(envelopeId, fileId, null); + } + + /** + * Get envelope attachment file + * + * @param envelopeId String + * @param fileId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture getAttachmentFileAsync( + @NonNull String envelopeId, + @NonNull String fileId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getAttachmentFileConfig, requestConfig); + Request request = this.buildGetAttachmentFileRequest(envelopeId, fileId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return bodyBytes; + }); } - private Request buildGetAttachmentFileRequest(@NonNull String envelopeId, @NonNull String fileId) { + private Request buildGetAttachmentFileRequest( + @NonNull String envelopeId, + @NonNull String fileId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/attachments/{file_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setPathParameter("file_id", fileId) .build(); @@ -757,9 +2101,22 @@ private Request buildGetAttachmentFileRequest(@NonNull String envelopeId, @NonNu * @return response of {@code Envelope} */ public Envelope sendEnvelope(@NonNull String envelopeId) throws ApiError { - Request request = this.buildSendEnvelopeRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.sendEnvelope(envelopeId, null); + } + + /** + * Send envelope for signature + * + * @param envelopeId String + * @return response of {@code Envelope} + */ + public Envelope sendEnvelope(@NonNull String envelopeId, RequestConfig requestConfig) + throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.sendEnvelopeConfig, requestConfig); + Request request = this.buildSendEnvelopeRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -769,19 +2126,38 @@ public Envelope sendEnvelope(@NonNull String envelopeId) throws ApiError { * @return response of {@code CompletableFuture} */ public CompletableFuture sendEnvelopeAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildSendEnvelopeRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.sendEnvelopeAsync(envelopeId, null); + } + + /** + * Send envelope for signature + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture sendEnvelopeAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.sendEnvelopeConfig, requestConfig); + Request request = this.buildSendEnvelopeRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } - private Request buildSendEnvelopeRequest(@NonNull String envelopeId) { + private Request buildSendEnvelopeRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/send" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -793,9 +2169,23 @@ private Request buildSendEnvelopeRequest(@NonNull String envelopeId) { * @return response of {@code Envelope} */ public Envelope duplicateEnvelope(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDuplicateEnvelopeRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.duplicateEnvelope(envelopeId, null); + } + + /** + * Duplicate envelope + * + * @param envelopeId String + * @return response of {@code Envelope} + */ + public Envelope duplicateEnvelope(@NonNull String envelopeId, RequestConfig requestConfig) + throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.duplicateEnvelopeConfig, requestConfig); + Request request = this.buildDuplicateEnvelopeRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -804,20 +2194,41 @@ public Envelope duplicateEnvelope(@NonNull String envelopeId) throws ApiError { * @param envelopeId String * @return response of {@code CompletableFuture} */ - public CompletableFuture duplicateEnvelopeAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildDuplicateEnvelopeRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + public CompletableFuture duplicateEnvelopeAsync(@NonNull String envelopeId) + throws ApiError { + return this.duplicateEnvelopeAsync(envelopeId, null); + } + + /** + * Duplicate envelope + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture duplicateEnvelopeAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.duplicateEnvelopeConfig, requestConfig); + Request request = this.buildDuplicateEnvelopeRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } - private Request buildDuplicateEnvelopeRequest(@NonNull String envelopeId) { + private Request buildDuplicateEnvelopeRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/duplicate" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -829,9 +2240,22 @@ private Request buildDuplicateEnvelopeRequest(@NonNull String envelopeId) { * @return response of {@code Envelope} */ public Envelope voidEnvelope(@NonNull String envelopeId) throws ApiError { - Request request = this.buildVoidEnvelopeRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.voidEnvelope(envelopeId, null); + } + + /** + * Void envelope + * + * @param envelopeId String + * @return response of {@code Envelope} + */ + public Envelope voidEnvelope(@NonNull String envelopeId, RequestConfig requestConfig) + throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.voidEnvelopeConfig, requestConfig); + Request request = this.buildVoidEnvelopeRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -841,19 +2265,38 @@ public Envelope voidEnvelope(@NonNull String envelopeId) throws ApiError { * @return response of {@code CompletableFuture} */ public CompletableFuture voidEnvelopeAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildVoidEnvelopeRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.voidEnvelopeAsync(envelopeId, null); + } + + /** + * Void envelope + * + * @param envelopeId String + * @return response of {@code CompletableFuture} + */ + public CompletableFuture voidEnvelopeAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.voidEnvelopeConfig, requestConfig); + Request request = this.buildVoidEnvelopeRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } - private Request buildVoidEnvelopeRequest(@NonNull String envelopeId) { + private Request buildVoidEnvelopeRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/void" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -865,11 +2308,31 @@ private Request buildVoidEnvelopeRequest(@NonNull String envelopeId) { * @param renameEnvelopeRequest {@link RenameEnvelopeRequest} Request Body * @return response of {@code Envelope} */ - public Envelope renameEnvelope(@NonNull String envelopeId, @NonNull RenameEnvelopeRequest renameEnvelopeRequest) - throws ApiError { - Request request = this.buildRenameEnvelopeRequest(envelopeId, renameEnvelopeRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + public Envelope renameEnvelope( + @NonNull String envelopeId, + @NonNull RenameEnvelopeRequest renameEnvelopeRequest + ) throws ApiError { + return this.renameEnvelope(envelopeId, renameEnvelopeRequest, null); + } + + /** + * Rename envelope + * + * @param envelopeId String + * @param renameEnvelopeRequest {@link RenameEnvelopeRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope renameEnvelope( + @NonNull String envelopeId, + @NonNull RenameEnvelopeRequest renameEnvelopeRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.renameEnvelopeConfig, requestConfig); + Request request = + this.buildRenameEnvelopeRequest(envelopeId, renameEnvelopeRequest, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -883,22 +2346,42 @@ public CompletableFuture renameEnvelopeAsync( @NonNull String envelopeId, @NonNull RenameEnvelopeRequest renameEnvelopeRequest ) throws ApiError { - Request request = this.buildRenameEnvelopeRequest(envelopeId, renameEnvelopeRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.renameEnvelopeAsync(envelopeId, renameEnvelopeRequest, null); + } + + /** + * Rename envelope + * + * @param envelopeId String + * @param renameEnvelopeRequest {@link RenameEnvelopeRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture renameEnvelopeAsync( + @NonNull String envelopeId, + @NonNull RenameEnvelopeRequest renameEnvelopeRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = this.getResolvedConfig(this.renameEnvelopeConfig, requestConfig); + Request request = + this.buildRenameEnvelopeRequest(envelopeId, renameEnvelopeRequest, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildRenameEnvelopeRequest( @NonNull String envelopeId, - @NonNull RenameEnvelopeRequest renameEnvelopeRequest + @NonNull RenameEnvelopeRequest renameEnvelopeRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/rename" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(renameEnvelopeRequest) .build(); @@ -915,9 +2398,42 @@ public Envelope setEnvelopeComment( @NonNull String envelopeId, @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest ) throws ApiError { - Request request = this.buildSetEnvelopeCommentRequest(envelopeId, setEnvelopeCommentRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.setEnvelopeComment(envelopeId, setEnvelopeCommentRequest, null); + } + + /** + * Set envelope comment + * + * @param envelopeId String + * @param setEnvelopeCommentRequest {@link SetEnvelopeCommentRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeComment( + @NonNull String envelopeId, + @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeCommentConfig, requestConfig); + Request request = + this.buildSetEnvelopeCommentRequest(envelopeId, setEnvelopeCommentRequest, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + } + + /** + * Set envelope comment + * + * @param envelopeId String + * @param setEnvelopeCommentRequest {@link SetEnvelopeCommentRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeCommentAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest + ) throws ApiError { + return this.setEnvelopeCommentAsync(envelopeId, setEnvelopeCommentRequest, null); } /** @@ -927,29 +2443,71 @@ public Envelope setEnvelopeComment( * @param setEnvelopeCommentRequest {@link SetEnvelopeCommentRequest} Request Body * @return response of {@code CompletableFuture} */ - public CompletableFuture setEnvelopeCommentAsync( + public CompletableFuture setEnvelopeCommentAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeCommentConfig, requestConfig); + Request request = + this.buildSetEnvelopeCommentRequest(envelopeId, setEnvelopeCommentRequest, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); + } + + private Request buildSetEnvelopeCommentRequest( + @NonNull String envelopeId, + @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest, + RequestConfig resolvedConfig + ) { + return new RequestBuilder( + HttpMethod.PUT, + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), + "envelope/{envelope_id}/set_comment" + ) + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") + .setPathParameter("envelope_id", envelopeId) + .setJsonContent(setEnvelopeCommentRequest) + .build(); + } + + /** + * Set envelope notification + * + * @param envelopeId String + * @param envelopeNotification {@link EnvelopeNotification} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeNotification( + @NonNull String envelopeId, + @NonNull EnvelopeNotification envelopeNotification + ) throws ApiError { + return this.setEnvelopeNotification(envelopeId, envelopeNotification, null); + } + + /** + * Set envelope notification + * + * @param envelopeId String + * @param envelopeNotification {@link EnvelopeNotification} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeNotification( @NonNull String envelopeId, - @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest + @NonNull EnvelopeNotification envelopeNotification, + RequestConfig requestConfig ) throws ApiError { - Request request = this.buildSetEnvelopeCommentRequest(envelopeId, setEnvelopeCommentRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); - } - - private Request buildSetEnvelopeCommentRequest( - @NonNull String envelopeId, - @NonNull SetEnvelopeCommentRequest setEnvelopeCommentRequest - ) { - return new RequestBuilder( - HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), - "envelope/{envelope_id}/set_comment" - ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") - .setPathParameter("envelope_id", envelopeId) - .setJsonContent(setEnvelopeCommentRequest) - .build(); + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeNotificationConfig, requestConfig); + Request request = + this.buildSetEnvelopeNotificationRequest(envelopeId, envelopeNotification, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -957,15 +2515,13 @@ private Request buildSetEnvelopeCommentRequest( * * @param envelopeId String * @param envelopeNotification {@link EnvelopeNotification} Request Body - * @return response of {@code Envelope} + * @return response of {@code CompletableFuture} */ - public Envelope setEnvelopeNotification( + public CompletableFuture setEnvelopeNotificationAsync( @NonNull String envelopeId, @NonNull EnvelopeNotification envelopeNotification ) throws ApiError { - Request request = this.buildSetEnvelopeNotificationRequest(envelopeId, envelopeNotification); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.setEnvelopeNotificationAsync(envelopeId, envelopeNotification, null); } /** @@ -977,24 +2533,31 @@ public Envelope setEnvelopeNotification( */ public CompletableFuture setEnvelopeNotificationAsync( @NonNull String envelopeId, - @NonNull EnvelopeNotification envelopeNotification + @NonNull EnvelopeNotification envelopeNotification, + RequestConfig requestConfig ) throws ApiError { - Request request = this.buildSetEnvelopeNotificationRequest(envelopeId, envelopeNotification); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeNotificationConfig, requestConfig); + Request request = + this.buildSetEnvelopeNotificationRequest(envelopeId, envelopeNotification, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeNotificationRequest( @NonNull String envelopeId, - @NonNull EnvelopeNotification envelopeNotification + @NonNull EnvelopeNotification envelopeNotification, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/set_notification" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(envelopeNotification) .build(); @@ -1011,9 +2574,32 @@ public Envelope setEnvelopeExpirationDate( @NonNull String envelopeId, @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest ) throws ApiError { - Request request = this.buildSetEnvelopeExpirationDateRequest(envelopeId, setEnvelopeExpirationRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.setEnvelopeExpirationDate(envelopeId, setEnvelopeExpirationRequest, null); + } + + /** + * Set envelope expiration date + * + * @param envelopeId String + * @param setEnvelopeExpirationRequest {@link SetEnvelopeExpirationRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeExpirationDate( + @NonNull String envelopeId, + @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeExpirationDateConfig, requestConfig); + Request request = + this.buildSetEnvelopeExpirationDateRequest( + envelopeId, + setEnvelopeExpirationRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -1027,22 +2613,47 @@ public CompletableFuture setEnvelopeExpirationDateAsync( @NonNull String envelopeId, @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest ) throws ApiError { - Request request = this.buildSetEnvelopeExpirationDateRequest(envelopeId, setEnvelopeExpirationRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.setEnvelopeExpirationDateAsync(envelopeId, setEnvelopeExpirationRequest, null); + } + + /** + * Set envelope expiration date + * + * @param envelopeId String + * @param setEnvelopeExpirationRequest {@link SetEnvelopeExpirationRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeExpirationDateAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeExpirationDateConfig, requestConfig); + Request request = + this.buildSetEnvelopeExpirationDateRequest( + envelopeId, + setEnvelopeExpirationRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeExpirationDateRequest( @NonNull String envelopeId, - @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest + @NonNull SetEnvelopeExpirationRequest setEnvelopeExpirationRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/set_expiration_date" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(setEnvelopeExpirationRequest) .build(); @@ -1059,9 +2670,32 @@ public Envelope setEnvelopeLegalityLevel( @NonNull String envelopeId, @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest ) throws ApiError { - Request request = this.buildSetEnvelopeLegalityLevelRequest(envelopeId, setEnvelopeLegalityLevelRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.setEnvelopeLegalityLevel(envelopeId, setEnvelopeLegalityLevelRequest, null); + } + + /** + * Set envelope legality level + * + * @param envelopeId String + * @param setEnvelopeLegalityLevelRequest {@link SetEnvelopeLegalityLevelRequest} Request Body + * @return response of {@code Envelope} + */ + public Envelope setEnvelopeLegalityLevel( + @NonNull String envelopeId, + @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeLegalityLevelConfig, requestConfig); + Request request = + this.buildSetEnvelopeLegalityLevelRequest( + envelopeId, + setEnvelopeLegalityLevelRequest, + resolvedConfig + ); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -1075,22 +2709,47 @@ public CompletableFuture setEnvelopeLegalityLevelAsync( @NonNull String envelopeId, @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest ) throws ApiError { - Request request = this.buildSetEnvelopeLegalityLevelRequest(envelopeId, setEnvelopeLegalityLevelRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> ModelConverter.convert(response, new TypeReference() {}) - ); + return this.setEnvelopeLegalityLevelAsync(envelopeId, setEnvelopeLegalityLevelRequest, null); + } + + /** + * Set envelope legality level + * + * @param envelopeId String + * @param setEnvelopeLegalityLevelRequest {@link SetEnvelopeLegalityLevelRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture setEnvelopeLegalityLevelAsync( + @NonNull String envelopeId, + @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.setEnvelopeLegalityLevelConfig, requestConfig); + Request request = + this.buildSetEnvelopeLegalityLevelRequest( + envelopeId, + setEnvelopeLegalityLevelRequest, + resolvedConfig + ); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildSetEnvelopeLegalityLevelRequest( @NonNull String envelopeId, - @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest + @NonNull SetEnvelopeLegalityLevelRequest setEnvelopeLegalityLevelRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.PUT, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/set_legality_level" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(setEnvelopeLegalityLevelRequest) .build(); @@ -1103,9 +2762,25 @@ private Request buildSetEnvelopeLegalityLevelRequest( * @return response of {@code List} */ public List getEnvelopeAnnotations(@NonNull String envelopeId) throws ApiError { - Request request = this.buildGetEnvelopeAnnotationsRequest(envelopeId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference>() {}); + return this.getEnvelopeAnnotations(envelopeId, null); + } + + /** + * Get envelope annotations + * + * @param envelopeId String ID of the envelope + * @return response of {@code List} + */ + public List getEnvelopeAnnotations( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeAnnotationsConfig, requestConfig); + Request request = this.buildGetEnvelopeAnnotationsRequest(envelopeId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference>() {}); } /** @@ -1114,21 +2789,42 @@ public List getEnvelopeAnnotations(@NonNull String envelopeId) throw * @param envelopeId String ID of the envelope * @return response of {@code CompletableFuture>} */ - public CompletableFuture> getEnvelopeAnnotationsAsync(@NonNull String envelopeId) throws ApiError { - Request request = this.buildGetEnvelopeAnnotationsRequest(envelopeId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference>() {}) - ); + public CompletableFuture> getEnvelopeAnnotationsAsync( + @NonNull String envelopeId + ) throws ApiError { + return this.getEnvelopeAnnotationsAsync(envelopeId, null); + } + + /** + * Get envelope annotations + * + * @param envelopeId String ID of the envelope + * @return response of {@code CompletableFuture>} + */ + public CompletableFuture> getEnvelopeAnnotationsAsync( + @NonNull String envelopeId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeAnnotationsConfig, requestConfig); + Request request = this.buildGetEnvelopeAnnotationsRequest(envelopeId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference>() {}); + }); } - private Request buildGetEnvelopeAnnotationsRequest(@NonNull String envelopeId) { + private Request buildGetEnvelopeAnnotationsRequest( + @NonNull String envelopeId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/annotations" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .build(); } @@ -1144,9 +2840,7 @@ public ListEnvelopeDocumentAnnotationsResponse getEnvelopeDocumentAnnotations( @NonNull String envelopeId, @NonNull String documentId ) throws ApiError { - Request request = this.buildGetEnvelopeDocumentAnnotationsRequest(envelopeId, documentId); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.getEnvelopeDocumentAnnotations(envelopeId, documentId, null); } /** @@ -1154,26 +2848,78 @@ public ListEnvelopeDocumentAnnotationsResponse getEnvelopeDocumentAnnotations( * * @param envelopeId String ID of the envelope * @param documentId String ID of document - * @return response of {@code CompletableFuture} + * @return response of {@code ListEnvelopeDocumentAnnotationsResponse} */ - public CompletableFuture getEnvelopeDocumentAnnotationsAsync( + public ListEnvelopeDocumentAnnotationsResponse getEnvelopeDocumentAnnotations( @NonNull String envelopeId, - @NonNull String documentId + @NonNull String documentId, + RequestConfig requestConfig ) throws ApiError { - Request request = this.buildGetEnvelopeDocumentAnnotationsRequest(envelopeId, documentId); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentAnnotationsConfig, requestConfig); + Request request = + this.buildGetEnvelopeDocumentAnnotationsRequest(envelopeId, documentId, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert( + bodyBytes, + new TypeReference() {} ); } - private Request buildGetEnvelopeDocumentAnnotationsRequest(@NonNull String envelopeId, @NonNull String documentId) { + /** + * Get envelope document annotations + * + * @param envelopeId String ID of the envelope + * @param documentId String ID of document + * @return response of {@code CompletableFuture} + */ + public CompletableFuture< + ListEnvelopeDocumentAnnotationsResponse + > getEnvelopeDocumentAnnotationsAsync(@NonNull String envelopeId, @NonNull String documentId) + throws ApiError { + return this.getEnvelopeDocumentAnnotationsAsync(envelopeId, documentId, null); + } + + /** + * Get envelope document annotations + * + * @param envelopeId String ID of the envelope + * @param documentId String ID of document + * @return response of {@code CompletableFuture} + */ + public CompletableFuture< + ListEnvelopeDocumentAnnotationsResponse + > getEnvelopeDocumentAnnotationsAsync( + @NonNull String envelopeId, + @NonNull String documentId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.getEnvelopeDocumentAnnotationsConfig, requestConfig); + Request request = + this.buildGetEnvelopeDocumentAnnotationsRequest(envelopeId, documentId, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert( + bodyBytes, + new TypeReference() {} + ); + }); + } + + private Request buildGetEnvelopeDocumentAnnotationsRequest( + @NonNull String envelopeId, + @NonNull String documentId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.GET, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/annotations/{document_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setPathParameter("document_id", documentId) .build(); @@ -1190,9 +2936,28 @@ public Annotation addEnvelopeAnnotation( @NonNull String envelopeId, @NonNull AddAnnotationRequest addAnnotationRequest ) throws ApiError { - Request request = this.buildAddEnvelopeAnnotationRequest(envelopeId, addAnnotationRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference() {}); + return this.addEnvelopeAnnotation(envelopeId, addAnnotationRequest, null); + } + + /** + * Add envelope annotation + * + * @param envelopeId String ID of the envelope + * @param addAnnotationRequest {@link AddAnnotationRequest} Request Body + * @return response of {@code Annotation} + */ + public Annotation addEnvelopeAnnotation( + @NonNull String envelopeId, + @NonNull AddAnnotationRequest addAnnotationRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeAnnotationConfig, requestConfig); + Request request = + this.buildAddEnvelopeAnnotationRequest(envelopeId, addAnnotationRequest, resolvedConfig); + Response response = this.execute(request, resolvedConfig); + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); } /** @@ -1206,23 +2971,43 @@ public CompletableFuture addEnvelopeAnnotationAsync( @NonNull String envelopeId, @NonNull AddAnnotationRequest addAnnotationRequest ) throws ApiError { - Request request = this.buildAddEnvelopeAnnotationRequest(envelopeId, addAnnotationRequest); - CompletableFuture futureResponse = this.executeAsync(request); - return futureResponse.thenApplyAsync(response -> - ModelConverter.convert(response, new TypeReference() {}) - ); + return this.addEnvelopeAnnotationAsync(envelopeId, addAnnotationRequest, null); + } + + /** + * Add envelope annotation + * + * @param envelopeId String ID of the envelope + * @param addAnnotationRequest {@link AddAnnotationRequest} Request Body + * @return response of {@code CompletableFuture} + */ + public CompletableFuture addEnvelopeAnnotationAsync( + @NonNull String envelopeId, + @NonNull AddAnnotationRequest addAnnotationRequest, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.addEnvelopeAnnotationConfig, requestConfig); + Request request = + this.buildAddEnvelopeAnnotationRequest(envelopeId, addAnnotationRequest, resolvedConfig); + CompletableFuture futureResponse = this.executeAsync(request, resolvedConfig); + return futureResponse.thenApplyAsync(response -> { + byte[] bodyBytes = ModelConverter.readBytes(response); + return ModelConverter.convert(bodyBytes, new TypeReference() {}); + }); } private Request buildAddEnvelopeAnnotationRequest( @NonNull String envelopeId, - @NonNull AddAnnotationRequest addAnnotationRequest + @NonNull AddAnnotationRequest addAnnotationRequest, + RequestConfig resolvedConfig ) { return new RequestBuilder( HttpMethod.POST, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/annotation" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setJsonContent(addAnnotationRequest) .build(); @@ -1235,9 +3020,28 @@ private Request buildAddEnvelopeAnnotationRequest( * @param annotationId String ID of the annotation to delete * @return response of {@code void} */ - public void deleteEnvelopeAnnotation(@NonNull String envelopeId, @NonNull String annotationId) throws ApiError { - Request request = this.buildDeleteEnvelopeAnnotationRequest(envelopeId, annotationId); - this.execute(request); + public void deleteEnvelopeAnnotation(@NonNull String envelopeId, @NonNull String annotationId) + throws ApiError { + this.deleteEnvelopeAnnotation(envelopeId, annotationId, null); + } + + /** + * Delete envelope annotation + * + * @param envelopeId String ID of the envelope + * @param annotationId String ID of the annotation to delete + * @return response of {@code void} + */ + public void deleteEnvelopeAnnotation( + @NonNull String envelopeId, + @NonNull String annotationId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.deleteEnvelopeAnnotationConfig, requestConfig); + Request request = + this.buildDeleteEnvelopeAnnotationRequest(envelopeId, annotationId, resolvedConfig); + this.execute(request, resolvedConfig); } /** @@ -1251,17 +3055,39 @@ public CompletableFuture deleteEnvelopeAnnotationAsync( @NonNull String envelopeId, @NonNull String annotationId ) throws ApiError { - Request request = this.buildDeleteEnvelopeAnnotationRequest(envelopeId, annotationId); - return this.executeAsync(request).thenApplyAsync(response -> null); + return this.deleteEnvelopeAnnotationAsync(envelopeId, annotationId, null); + } + + /** + * Delete envelope annotation + * + * @param envelopeId String ID of the envelope + * @param annotationId String ID of the annotation to delete + * @return response of {@code CompletableFuture} + */ + public CompletableFuture deleteEnvelopeAnnotationAsync( + @NonNull String envelopeId, + @NonNull String annotationId, + RequestConfig requestConfig + ) throws ApiError { + RequestConfig resolvedConfig = + this.getResolvedConfig(this.deleteEnvelopeAnnotationConfig, requestConfig); + Request request = + this.buildDeleteEnvelopeAnnotationRequest(envelopeId, annotationId, resolvedConfig); + return this.executeAsync(request, resolvedConfig).thenApplyAsync(response -> null); } - private Request buildDeleteEnvelopeAnnotationRequest(@NonNull String envelopeId, @NonNull String annotationId) { + private Request buildDeleteEnvelopeAnnotationRequest( + @NonNull String envelopeId, + @NonNull String annotationId, + RequestConfig resolvedConfig + ) { return new RequestBuilder( HttpMethod.DELETE, - Optional.ofNullable(this.config.getBaseUrl()).orElse(Environment.DEFAULT.getUrl()), + resolveBaseUrl(resolvedConfig, Environment.DEFAULT), "envelope/{envelope_id}/annotation/{annotation_id}" ) - .setAccessTokenAuth(this.config.getAccessToken(), "Bearer") + .setAccessTokenAuth(resolveAccessToken(resolvedConfig), "Bearer") .setPathParameter("envelope_id", envelopeId) .setPathParameter("annotation_id", annotationId) .build(); @@ -1275,9 +3101,24 @@ private Request buildDeleteEnvelopeAnnotationRequest(@NonNull String envelopeId, */ public Template createTemplate(@NonNull CreateTemplateRequest createTemplateRequest) throws ApiError, ValidationException { - Request request = this.buildCreateTemplateRequest(createTemplateRequest); - Response response = this.execute(request); - return ModelConverter.convert(response, new TypeReference