From 3c5ae6d5e0c2ab0dba492faf7778253068dc3fbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:41:26 +0000 Subject: [PATCH 01/27] chore(internal): clean up maven repo artifact script and add html documentation to repo root --- scripts/upload-artifacts | 44 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index 729e6f22..df0c8d9f 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -7,6 +7,8 @@ GREEN='\033[32m' RED='\033[31m' NC='\033[0m' # No Color +MAVEN_REPO_PATH="./build/local-maven-repo" + log_error() { local msg="$1" local headers="$2" @@ -24,7 +26,7 @@ upload_file() { if [ -f "$file_name" ]; then echo -e "${GREEN}Processing file: $file_name${NC}" - pkg_file_name="mvn${file_name#./build/local-maven-repo}" + pkg_file_name="mvn${file_name#"${MAVEN_REPO_PATH}"}" # Get signed URL for uploading artifact file signed_url_response=$(curl -X POST -G "$URL" \ @@ -47,6 +49,7 @@ upload_file() { md5|sha1|sha256|sha512) content_type="text/plain" ;; module) content_type="application/json" ;; pom|xml) content_type="application/xml" ;; + html) content_type="text/html" ;; *) content_type="application/octet-stream" ;; esac @@ -81,6 +84,41 @@ walk_tree() { done } +generate_instructions() { + cat << EOF > "$MAVEN_REPO_PATH/index.html" + + + + Maven Repo + + +

Stainless SDK Maven Repository

+

This is the Maven repository for your Stainless Java SDK build.

+ +

Directions

+

To use the uploaded Maven repository, add the following to your project's pom.xml:

+
<repositories>
+    <repository>
+        <id>stainless-sdk-repo</id>
+        <url>https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn</url>
+    </repository>
+</repositories>
+ +

If you're using Gradle, add the following to your build.gradle file:

+
repositories {
+    maven {
+        url 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'
+    }
+}
+ + +EOF + upload_file "${MAVEN_REPO_PATH}/index.html" + + echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'" + echo "For more details, see the directions in https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn/index.html" +} + cd "$(dirname "$0")/.." echo "::group::Creating local Maven content" @@ -88,9 +126,9 @@ echo "::group::Creating local Maven content" echo "::endgroup::" echo "::group::Uploading to pkg.stainless.com" -walk_tree "./build/local-maven-repo" +walk_tree "$MAVEN_REPO_PATH" echo "::endgroup::" echo "::group::Generating instructions" -echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'" +generate_instructions echo "::endgroup::" From d97de31d7cf11c29ce6c8e7dc9ad475c4f2f6c61 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 06:11:30 +0000 Subject: [PATCH 02/27] chore: test on Jackson 2.14.0 to avoid encountering FasterXML/jackson-databind#3240 in tests fix: date time deserialization leniency --- README.md | 2 ++ modern-treasury-java-core/build.gradle.kts | 18 +++++----- .../moderntreasury/api/core/ObjectMappers.kt | 33 ++++++++++++------- .../api/core/ObjectMappersTest.kt | 16 +++------ .../build.gradle.kts | 2 +- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 280911d6..1144d66d 100644 --- a/README.md +++ b/README.md @@ -450,6 +450,8 @@ If the SDK threw an exception, but you're _certain_ the version is compatible, t > [!CAUTION] > We make no guarantee that the SDK works correctly when the Jackson version check is disabled. +Also note that there are bugs in older Jackson versions that can affect the SDK. We don't work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead. + ## Network options ### Retries diff --git a/modern-treasury-java-core/build.gradle.kts b/modern-treasury-java-core/build.gradle.kts index a9c96a7a..37cd91a2 100644 --- a/modern-treasury-java-core/build.gradle.kts +++ b/modern-treasury-java-core/build.gradle.kts @@ -5,14 +5,16 @@ plugins { configurations.all { resolutionStrategy { - // Compile and test against a lower Jackson version to ensure we're compatible with it. - // We publish with a higher version (see below) to ensure users depend on a secure version by default. - force("com.fasterxml.jackson.core:jackson-core:2.13.4") - force("com.fasterxml.jackson.core:jackson-databind:2.13.4") - force("com.fasterxml.jackson.core:jackson-annotations:2.13.4") - force("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.4") - force("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4") - force("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4") + // Compile and test against a lower Jackson version to ensure we're compatible with it. Note that + // we generally support 2.13.4, but test against 2.14.0 because 2.13.4 has some annoying (but + // niche) bugs (users should upgrade if they encounter them). We publish with a higher version + // (see below) to ensure users depend on a secure version by default. + force("com.fasterxml.jackson.core:jackson-core:2.14.0") + force("com.fasterxml.jackson.core:jackson-databind:2.14.0") + force("com.fasterxml.jackson.core:jackson-annotations:2.14.0") + force("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.0") + force("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.0") + force("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt index 11dd4805..d00792c2 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt @@ -24,6 +24,7 @@ import java.io.InputStream import java.time.DateTimeException import java.time.LocalDate import java.time.LocalDateTime +import java.time.OffsetDateTime import java.time.ZonedDateTime import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField @@ -36,7 +37,7 @@ fun jsonMapper(): JsonMapper = .addModule( SimpleModule() .addSerializer(InputStreamSerializer) - .addDeserializer(LocalDateTime::class.java, LenientLocalDateTimeDeserializer()) + .addDeserializer(OffsetDateTime::class.java, LenientOffsetDateTimeDeserializer()) ) .withCoercionConfig(LogicalType.Boolean) { it.setCoercion(CoercionInputShape.Integer, CoercionAction.Fail) @@ -64,6 +65,12 @@ fun jsonMapper(): JsonMapper = .setCoercion(CoercionInputShape.Array, CoercionAction.Fail) .setCoercion(CoercionInputShape.Object, CoercionAction.Fail) } + .withCoercionConfig(LogicalType.DateTime) { + it.setCoercion(CoercionInputShape.Integer, CoercionAction.Fail) + .setCoercion(CoercionInputShape.Float, CoercionAction.Fail) + .setCoercion(CoercionInputShape.Array, CoercionAction.Fail) + .setCoercion(CoercionInputShape.Object, CoercionAction.Fail) + } .withCoercionConfig(LogicalType.Array) { it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail) .setCoercion(CoercionInputShape.Integer, CoercionAction.Fail) @@ -124,10 +131,10 @@ private object InputStreamSerializer : BaseSerializer(InputStream:: } /** - * A deserializer that can deserialize [LocalDateTime] from datetimes, dates, and zoned datetimes. + * A deserializer that can deserialize [OffsetDateTime] from datetimes, dates, and zoned datetimes. */ -private class LenientLocalDateTimeDeserializer : - StdDeserializer(LocalDateTime::class.java) { +private class LenientOffsetDateTimeDeserializer : + StdDeserializer(OffsetDateTime::class.java) { companion object { @@ -141,7 +148,7 @@ private class LenientLocalDateTimeDeserializer : override fun logicalType(): LogicalType = LogicalType.DateTime - override fun deserialize(p: JsonParser, context: DeserializationContext?): LocalDateTime { + override fun deserialize(p: JsonParser, context: DeserializationContext): OffsetDateTime { val exceptions = mutableListOf() for (formatter in DATE_TIME_FORMATTERS) { @@ -149,18 +156,20 @@ private class LenientLocalDateTimeDeserializer : val temporal = formatter.parse(p.text) return when { - !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> - LocalDate.from(temporal).atStartOfDay() - !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> - LocalDateTime.from(temporal) - else -> ZonedDateTime.from(temporal).toLocalDateTime() - } + !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> + LocalDate.from(temporal).atStartOfDay() + !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> + LocalDateTime.from(temporal) + else -> ZonedDateTime.from(temporal).toLocalDateTime() + } + .atZone(context.timeZone.toZoneId()) + .toOffsetDateTime() } catch (e: DateTimeException) { exceptions.add(e) } } - throw JsonParseException(p, "Cannot parse `LocalDateTime` from value: ${p.text}").apply { + throw JsonParseException(p, "Cannot parse `OffsetDateTime` from value: ${p.text}").apply { exceptions.forEach { addSuppressed(it) } } } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt index 81297c87..d42b9312 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt @@ -3,7 +3,7 @@ package com.moderntreasury.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.readValue -import java.time.LocalDateTime +import java.time.OffsetDateTime import kotlin.reflect.KClass import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.catchThrowable @@ -58,14 +58,6 @@ internal class ObjectMappersTest { LONG to DOUBLE, LONG to INTEGER, CLASS to MAP, - // These aren't actually valid, but coercion configs don't work for String until - // v2.14.0: https://github.com/FasterXML/jackson-databind/issues/3240 - // We currently test on v2.13.4. - BOOLEAN to STRING, - FLOAT to STRING, - DOUBLE to STRING, - INTEGER to STRING, - LONG to STRING, ) } } @@ -84,7 +76,7 @@ internal class ObjectMappersTest { } } - enum class LenientLocalDateTimeTestCase(val string: String) { + enum class LenientOffsetDateTimeTestCase(val string: String) { DATE("1998-04-21"), DATE_TIME("1998-04-21T04:00:00"), ZONED_DATE_TIME_1("1998-04-21T04:00:00+03:00"), @@ -93,10 +85,10 @@ internal class ObjectMappersTest { @ParameterizedTest @EnumSource - fun readLocalDateTime_lenient(testCase: LenientLocalDateTimeTestCase) { + fun readOffsetDateTime_lenient(testCase: LenientOffsetDateTimeTestCase) { val jsonMapper = jsonMapper() val json = jsonMapper.writeValueAsString(testCase.string) - assertDoesNotThrow { jsonMapper().readValue(json) } + assertDoesNotThrow { jsonMapper().readValue(json) } } } diff --git a/modern-treasury-java-proguard-test/build.gradle.kts b/modern-treasury-java-proguard-test/build.gradle.kts index 9ed5c9bc..b5335010 100644 --- a/modern-treasury-java-proguard-test/build.gradle.kts +++ b/modern-treasury-java-proguard-test/build.gradle.kts @@ -19,7 +19,7 @@ dependencies { testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.assertj:assertj-core:3.25.3") - testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4") + testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } tasks.shadowJar { From 5a6e3fba0c4c9977132b8fafa656c43d6b44d1d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:07:36 +0000 Subject: [PATCH 03/27] chore(internal): improve maven repo docs --- scripts/upload-artifacts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index df0c8d9f..548d1527 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -56,12 +56,13 @@ upload_file() { # Upload file upload_response=$(curl -v -X PUT \ --retry 5 \ + --retry-all-errors \ -D "$tmp_headers" \ -H "Content-Type: $content_type" \ --data-binary "@${file_name}" "$signed_url" 2>&1) if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then - log_error "Failed upload artifact file" "$tmp_headers" "$upload_response" + log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response" fi # Insert small throttle to reduce rate limiting risk @@ -110,6 +111,10 @@ generate_instructions() { url 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn' } } + +

Once you've added the repository, you can include dependencies from it as usual. See your + project README + for more details.

EOF From 732590c941aaa40bd6881f8e2d073b8676e26433 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:21:57 +0000 Subject: [PATCH 04/27] fix(client): disallow coercion from float to int --- .../main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt | 1 + .../kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt index d00792c2..a3367e64 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt @@ -48,6 +48,7 @@ fun jsonMapper(): JsonMapper = } .withCoercionConfig(LogicalType.Integer) { it.setCoercion(CoercionInputShape.Boolean, CoercionAction.Fail) + .setCoercion(CoercionInputShape.Float, CoercionAction.Fail) .setCoercion(CoercionInputShape.String, CoercionAction.Fail) .setCoercion(CoercionInputShape.Array, CoercionAction.Fail) .setCoercion(CoercionInputShape.Object, CoercionAction.Fail) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt index d42b9312..7dc8380c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt @@ -46,11 +46,7 @@ internal class ObjectMappersTest { val VALID_CONVERSIONS = listOf( FLOAT to DOUBLE, - FLOAT to INTEGER, - FLOAT to LONG, DOUBLE to FLOAT, - DOUBLE to INTEGER, - DOUBLE to LONG, INTEGER to FLOAT, INTEGER to DOUBLE, INTEGER to LONG, From d17454de0303262f63b6a82f4b972fdb7d938580 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:29:05 +0000 Subject: [PATCH 05/27] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-sonatype.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e577bae..4bce98ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Java uses: actions/setup-java@v4 @@ -47,7 +47,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Java uses: actions/setup-java@v4 @@ -85,7 +85,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Java uses: actions/setup-java@v4 diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index 80f2d5e5..0130a8a1 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Java uses: actions/setup-java@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 5413d37d..46b4faac 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'Modern-Treasury/modern-treasury-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | From 74374754fa0114a61908280775d0f08112757b4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:15:51 +0000 Subject: [PATCH 06/27] fix(client): fully respect max retries fix(client): send retry count header for max retries 0 chore(internal): depend on packages directly in example --- .../api/client/okhttp/OkHttpClient.kt | 2 ++ .../api/core/http/RetryingHttpClient.kt | 20 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modern-treasury-java-client-okhttp/src/main/kotlin/com/moderntreasury/api/client/okhttp/OkHttpClient.kt b/modern-treasury-java-client-okhttp/src/main/kotlin/com/moderntreasury/api/client/okhttp/OkHttpClient.kt index 81900e96..4be73f7f 100644 --- a/modern-treasury-java-client-okhttp/src/main/kotlin/com/moderntreasury/api/client/okhttp/OkHttpClient.kt +++ b/modern-treasury-java-client-okhttp/src/main/kotlin/com/moderntreasury/api/client/okhttp/OkHttpClient.kt @@ -230,6 +230,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien fun build(): OkHttpClient = OkHttpClient( okhttp3.OkHttpClient.Builder() + // `RetryingHttpClient` handles retries if the user enabled them. + .retryOnConnectionFailure(false) .connectTimeout(timeout.connect()) .readTimeout(timeout.read()) .writeTimeout(timeout.write()) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/http/RetryingHttpClient.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/http/RetryingHttpClient.kt index 414b34c6..1b4632fe 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/http/RetryingHttpClient.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/http/RetryingHttpClient.kt @@ -31,10 +31,6 @@ private constructor( ) : HttpClient { override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { - if (!isRetryable(request) || maxRetries <= 0) { - return httpClient.execute(request, requestOptions) - } - var modifiedRequest = maybeAddIdempotencyHeader(request) // Don't send the current retry count in the headers if the caller set their own value. @@ -48,6 +44,10 @@ private constructor( modifiedRequest = setRetryCountHeader(modifiedRequest, retries) } + if (!isRetryable(modifiedRequest)) { + return httpClient.execute(modifiedRequest, requestOptions) + } + val response = try { val response = httpClient.execute(modifiedRequest, requestOptions) @@ -75,10 +75,6 @@ private constructor( request: HttpRequest, requestOptions: RequestOptions, ): CompletableFuture { - if (!isRetryable(request) || maxRetries <= 0) { - return httpClient.executeAsync(request, requestOptions) - } - val modifiedRequest = maybeAddIdempotencyHeader(request) // Don't send the current retry count in the headers if the caller set their own value. @@ -94,8 +90,12 @@ private constructor( val requestWithRetryCount = if (shouldSendRetryCount) setRetryCountHeader(request, retries) else request - return httpClient - .executeAsync(requestWithRetryCount, requestOptions) + val responseFuture = httpClient.executeAsync(requestWithRetryCount, requestOptions) + if (!isRetryable(requestWithRetryCount)) { + return responseFuture + } + + return responseFuture .handleAsync( fun( response: HttpResponse?, From 56fc0ac0d37400764c578cb70d63c17788f28280 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:38:49 +0000 Subject: [PATCH 07/27] chore(ci): upgrade `actions/setup-java` --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-sonatype.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bce98ef..428e6494 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v6 - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: | @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@v6 - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: | @@ -88,7 +88,7 @@ jobs: - uses: actions/checkout@v6 - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: | diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index 0130a8a1..5494db7b 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v6 - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: temurin java-version: | From 90d7c73431dbd1361d753d1933c050d82a7a8ff8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 18:23:38 +0000 Subject: [PATCH 08/27] feat(api): api update --- .stats.yml | 4 +- .../api/models/AccountDetail.kt | 6 + .../api/models/AccountDetailCreateParams.kt | 6 + .../api/models/BulkRequestCreateParams.kt | 16 + .../api/models/ChildLegalEntity.kt | 120 ++++- .../api/models/ChildLegalEntityCreate.kt | 64 ++- .../ConnectionLegalEntityCreateParams.kt | 67 ++- .../api/models/CounterpartyCreateParams.kt | 73 ++- .../api/models/ExternalAccountCreateParams.kt | 6 + .../api/models/IncomingPaymentDetail.kt | 6 + .../moderntreasury/api/models/LegalEntity.kt | 120 ++++- .../api/models/LegalEntityCreateParams.kt | 111 +++- .../api/models/LegalEntityUpdateParams.kt | 12 +- .../models/PaymentOrderCreateAsyncParams.kt | 14 + .../api/models/PaymentOrderCreateParams.kt | 14 + .../api/models/PaymentOrderUpdateParams.kt | 6 + .../api/models/VirtualAccountCreateParams.kt | 6 + .../api/models/ChildLegalEntityCreateTest.kt | 3 + .../api/models/ChildLegalEntityTest.kt | 491 ++++++++++++++++++ .../ConnectionLegalEntityCreateParamsTest.kt | 6 + .../models/CounterpartyCreateParamsTest.kt | 6 + .../LegalEntityAssociationCreateParamsTest.kt | 3 + .../LegalEntityAssociationInlineCreateTest.kt | 3 + .../api/models/LegalEntityAssociationTest.kt | 224 ++++++++ .../api/models/LegalEntityCreateParamsTest.kt | 6 + .../api/models/LegalEntityTest.kt | 491 ++++++++++++++++++ .../api/services/ServiceParamsTest.kt | 2 + .../ConnectionLegalEntityServiceAsyncTest.kt | 2 + .../async/CounterpartyServiceAsyncTest.kt | 2 + .../LegalEntityAssociationServiceAsyncTest.kt | 1 + .../async/LegalEntityServiceAsyncTest.kt | 2 + .../ConnectionLegalEntityServiceTest.kt | 2 + .../blocking/CounterpartyServiceTest.kt | 2 + .../LegalEntityAssociationServiceTest.kt | 1 + .../blocking/LegalEntityServiceTest.kt | 2 + 35 files changed, 1858 insertions(+), 42 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b16fcb8..619477e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-b70193f02d90e71e996b5cf45038db80fe123344267e22207026f755e3198f56.yml -openapi_spec_hash: 289fdda5739de528fa149e924511e428 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e15a21ef6628dcc5510621b680a6373e71c53d5d36e89ca191a8223a94298be2.yml +openapi_spec_hash: e49d45dc10032cea0ee381f1ed002dc8 config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetail.kt index ca09c340..9e6f2fa0 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetail.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetail.kt @@ -514,6 +514,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -545,6 +547,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -571,6 +574,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -601,6 +605,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -629,6 +634,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetailCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetailCreateParams.kt index 88c1e8cf..4b41e4e0 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetailCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/AccountDetailCreateParams.kt @@ -555,6 +555,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -586,6 +588,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -612,6 +615,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -642,6 +646,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -670,6 +675,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt index 4405522a..9eaae8e6 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt @@ -2178,6 +2178,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = transactionMonitoringEnabled.getOptional("transaction_monitoring_enabled") @@ -2529,6 +2530,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the JSON field * has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("transaction_monitoring_enabled") @ExcludeMissing fun _transactionMonitoringEnabled(): JsonField = transactionMonitoringEnabled @@ -3352,6 +3354,7 @@ private constructor( * A flag that determines whether a payment order should go through transaction * monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = transactionMonitoringEnabled(JsonField.of(transactionMonitoringEnabled)) @@ -3362,6 +3365,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: JsonField) = apply { this.transactionMonitoringEnabled = transactionMonitoringEnabled @@ -6056,6 +6060,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -6088,6 +6094,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6116,6 +6123,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6146,6 +6154,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -6174,6 +6183,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER @@ -15659,6 +15669,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -15691,6 +15703,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -15719,6 +15732,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -15749,6 +15763,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -15777,6 +15792,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt index 825462fc..ad0bd74e 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt @@ -37,6 +37,7 @@ private constructor( private val dateFormed: JsonField, private val dateOfBirth: JsonField, private val discardedAt: JsonField, + private val documents: JsonField>, private val doingBusinessAsNames: JsonField>, private val email: JsonField, private val expectedActivityVolume: JsonField, @@ -102,6 +103,9 @@ private constructor( @JsonProperty("discarded_at") @ExcludeMissing discardedAt: JsonField = JsonMissing.of(), + @JsonProperty("documents") + @ExcludeMissing + documents: JsonField> = JsonMissing.of(), @JsonProperty("doing_business_as_names") @ExcludeMissing doingBusinessAsNames: JsonField> = JsonMissing.of(), @@ -176,6 +180,7 @@ private constructor( dateFormed, dateOfBirth, discardedAt, + documents, doingBusinessAsNames, email, expectedActivityVolume, @@ -296,6 +301,12 @@ private constructor( */ fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") + /** + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun documents(): List = documents.getRequired("documents") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -312,7 +323,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -613,6 +624,15 @@ private constructor( @ExcludeMissing fun _discardedAt(): JsonField = discardedAt + /** + * Returns the raw JSON value of [documents]. + * + * Unlike [documents], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("documents") + @ExcludeMissing + fun _documents(): JsonField> = documents + /** * Returns the raw JSON value of [doingBusinessAsNames]. * @@ -869,6 +889,7 @@ private constructor( * .dateFormed() * .dateOfBirth() * .discardedAt() + * .documents() * .doingBusinessAsNames() * .email() * .expectedActivityVolume() @@ -915,6 +936,7 @@ private constructor( private var dateFormed: JsonField? = null private var dateOfBirth: JsonField? = null private var discardedAt: JsonField? = null + private var documents: JsonField>? = null private var doingBusinessAsNames: JsonField>? = null private var email: JsonField? = null private var expectedActivityVolume: JsonField? = null @@ -959,6 +981,7 @@ private constructor( dateFormed = childLegalEntity.dateFormed dateOfBirth = childLegalEntity.dateOfBirth discardedAt = childLegalEntity.discardedAt + documents = childLegalEntity.documents.map { it.toMutableList() } doingBusinessAsNames = childLegalEntity.doingBusinessAsNames.map { it.toMutableList() } email = childLegalEntity.email expectedActivityVolume = childLegalEntity.expectedActivityVolume @@ -1209,6 +1232,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + fun doingBusinessAsNames(doingBusinessAsNames: List) = doingBusinessAsNames(JsonField.of(doingBusinessAsNames)) @@ -1249,7 +1297,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -1765,6 +1813,7 @@ private constructor( * .dateFormed() * .dateOfBirth() * .discardedAt() + * .documents() * .doingBusinessAsNames() * .email() * .expectedActivityVolume() @@ -1809,6 +1858,7 @@ private constructor( checkRequired("dateFormed", dateFormed), checkRequired("dateOfBirth", dateOfBirth), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("doingBusinessAsNames", doingBusinessAsNames).map { it.toImmutable() }, @@ -1868,6 +1918,7 @@ private constructor( dateFormed() dateOfBirth() discardedAt() + documents().forEach { it.validate() } doingBusinessAsNames() email() expectedActivityVolume() @@ -1924,6 +1975,7 @@ private constructor( (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + (if (discardedAt.asKnown().isPresent) 1 else 0) + + (documents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (doingBusinessAsNames.asKnown().getOrNull()?.size ?: 0) + (if (email.asKnown().isPresent) 1 else 0) + (if (expectedActivityVolume.asKnown().isPresent) 1 else 0) + @@ -3424,6 +3476,7 @@ private constructor( private val id: JsonField, private val createdAt: JsonField, private val discardedAt: JsonField, + private val documents: JsonField>, private val expirationDate: JsonField, private val idType: JsonField, private val issuingCountry: JsonField, @@ -3443,6 +3496,9 @@ private constructor( @JsonProperty("discarded_at") @ExcludeMissing discardedAt: JsonField = JsonMissing.of(), + @JsonProperty("documents") + @ExcludeMissing + documents: JsonField> = JsonMissing.of(), @JsonProperty("expiration_date") @ExcludeMissing expirationDate: JsonField = JsonMissing.of(), @@ -3464,6 +3520,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -3492,6 +3549,12 @@ private constructor( */ fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") + /** + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun documents(): List = documents.getRequired("documents") + /** * The date when the Identification is no longer considered valid by the issuing authority. * @@ -3570,6 +3633,15 @@ private constructor( @ExcludeMissing fun _discardedAt(): JsonField = discardedAt + /** + * Returns the raw JSON value of [documents]. + * + * Unlike [documents], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("documents") + @ExcludeMissing + fun _documents(): JsonField> = documents + /** * Returns the raw JSON value of [expirationDate]. * @@ -3652,6 +3724,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3670,6 +3743,7 @@ private constructor( private var id: JsonField? = null private var createdAt: JsonField? = null private var discardedAt: JsonField? = null + private var documents: JsonField>? = null private var expirationDate: JsonField? = null private var idType: JsonField? = null private var issuingCountry: JsonField? = null @@ -3684,6 +3758,7 @@ private constructor( id = identification.id createdAt = identification.createdAt discardedAt = identification.discardedAt + documents = identification.documents.map { it.toMutableList() } expirationDate = identification.expirationDate idType = identification.idType issuingCountry = identification.issuingCountry @@ -3736,6 +3811,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + /** * The date when the Identification is no longer considered valid by the issuing * authority. @@ -3876,6 +3976,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3892,6 +3993,7 @@ private constructor( checkRequired("id", id), checkRequired("createdAt", createdAt), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("expirationDate", expirationDate), checkRequired("idType", idType), checkRequired("issuingCountry", issuingCountry), @@ -3913,6 +4015,7 @@ private constructor( id() createdAt() discardedAt() + documents().forEach { it.validate() } expirationDate() idType().validate() issuingCountry() @@ -3942,6 +4045,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (discardedAt.asKnown().isPresent) 1 else 0) + + (documents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (expirationDate.asKnown().isPresent) 1 else 0) + (idType.asKnown().getOrNull()?.validity() ?: 0) + (if (issuingCountry.asKnown().isPresent) 1 else 0) + @@ -4209,6 +4313,7 @@ private constructor( id == other.id && createdAt == other.createdAt && discardedAt == other.discardedAt && + documents == other.documents && expirationDate == other.expirationDate && idType == other.idType && issuingCountry == other.issuingCountry && @@ -4224,6 +4329,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -4238,7 +4344,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Identification{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, expirationDate=$expirationDate, idType=$idType, issuingCountry=$issuingCountry, issuingRegion=$issuingRegion, liveMode=$liveMode, object_=$object_, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "Identification{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, documents=$documents, expirationDate=$expirationDate, idType=$idType, issuingCountry=$issuingCountry, issuingRegion=$issuingRegion, liveMode=$liveMode, object_=$object_, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -5021,7 +5127,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -5416,7 +5522,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** @@ -7156,6 +7262,7 @@ private constructor( dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && discardedAt == other.discardedAt && + documents == other.documents && doingBusinessAsNames == other.doingBusinessAsNames && email == other.email && expectedActivityVolume == other.expectedActivityVolume && @@ -7199,6 +7306,7 @@ private constructor( dateFormed, dateOfBirth, discardedAt, + documents, doingBusinessAsNames, email, expectedActivityVolume, @@ -7232,5 +7340,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt index a5f12ab3..09979c9d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt @@ -31,6 +31,7 @@ private constructor( private val businessName: JsonField, private val citizenshipCountry: JsonField, private val complianceDetails: JsonField, + private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -80,6 +81,9 @@ private constructor( @JsonProperty("compliance_details") @ExcludeMissing complianceDetails: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + connectionId: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -153,6 +157,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -230,6 +235,17 @@ private constructor( fun complianceDetails(): Optional = complianceDetails.getOptional("compliance_details") + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the id + * of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun connectionId(): Optional = connectionId.getOptional("connection_id") + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -272,7 +288,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -501,6 +517,15 @@ private constructor( @ExcludeMissing fun _complianceDetails(): JsonField = complianceDetails + /** + * Returns the raw JSON value of [connectionId]. + * + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("connection_id") + @ExcludeMissing + fun _connectionId(): JsonField = connectionId + /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -758,6 +783,7 @@ private constructor( private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -799,6 +825,7 @@ private constructor( businessName = childLegalEntityCreate.businessName citizenshipCountry = childLegalEntityCreate.citizenshipCountry complianceDetails = childLegalEntityCreate.complianceDetails + connectionId = childLegalEntityCreate.connectionId countryOfIncorporation = childLegalEntityCreate.countryOfIncorporation dateFormed = childLegalEntityCreate.dateFormed dateOfBirth = childLegalEntityCreate.dateOfBirth @@ -955,6 +982,28 @@ private constructor( this.complianceDetails = complianceDetails } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = connectionId(connectionId.getOrNull()) + + /** + * Sets [Builder.connectionId] to an arbitrary JSON value. + * + * You should usually call [Builder.connectionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -1052,7 +1101,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -1528,6 +1577,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1571,6 +1621,7 @@ private constructor( businessName() citizenshipCountry() complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -1621,6 +1672,7 @@ private constructor( (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -3051,7 +3103,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3446,7 +3498,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** @@ -5180,6 +5232,7 @@ private constructor( businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -5217,6 +5270,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5250,5 +5304,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt index 8b76ecd3..863ab3a8 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt @@ -582,6 +582,7 @@ private constructor( private val businessName: JsonField, private val citizenshipCountry: JsonField, private val complianceDetails: JsonField, + private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -631,6 +632,9 @@ private constructor( @JsonProperty("compliance_details") @ExcludeMissing complianceDetails: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + connectionId: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -711,6 +715,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -789,6 +794,17 @@ private constructor( fun complianceDetails(): Optional = complianceDetails.getOptional("compliance_details") + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun connectionId(): Optional = connectionId.getOptional("connection_id") + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -831,7 +847,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1063,6 +1079,16 @@ private constructor( @ExcludeMissing fun _complianceDetails(): JsonField = complianceDetails + /** + * Returns the raw JSON value of [connectionId]. + * + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("connection_id") + @ExcludeMissing + fun _connectionId(): JsonField = connectionId + /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -1327,6 +1353,7 @@ private constructor( private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -1368,6 +1395,7 @@ private constructor( businessName = legalEntity.businessName citizenshipCountry = legalEntity.citizenshipCountry complianceDetails = legalEntity.complianceDetails + connectionId = legalEntity.connectionId countryOfIncorporation = legalEntity.countryOfIncorporation dateFormed = legalEntity.dateFormed dateOfBirth = legalEntity.dateOfBirth @@ -1530,6 +1558,30 @@ private constructor( this.complianceDetails = complianceDetails } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) + + /** + * Sets [Builder.connectionId] to an arbitrary JSON value. + * + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or * alpha-3 formats. @@ -1631,7 +1683,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -2121,6 +2173,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2164,6 +2217,7 @@ private constructor( businessName() citizenshipCountry() complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -2215,6 +2269,7 @@ private constructor( (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -3689,7 +3744,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). @@ -4101,7 +4156,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) @@ -5863,6 +5918,7 @@ private constructor( businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -5900,6 +5956,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5933,7 +5990,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt index 5ed06437..69d70472 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt @@ -2461,6 +2461,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -2492,6 +2494,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -2520,6 +2523,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -2550,6 +2554,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -2578,6 +2583,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER @@ -3941,6 +3947,7 @@ private constructor( private val businessName: JsonField, private val citizenshipCountry: JsonField, private val complianceDetails: JsonField, + private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -3992,6 +3999,9 @@ private constructor( @JsonProperty("compliance_details") @ExcludeMissing complianceDetails: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + connectionId: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -4070,6 +4080,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -4155,6 +4166,17 @@ private constructor( fun complianceDetails(): Optional = complianceDetails.getOptional("compliance_details") + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun connectionId(): Optional = connectionId.getOptional("connection_id") + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -4197,7 +4219,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4430,6 +4452,16 @@ private constructor( @ExcludeMissing fun _complianceDetails(): JsonField = complianceDetails + /** + * Returns the raw JSON value of [connectionId]. + * + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("connection_id") + @ExcludeMissing + fun _connectionId(): JsonField = connectionId + /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -4692,6 +4724,7 @@ private constructor( private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -4733,6 +4766,7 @@ private constructor( businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry complianceDetails = legalEntityCreateRequest.complianceDetails + connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed dateOfBirth = legalEntityCreateRequest.dateOfBirth @@ -4911,6 +4945,30 @@ private constructor( this.complianceDetails = complianceDetails } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) + + /** + * Sets [Builder.connectionId] to an arbitrary JSON value. + * + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or * alpha-3 formats. @@ -5012,7 +5070,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -5495,6 +5553,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5538,6 +5597,7 @@ private constructor( businessName() citizenshipCountry() complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -5589,6 +5649,7 @@ private constructor( (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -7062,7 +7123,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). @@ -7474,7 +7535,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) @@ -9237,6 +9298,7 @@ private constructor( businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -9274,6 +9336,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -9306,7 +9369,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt index cabc5c6e..425b89d7 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt @@ -1684,6 +1684,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1715,6 +1717,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1742,6 +1745,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1772,6 +1776,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1800,6 +1805,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt index 3f913d09..e422d37e 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt @@ -1496,6 +1496,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1527,6 +1529,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1555,6 +1558,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1585,6 +1589,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1613,6 +1618,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt index a088d666..34f67891 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt @@ -37,6 +37,7 @@ private constructor( private val dateFormed: JsonField, private val dateOfBirth: JsonField, private val discardedAt: JsonField, + private val documents: JsonField>, private val doingBusinessAsNames: JsonField>, private val email: JsonField, private val expectedActivityVolume: JsonField, @@ -102,6 +103,9 @@ private constructor( @JsonProperty("discarded_at") @ExcludeMissing discardedAt: JsonField = JsonMissing.of(), + @JsonProperty("documents") + @ExcludeMissing + documents: JsonField> = JsonMissing.of(), @JsonProperty("doing_business_as_names") @ExcludeMissing doingBusinessAsNames: JsonField> = JsonMissing.of(), @@ -176,6 +180,7 @@ private constructor( dateFormed, dateOfBirth, discardedAt, + documents, doingBusinessAsNames, email, expectedActivityVolume, @@ -296,6 +301,12 @@ private constructor( */ fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") + /** + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun documents(): List = documents.getRequired("documents") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -312,7 +323,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -613,6 +624,15 @@ private constructor( @ExcludeMissing fun _discardedAt(): JsonField = discardedAt + /** + * Returns the raw JSON value of [documents]. + * + * Unlike [documents], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("documents") + @ExcludeMissing + fun _documents(): JsonField> = documents + /** * Returns the raw JSON value of [doingBusinessAsNames]. * @@ -869,6 +889,7 @@ private constructor( * .dateFormed() * .dateOfBirth() * .discardedAt() + * .documents() * .doingBusinessAsNames() * .email() * .expectedActivityVolume() @@ -914,6 +935,7 @@ private constructor( private var dateFormed: JsonField? = null private var dateOfBirth: JsonField? = null private var discardedAt: JsonField? = null + private var documents: JsonField>? = null private var doingBusinessAsNames: JsonField>? = null private var email: JsonField? = null private var expectedActivityVolume: JsonField? = null @@ -958,6 +980,7 @@ private constructor( dateFormed = legalEntity.dateFormed dateOfBirth = legalEntity.dateOfBirth discardedAt = legalEntity.discardedAt + documents = legalEntity.documents.map { it.toMutableList() } doingBusinessAsNames = legalEntity.doingBusinessAsNames.map { it.toMutableList() } email = legalEntity.email expectedActivityVolume = legalEntity.expectedActivityVolume @@ -1204,6 +1227,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + fun doingBusinessAsNames(doingBusinessAsNames: List) = doingBusinessAsNames(JsonField.of(doingBusinessAsNames)) @@ -1244,7 +1292,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -1760,6 +1808,7 @@ private constructor( * .dateFormed() * .dateOfBirth() * .discardedAt() + * .documents() * .doingBusinessAsNames() * .email() * .expectedActivityVolume() @@ -1803,6 +1852,7 @@ private constructor( checkRequired("dateFormed", dateFormed), checkRequired("dateOfBirth", dateOfBirth), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("doingBusinessAsNames", doingBusinessAsNames).map { it.toImmutable() }, @@ -1860,6 +1910,7 @@ private constructor( dateFormed() dateOfBirth() discardedAt() + documents().forEach { it.validate() } doingBusinessAsNames() email() expectedActivityVolume() @@ -1916,6 +1967,7 @@ private constructor( (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + (if (discardedAt.asKnown().isPresent) 1 else 0) + + (documents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (doingBusinessAsNames.asKnown().getOrNull()?.size ?: 0) + (if (email.asKnown().isPresent) 1 else 0) + (if (expectedActivityVolume.asKnown().isPresent) 1 else 0) + @@ -3416,6 +3468,7 @@ private constructor( private val id: JsonField, private val createdAt: JsonField, private val discardedAt: JsonField, + private val documents: JsonField>, private val expirationDate: JsonField, private val idType: JsonField, private val issuingCountry: JsonField, @@ -3435,6 +3488,9 @@ private constructor( @JsonProperty("discarded_at") @ExcludeMissing discardedAt: JsonField = JsonMissing.of(), + @JsonProperty("documents") + @ExcludeMissing + documents: JsonField> = JsonMissing.of(), @JsonProperty("expiration_date") @ExcludeMissing expirationDate: JsonField = JsonMissing.of(), @@ -3456,6 +3512,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -3484,6 +3541,12 @@ private constructor( */ fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") + /** + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun documents(): List = documents.getRequired("documents") + /** * The date when the Identification is no longer considered valid by the issuing authority. * @@ -3562,6 +3625,15 @@ private constructor( @ExcludeMissing fun _discardedAt(): JsonField = discardedAt + /** + * Returns the raw JSON value of [documents]. + * + * Unlike [documents], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("documents") + @ExcludeMissing + fun _documents(): JsonField> = documents + /** * Returns the raw JSON value of [expirationDate]. * @@ -3644,6 +3716,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3662,6 +3735,7 @@ private constructor( private var id: JsonField? = null private var createdAt: JsonField? = null private var discardedAt: JsonField? = null + private var documents: JsonField>? = null private var expirationDate: JsonField? = null private var idType: JsonField? = null private var issuingCountry: JsonField? = null @@ -3676,6 +3750,7 @@ private constructor( id = identification.id createdAt = identification.createdAt discardedAt = identification.discardedAt + documents = identification.documents.map { it.toMutableList() } expirationDate = identification.expirationDate idType = identification.idType issuingCountry = identification.issuingCountry @@ -3728,6 +3803,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + /** * The date when the Identification is no longer considered valid by the issuing * authority. @@ -3868,6 +3968,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3884,6 +3985,7 @@ private constructor( checkRequired("id", id), checkRequired("createdAt", createdAt), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("expirationDate", expirationDate), checkRequired("idType", idType), checkRequired("issuingCountry", issuingCountry), @@ -3905,6 +4007,7 @@ private constructor( id() createdAt() discardedAt() + documents().forEach { it.validate() } expirationDate() idType().validate() issuingCountry() @@ -3934,6 +4037,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (discardedAt.asKnown().isPresent) 1 else 0) + + (documents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (expirationDate.asKnown().isPresent) 1 else 0) + (idType.asKnown().getOrNull()?.validity() ?: 0) + (if (issuingCountry.asKnown().isPresent) 1 else 0) + @@ -4201,6 +4305,7 @@ private constructor( id == other.id && createdAt == other.createdAt && discardedAt == other.discardedAt && + documents == other.documents && expirationDate == other.expirationDate && idType == other.idType && issuingCountry == other.issuingCountry && @@ -4216,6 +4321,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -4230,7 +4336,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Identification{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, expirationDate=$expirationDate, idType=$idType, issuingCountry=$issuingCountry, issuingRegion=$issuingRegion, liveMode=$liveMode, object_=$object_, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "Identification{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, documents=$documents, expirationDate=$expirationDate, idType=$idType, issuingCountry=$issuingCountry, issuingRegion=$issuingRegion, liveMode=$liveMode, object_=$object_, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -5013,7 +5119,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -5408,7 +5514,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** @@ -7148,6 +7254,7 @@ private constructor( dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && discardedAt == other.discardedAt && + documents == other.documents && doingBusinessAsNames == other.doingBusinessAsNames && email == other.email && expectedActivityVolume == other.expectedActivityVolume && @@ -7191,6 +7298,7 @@ private constructor( dateFormed, dateOfBirth, discardedAt, + documents, doingBusinessAsNames, email, expectedActivityVolume, @@ -7224,5 +7332,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" + "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt index 4eaa8809..fd2b2c73 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt @@ -85,6 +85,17 @@ private constructor( */ fun complianceDetails(): Optional = body.complianceDetails() + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the id + * of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun connectionId(): Optional = body.connectionId() + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -125,7 +136,7 @@ private constructor( fun email(): Optional = body.email() /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -335,6 +346,13 @@ private constructor( */ fun _complianceDetails(): JsonField = body._complianceDetails() + /** + * Returns the raw JSON value of [connectionId]. + * + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _connectionId(): JsonField = body._connectionId() + /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -713,6 +731,28 @@ private constructor( body.complianceDetails(complianceDetails) } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = apply { body.connectionId(connectionId) } + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = connectionId(connectionId.getOrNull()) + + /** + * Sets [Builder.connectionId] to an arbitrary JSON value. + * + * You should usually call [Builder.connectionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun connectionId(connectionId: JsonField) = apply { + body.connectionId(connectionId) + } + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -807,7 +847,7 @@ private constructor( */ fun email(email: JsonField) = apply { body.email(email) } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = apply { body.expectedActivityVolume(expectedActivityVolume) } @@ -1372,6 +1412,7 @@ private constructor( private val businessName: JsonField, private val citizenshipCountry: JsonField, private val complianceDetails: JsonField, + private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -1423,6 +1464,9 @@ private constructor( @JsonProperty("compliance_details") @ExcludeMissing complianceDetails: JsonField = JsonMissing.of(), + @JsonProperty("connection_id") + @ExcludeMissing + connectionId: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -1501,6 +1545,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1586,6 +1631,17 @@ private constructor( fun complianceDetails(): Optional = complianceDetails.getOptional("compliance_details") + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun connectionId(): Optional = connectionId.getOptional("connection_id") + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -1628,7 +1684,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1861,6 +1917,16 @@ private constructor( @ExcludeMissing fun _complianceDetails(): JsonField = complianceDetails + /** + * Returns the raw JSON value of [connectionId]. + * + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("connection_id") + @ExcludeMissing + fun _connectionId(): JsonField = connectionId + /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -2123,6 +2189,7 @@ private constructor( private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -2164,6 +2231,7 @@ private constructor( businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry complianceDetails = legalEntityCreateRequest.complianceDetails + connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed dateOfBirth = legalEntityCreateRequest.dateOfBirth @@ -2342,6 +2410,30 @@ private constructor( this.complianceDetails = complianceDetails } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) + + /** + * Sets [Builder.connectionId] to an arbitrary JSON value. + * + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } + /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or * alpha-3 formats. @@ -2443,7 +2535,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -2926,6 +3018,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2969,6 +3062,7 @@ private constructor( businessName() citizenshipCountry() complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -3020,6 +3114,7 @@ private constructor( (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -3061,6 +3156,7 @@ private constructor( businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -3098,6 +3194,7 @@ private constructor( businessName, citizenshipCountry, complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -3130,7 +3227,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -4536,7 +4633,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4931,7 +5028,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt index 2450096f..dd67c517 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt @@ -120,7 +120,7 @@ private constructor( fun email(): Optional = body.email() /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -763,7 +763,7 @@ private constructor( */ fun email(email: JsonField) = apply { body.email(email) } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = apply { body.expectedActivityVolume(expectedActivityVolume) } @@ -1531,7 +1531,7 @@ private constructor( fun email(): Optional = email.getOptional("email") /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -2289,7 +2289,7 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = expectedActivityVolume(JsonField.ofNullable(expectedActivityVolume)) @@ -4192,7 +4192,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4587,7 +4587,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt index 2454237e..0e5b844a 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt @@ -329,6 +329,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = body.transactionMonitoringEnabled() /** @@ -605,6 +606,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") fun _transactionMonitoringEnabled(): JsonField = body._transactionMonitoringEnabled() /** @@ -1329,6 +1331,7 @@ private constructor( /** * A flag that determines whether a payment order should go through transaction monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -1340,6 +1343,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: JsonField) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -2087,6 +2091,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = transactionMonitoringEnabled.getOptional("transaction_monitoring_enabled") @@ -2422,6 +2427,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") @JsonProperty("transaction_monitoring_enabled") @ExcludeMissing fun _transactionMonitoringEnabled(): JsonField = transactionMonitoringEnabled @@ -3228,6 +3234,7 @@ private constructor( * A flag that determines whether a payment order should go through transaction * monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = transactionMonitoringEnabled(JsonField.of(transactionMonitoringEnabled)) @@ -3238,6 +3245,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: JsonField) = apply { this.transactionMonitoringEnabled = transactionMonitoringEnabled @@ -5907,6 +5915,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -5938,6 +5948,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5966,6 +5977,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5996,6 +6008,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -6024,6 +6037,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt index 1f6c91f1..a2e1e267 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt @@ -342,6 +342,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = body.transactionMonitoringEnabled() /** @@ -632,6 +633,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the multipart field has * an unexpected type. */ + @Deprecated("deprecated") fun _transactionMonitoringEnabled(): MultipartField = body._transactionMonitoringEnabled() @@ -1387,6 +1389,7 @@ private constructor( /** * A flag that determines whether a payment order should go through transaction monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -1398,6 +1401,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: MultipartField) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) @@ -2051,6 +2055,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = transactionMonitoringEnabled.value.getOptional("transaction_monitoring_enabled") @@ -2416,6 +2421,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the multipart field * has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("transaction_monitoring_enabled") @ExcludeMissing fun _transactionMonitoringEnabled(): MultipartField = transactionMonitoringEnabled @@ -3269,6 +3275,7 @@ private constructor( * A flag that determines whether a payment order should go through transaction * monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = transactionMonitoringEnabled(MultipartField.of(transactionMonitoringEnabled)) @@ -3279,6 +3286,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled( transactionMonitoringEnabled: MultipartField ) = apply { this.transactionMonitoringEnabled = transactionMonitoringEnabled } @@ -6219,6 +6227,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -6250,6 +6260,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6278,6 +6289,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6308,6 +6320,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -6336,6 +6349,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt index 2bd0708f..9a924676 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt @@ -5815,6 +5815,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -5846,6 +5848,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5874,6 +5877,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5904,6 +5908,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -5932,6 +5937,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt index 5bdb4231..dea21cf7 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt @@ -1405,6 +1405,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1436,6 +1438,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1463,6 +1466,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1493,6 +1497,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1521,6 +1526,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt index a5dd1e9b..ac348e2f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt @@ -61,6 +61,7 @@ internal class ChildLegalEntityCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -214,6 +215,7 @@ internal class ChildLegalEntityCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + assertThat(childLegalEntityCreate.connectionId()).contains("connection_id") assertThat(childLegalEntityCreate.countryOfIncorporation()) .contains("country_of_incorporation") assertThat(childLegalEntityCreate.dateFormed()).contains(LocalDate.parse("2019-12-27")) @@ -378,6 +380,7 @@ internal class ChildLegalEntityCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt index a8ce1032..908e73cb 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt @@ -73,6 +73,39 @@ internal class ChildLegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -82,6 +115,41 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -182,6 +250,47 @@ internal class ChildLegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -193,6 +302,63 @@ internal class ChildLegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -435,6 +601,40 @@ internal class ChildLegalEntityTest { assertThat(childLegalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) assertThat(childLegalEntity.discardedAt()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(childLegalEntity.documents()) + .containsExactly( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) assertThat(childLegalEntity.doingBusinessAsNames()).containsExactly("string") assertThat(childLegalEntity.email()).contains("email") assertThat(childLegalEntity.expectedActivityVolume()).contains(0L) @@ -445,6 +645,39 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -535,6 +768,45 @@ internal class ChildLegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -544,6 +816,59 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -783,6 +1108,39 @@ internal class ChildLegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -792,6 +1150,41 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -892,6 +1285,47 @@ internal class ChildLegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -903,6 +1337,63 @@ internal class ChildLegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt index 1441c236..fd1b2cc0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt @@ -61,6 +61,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -165,6 +166,7 @@ internal class ConnectionLegalEntityCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -442,6 +444,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -547,6 +550,7 @@ internal class ConnectionLegalEntityCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -824,6 +828,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -928,6 +933,7 @@ internal class ConnectionLegalEntityCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index 04b1203d..7f4912da 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -149,6 +149,7 @@ internal class CounterpartyCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -253,6 +254,7 @@ internal class CounterpartyCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -628,6 +630,7 @@ internal class CounterpartyCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -733,6 +736,7 @@ internal class CounterpartyCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -1109,6 +1113,7 @@ internal class CounterpartyCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -1213,6 +1218,7 @@ internal class CounterpartyCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt index 84a80efb..60550049 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt @@ -63,6 +63,7 @@ internal class LegalEntityAssociationCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -237,6 +238,7 @@ internal class LegalEntityAssociationCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -408,6 +410,7 @@ internal class LegalEntityAssociationCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt index cf120291..a908f50c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt @@ -67,6 +67,7 @@ internal class LegalEntityAssociationInlineCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -225,6 +226,7 @@ internal class LegalEntityAssociationInlineCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -389,6 +391,7 @@ internal class LegalEntityAssociationInlineCreateTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt index 6ec39fd0..a9b71fd1 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt @@ -77,6 +77,41 @@ internal class LegalEntityAssociationTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -86,6 +121,47 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -254,6 +330,39 @@ internal class LegalEntityAssociationTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -263,6 +372,45 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -436,6 +584,41 @@ internal class LegalEntityAssociationTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -445,6 +628,47 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt index c4a9c31d..516a02b6 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt @@ -59,6 +59,7 @@ internal class LegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -144,6 +145,7 @@ internal class LegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -365,6 +367,7 @@ internal class LegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -460,6 +463,7 @@ internal class LegalEntityCreateParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -691,6 +695,7 @@ internal class LegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + assertThat(body.connectionId()).contains("connection_id") assertThat(body.countryOfIncorporation()).contains("country_of_incorporation") assertThat(body.dateFormed()).contains(LocalDate.parse("2019-12-27")) assertThat(body.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) @@ -779,6 +784,7 @@ internal class LegalEntityCreateParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt index 8ad3d0bd..4b808df6 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt @@ -73,6 +73,39 @@ internal class LegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -82,6 +115,41 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -239,6 +307,47 @@ internal class LegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -250,6 +359,63 @@ internal class LegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -431,6 +597,40 @@ internal class LegalEntityTest { assertThat(legalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) assertThat(legalEntity.discardedAt()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(legalEntity.documents()) + .containsExactly( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) assertThat(legalEntity.doingBusinessAsNames()).containsExactly("string") assertThat(legalEntity.email()).contains("email") assertThat(legalEntity.expectedActivityVolume()).contains(0L) @@ -441,6 +641,39 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -587,6 +820,45 @@ internal class LegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -596,6 +868,59 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -769,6 +1094,39 @@ internal class LegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -778,6 +1136,41 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -935,6 +1328,47 @@ internal class LegalEntityTest { .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -946,6 +1380,63 @@ internal class LegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 71c65714..5e40e52a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -197,6 +197,7 @@ internal class ServiceParamsTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -302,6 +303,7 @@ internal class ServiceParamsTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt index ba423ca3..eae938c1 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt @@ -86,6 +86,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -210,6 +211,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index 209e3548..95ed8a4f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -192,6 +192,7 @@ internal class CounterpartyServiceAsyncTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -316,6 +317,7 @@ internal class CounterpartyServiceAsyncTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt index bb8de2d4..325cb2e4 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt @@ -89,6 +89,7 @@ internal class LegalEntityAssociationServiceAsyncTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt index acad9a70..2fbc669a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt @@ -81,6 +81,7 @@ internal class LegalEntityServiceAsyncTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -185,6 +186,7 @@ internal class LegalEntityServiceAsyncTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt index 43cea92d..fa8159a3 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt @@ -86,6 +86,7 @@ internal class ConnectionLegalEntityServiceTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -210,6 +211,7 @@ internal class ConnectionLegalEntityServiceTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index 38723011..4d9119ba 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -192,6 +192,7 @@ internal class CounterpartyServiceTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -316,6 +317,7 @@ internal class CounterpartyServiceTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt index e61535df..22139fe5 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt @@ -89,6 +89,7 @@ internal class LegalEntityAssociationServiceTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt index 9f8d9b9d..95a03411 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt @@ -81,6 +81,7 @@ internal class LegalEntityServiceTest { .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -185,6 +186,7 @@ internal class LegalEntityServiceTest { ) .build() ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) From 43d2f3ab1cc718fb402776cde26fbcb61b56c7f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 19:06:40 +0000 Subject: [PATCH 09/27] chore(internal): update maven repo doc to include authentication --- scripts/upload-artifacts | 64 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index 548d1527..10f3c705 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -96,8 +96,52 @@ generate_instructions() {

Stainless SDK Maven Repository

This is the Maven repository for your Stainless Java SDK build.

-

Directions

-

To use the uploaded Maven repository, add the following to your project's pom.xml:

+

Project configuration

+ +

The details depend on whether you're using Maven or Gradle as your build tool.

+ +

Maven

+ +

Add the following to your project's pom.xml:

+
<repositories>
+    <repository>
+        <id>stainless-sdk-repo</id>
+        <url>https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn</url>
+    </repository>
+</repositories>
+ +

Gradle

+

Add the following to your build.gradle file:

+
repositories {
+    maven {
+        url "https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn"
+    }
+}
+ +
+

Configuring authentication (if required)

+ +

Some accounts may require authentication to access the repository. If so, use the + following instructions, replacing YOUR_STAINLESS_API_TOKEN with your actual token.

+ +

Maven with authentication

+ +

First, ensure you have the following in your Maven settings.xml for repo authentication:

+
<servers>
+    <server>
+        <id>stainless-sdk-repo</id>
+        <configuration>
+            <httpHeaders>
+                <property>
+                    <name>Authorization</name>
+                    <value>Bearer YOUR_STAINLESS_API_TOKEN</value>
+                </property>
+            </httpHeaders>
+        </configuration>
+    </server>
+</servers>
+ +

Then, add the following to your project's pom.xml:

<repositories>
     <repository>
         <id>stainless-sdk-repo</id>
@@ -105,14 +149,24 @@ generate_instructions() {
     </repository>
 </repositories>
-

If you're using Gradle, add the following to your build.gradle file:

+

Gradle with authentication

+

Add the following to your build.gradle file:

repositories {
     maven {
-        url 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'
+        url "https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn"
+        credentials(HttpHeaderCredentials) {
+            name = "Authorization"
+            value = "Bearer YOUR_STAINLESS_API_TOKEN"
+        }
+        authentication {
+            header(HttpHeaderAuthentication)
+        }
     }
 }
+
-

Once you've added the repository, you can include dependencies from it as usual. See your +

Using the repository

+

Once you've configured the repository, you can include dependencies from it as usual. See your project README for more details.

From 2892b70eccf5ddca0c23ea56d45f8a75ae263af3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 21:08:14 +0000 Subject: [PATCH 10/27] feat(client): send `X-Stainless-Kotlin-Version` header --- .../src/main/kotlin/com/moderntreasury/api/core/ClientOptions.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ClientOptions.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ClientOptions.kt index fa816781..8ed79fe5 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ClientOptions.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ClientOptions.kt @@ -477,6 +477,7 @@ private constructor( headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) + headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString()) organizationId.let { username -> apiKey.let { password -> if (!username.isEmpty() && !password.isEmpty()) { From 571f58c847371e19b4b62a85a92fce5b9d8bcbec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 22:50:33 +0000 Subject: [PATCH 11/27] docs: add comment for arbitrary value fields --- .../api/models/BulkRequestCreateParams.kt | 40 +++++++++++++++++-- .../api/models/ExpectedPayment.kt | 18 ++++++++- .../api/models/ExpectedPaymentCreateParams.kt | 36 +++++++++++++++-- .../api/models/ExpectedPaymentUpdateParams.kt | 36 +++++++++++++++-- .../IncomingPaymentDetailCreateAsyncParams.kt | 10 +++++ .../api/models/JournalReportUpdateParams.kt | 12 ++++++ .../api/models/PaymentActionCreateParams.kt | 18 ++++++++- .../api/models/PaymentActionCreateResponse.kt | 9 ++++- .../api/models/PaymentActionListResponse.kt | 9 ++++- .../models/PaymentActionRetrieveResponse.kt | 9 ++++- .../api/models/PaymentActionUpdateResponse.kt | 9 ++++- .../moderntreasury/api/models/PaymentOrder.kt | 5 +++ .../api/models/ReturnCreateParams.kt | 18 ++++++++- .../moderntreasury/api/models/ReturnObject.kt | 9 ++++- 14 files changed, 215 insertions(+), 23 deletions(-) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt index 9eaae8e6..5d031b2c 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/BulkRequestCreateParams.kt @@ -7982,12 +7982,28 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` + * method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` + * method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups @@ -17762,12 +17778,28 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` + * method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequestWithId.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` + * method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequestWithId.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt index a3ffa79d..c4be80db 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt @@ -340,12 +340,26 @@ private constructor( */ fun object_(): String = object_.getRequired("object") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPayment.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPayment.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt index b6f739fc..6b5f0b78 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt @@ -185,10 +185,24 @@ private constructor( */ fun metadata(): Optional = body.metadata() - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateParams.reconciliationFilters().convert(MyClass.class); + * ``` + */ fun _reconciliationFilters(): JsonValue = body._reconciliationFilters() - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateParams.reconciliationGroups().convert(MyClass.class); + * ``` + */ fun _reconciliationGroups(): JsonValue = body._reconciliationGroups() /** @@ -1382,12 +1396,26 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt index f90ec970..a43f5237 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt @@ -161,10 +161,24 @@ private constructor( */ fun metadata(): Optional = body.metadata() - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateParams.reconciliationFilters().convert(MyClass.class); + * ``` + */ fun _reconciliationFilters(): JsonValue = body._reconciliationFilters() - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateParams.reconciliationGroups().convert(MyClass.class); + * ``` + */ fun _reconciliationGroups(): JsonValue = body._reconciliationGroups() /** @@ -1277,12 +1291,26 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequest.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequest.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt index e5effb49..d12db902 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt @@ -55,6 +55,11 @@ private constructor( /** * An object passed through to the simulated IPD that could reflect what a vendor would pass. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = incomingPaymentDetailCreateAsyncParams.data().convert(MyClass.class); + * ``` */ fun _data(): JsonValue = body._data() @@ -544,6 +549,11 @@ private constructor( /** * An object passed through to the simulated IPD that could reflect what a vendor would * pass. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = incomingPaymentDetailCreateRequest.data().convert(MyClass.class); + * ``` */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt index 307e5d3e..aac5fdd7 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt @@ -30,6 +30,12 @@ private constructor( fun id(): Optional = Optional.ofNullable(id) + /** + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = journalReportUpdateParams.metadata().convert(MyClass.class); + * ``` + */ fun _metadata(): JsonValue = body._metadata() /** @@ -265,6 +271,12 @@ private constructor( @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), ) : this(metadata, status, mutableMapOf()) + /** + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = body.metadata().convert(MyClass.class); + * ``` + */ @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonValue = metadata /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt index b51281cb..f1938942 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt @@ -52,7 +52,14 @@ private constructor( */ fun actionableType(): Optional = body.actionableType() - /** Optional. The specifc details of the payment action based on type. */ + /** + * Optional. The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateParams.details().convert(MyClass.class); + * ``` + */ fun _details(): JsonValue = body._details() /** @@ -402,7 +409,14 @@ private constructor( */ fun actionableType(): Optional = actionableType.getOptional("actionable_type") - /** Optional. The specifc details of the payment action based on type. */ + /** + * Optional. The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateRequest.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt index 88b9b45a..3146ac21 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt index 9848071c..e5203ca4 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionListResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt index fd059eeb..079b6498 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionRetrieveResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt index 5a251995..7eb66d50 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionUpdateResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt index 13dfdd94..ab4743ee 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt @@ -704,6 +704,11 @@ private constructor( /** * Additional vendor specific fields for this payment. Data must be represented as key-value * pairs. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentOrder.vendorAttributes().convert(MyClass.class); + * ``` */ @JsonProperty("vendor_attributes") @ExcludeMissing diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt index 8078e5d3..86b611a1 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt @@ -73,7 +73,14 @@ private constructor( */ fun corrections(): Optional = body.corrections() - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnCreateParams.data().convert(MyClass.class); + * ``` + */ fun _data(): JsonValue = body._data() /** @@ -600,7 +607,14 @@ private constructor( */ fun corrections(): Optional = corrections.getOptional("corrections") - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnCreateRequest.data().convert(MyClass.class); + * ``` + */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt index 89764cd9..08a8154c 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt @@ -358,7 +358,14 @@ private constructor( fun additionalInformation(): Optional = additionalInformation.getOptional("additional_information") - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnObject.data().convert(MyClass.class); + * ``` + */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data /** From 1b090089c69c910d2ba40cb46b728e62985078de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 23:01:43 +0000 Subject: [PATCH 12/27] chore(internal): correct cache invalidation for `SKIP_MOCK_TESTS` --- buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts b/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts index 4a7519ca..debe9fa1 100644 --- a/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts @@ -33,6 +33,9 @@ kotlin { tasks.withType().configureEach { systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent") + + // `SKIP_MOCK_TESTS` affects which tests run so it must be added as input for proper cache invalidation. + inputs.property("skipMockTests", System.getenv("SKIP_MOCK_TESTS")).optional(true) } val ktfmt by configurations.creating From 121d5c6f42466017cf7a0a76793adcf1beab09da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 02:41:30 +0000 Subject: [PATCH 13/27] fix(client): preserve time zone in lenient date-time parsing --- .../moderntreasury/api/core/ObjectMappers.kt | 19 +++++---- .../api/core/ObjectMappersTest.kt | 41 +++++++++++++++---- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt index a3367e64..4729a3f6 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/core/ObjectMappers.kt @@ -25,7 +25,7 @@ import java.time.DateTimeException import java.time.LocalDate import java.time.LocalDateTime import java.time.OffsetDateTime -import java.time.ZonedDateTime +import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField @@ -157,14 +157,15 @@ private class LenientOffsetDateTimeDeserializer : val temporal = formatter.parse(p.text) return when { - !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> - LocalDate.from(temporal).atStartOfDay() - !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> - LocalDateTime.from(temporal) - else -> ZonedDateTime.from(temporal).toLocalDateTime() - } - .atZone(context.timeZone.toZoneId()) - .toOffsetDateTime() + !temporal.isSupported(ChronoField.HOUR_OF_DAY) -> + LocalDate.from(temporal) + .atStartOfDay() + .atZone(ZoneId.of("UTC")) + .toOffsetDateTime() + !temporal.isSupported(ChronoField.OFFSET_SECONDS) -> + LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime() + else -> OffsetDateTime.from(temporal) + } } catch (e: DateTimeException) { exceptions.add(e) } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt index 7dc8380c..2831c0da 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt @@ -3,12 +3,14 @@ package com.moderntreasury.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.readValue +import java.time.LocalDate +import java.time.LocalTime import java.time.OffsetDateTime +import java.time.ZoneOffset import kotlin.reflect.KClass import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.catchThrowable import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.EnumSource import org.junitpioneer.jupiter.cartesian.CartesianTest @@ -72,11 +74,34 @@ internal class ObjectMappersTest { } } - enum class LenientOffsetDateTimeTestCase(val string: String) { - DATE("1998-04-21"), - DATE_TIME("1998-04-21T04:00:00"), - ZONED_DATE_TIME_1("1998-04-21T04:00:00+03:00"), - ZONED_DATE_TIME_2("1998-04-21T04:00:00Z"), + enum class LenientOffsetDateTimeTestCase( + val string: String, + val expectedOffsetDateTime: OffsetDateTime, + ) { + DATE( + "1998-04-21", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(0, 0), ZoneOffset.UTC), + ), + DATE_TIME( + "1998-04-21T04:00:00", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), + ZONED_DATE_TIME_1( + "1998-04-21T04:00:00+03:00", + expectedOffsetDateTime = + OffsetDateTime.of( + LocalDate.of(1998, 4, 21), + LocalTime.of(4, 0), + ZoneOffset.ofHours(3), + ), + ), + ZONED_DATE_TIME_2( + "1998-04-21T04:00:00Z", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), } @ParameterizedTest @@ -85,6 +110,8 @@ internal class ObjectMappersTest { val jsonMapper = jsonMapper() val json = jsonMapper.writeValueAsString(testCase.string) - assertDoesNotThrow { jsonMapper().readValue(json) } + val offsetDateTime = jsonMapper().readValue(json) + + assertThat(offsetDateTime).isEqualTo(testCase.expectedOffsetDateTime) } } From 38dfbcefd6d91762eae1d7dc91bfc64f4f11b1a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 18:13:51 +0000 Subject: [PATCH 14/27] chore(ci): upgrade `actions/github-script` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 428e6494..db1a4388 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/modern-treasury-java' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); From de3c957e75bc5bab282952b6e363fa7f3bcc8523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 15:24:06 +0000 Subject: [PATCH 15/27] feat(api): api update --- .stats.yml | 4 +- .../api/models/ChildLegalEntity.kt | 1010 ++++++++++++++-- .../api/models/ChildLegalEntityCreate.kt | 1002 ++++++++++++++-- .../ConnectionLegalEntityCreateParams.kt | 1030 ++++++++++++++-- .../api/models/CounterpartyCreateParams.kt | 1030 ++++++++++++++-- .../moderntreasury/api/models/LegalEntity.kt | 1010 ++++++++++++++-- .../api/models/LegalEntityCreateParams.kt | 1067 ++++++++++++++++- .../api/models/LegalEntityUpdateParams.kt | 1067 ++++++++++++++++- .../moderntreasury/api/models/Transaction.kt | 10 +- .../api/models/ChildLegalEntityCreateTest.kt | 47 + .../api/models/ChildLegalEntityTest.kt | 96 ++ .../ConnectionLegalEntityCreateParamsTest.kt | 117 ++ .../models/CounterpartyCreateParamsTest.kt | 121 ++ .../LegalEntityAssociationCreateParamsTest.kt | 47 + .../LegalEntityAssociationInlineCreateTest.kt | 49 + .../api/models/LegalEntityAssociationTest.kt | 45 + .../api/models/LegalEntityCreateParamsTest.kt | 99 ++ .../api/models/LegalEntityTest.kt | 96 ++ .../api/models/LegalEntityUpdateParamsTest.kt | 47 + .../api/services/ServiceParamsTest.kt | 41 + .../ConnectionLegalEntityServiceAsyncTest.kt | 44 + .../async/CounterpartyServiceAsyncTest.kt | 46 + .../LegalEntityAssociationServiceAsyncTest.kt | 17 + .../async/LegalEntityServiceAsyncTest.kt | 48 + .../ConnectionLegalEntityServiceTest.kt | 44 + .../blocking/CounterpartyServiceTest.kt | 46 + .../LegalEntityAssociationServiceTest.kt | 17 + .../blocking/LegalEntityServiceTest.kt | 48 + 28 files changed, 7706 insertions(+), 639 deletions(-) diff --git a/.stats.yml b/.stats.yml index 619477e0..d70d0999 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e15a21ef6628dcc5510621b680a6373e71c53d5d36e89ca191a8223a94298be2.yml -openapi_spec_hash: e49d45dc10032cea0ee381f1ed002dc8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-d8140aaa2f4b9b2fd803a2135c87078d7081b3fdac301913eb1263d0a4ee794d.yml +openapi_spec_hash: b5ff512582cc4da8d4cd625ef651bc84 config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt index ad0bd74e..e6154e19 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt @@ -49,6 +49,7 @@ private constructor( private val legalEntityAssociations: JsonField>, private val legalEntityType: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val liveMode: JsonField, private val metadata: JsonField, private val middleName: JsonField, @@ -59,8 +60,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val updatedAt: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, @@ -134,6 +138,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("live_mode") @ExcludeMissing liveMode: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @@ -156,10 +163,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), @@ -192,6 +208,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -202,8 +219,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, updatedAt, wealthAndEmploymentDetails, website, @@ -397,6 +417,14 @@ private constructor( */ fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * This field will be true if this object exists in the live environment or false if it exists * in the test environment. @@ -477,6 +505,14 @@ private constructor( fun primarySocialMediaSites(): List = primarySocialMediaSites.getRequired("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -493,6 +529,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -732,6 +785,15 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [liveMode]. * @@ -815,6 +877,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -831,6 +902,25 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [updatedAt]. * @@ -901,6 +991,7 @@ private constructor( * .legalEntityAssociations() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -911,8 +1002,11 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -950,6 +1044,7 @@ private constructor( private var legalEntityAssociations: JsonField>? = null private var legalEntityType: JsonField? = null private var legalStructure: JsonField? = null + private var listedExchange: JsonField? = null private var liveMode: JsonField? = null private var metadata: JsonField? = null private var middleName: JsonField? = null @@ -960,8 +1055,11 @@ private constructor( private var preferredName: JsonField? = null private var prefix: JsonField? = null private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField? = null private var suffix: JsonField? = null + private var thirdPartyVerification: JsonField? = null + private var tickerSymbol: JsonField? = null private var updatedAt: JsonField? = null private var wealthAndEmploymentDetails: JsonField? = null private var website: JsonField? = null @@ -995,6 +1093,7 @@ private constructor( childLegalEntity.legalEntityAssociations.map { it.toMutableList() } legalEntityType = childLegalEntity.legalEntityType legalStructure = childLegalEntity.legalStructure + listedExchange = childLegalEntity.listedExchange liveMode = childLegalEntity.liveMode metadata = childLegalEntity.metadata middleName = childLegalEntity.middleName @@ -1007,8 +1106,11 @@ private constructor( prefix = childLegalEntity.prefix primarySocialMediaSites = childLegalEntity.primarySocialMediaSites.map { it.toMutableList() } + regulators = childLegalEntity.regulators.map { it.toMutableList() } riskRating = childLegalEntity.riskRating suffix = childLegalEntity.suffix + thirdPartyVerification = childLegalEntity.thirdPartyVerification + tickerSymbol = childLegalEntity.tickerSymbol updatedAt = childLegalEntity.updatedAt wealthAndEmploymentDetails = childLegalEntity.wealthAndEmploymentDetails website = childLegalEntity.website @@ -1500,6 +1602,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * This field will be true if this object exists in the live environment or false if it * exists in the test environment. @@ -1698,6 +1819,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -1727,6 +1879,46 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) /** @@ -1825,6 +2017,7 @@ private constructor( * .legalEntityAssociations() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -1835,8 +2028,11 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -1876,6 +2072,7 @@ private constructor( }, checkRequired("legalEntityType", legalEntityType), checkRequired("legalStructure", legalStructure), + checkRequired("listedExchange", listedExchange), checkRequired("liveMode", liveMode), checkRequired("metadata", metadata), checkRequired("middleName", middleName), @@ -1890,8 +2087,11 @@ private constructor( checkRequired("primarySocialMediaSites", primarySocialMediaSites).map { it.toImmutable() }, + checkRequired("regulators", regulators).map { it.toImmutable() }, checkRequired("riskRating", riskRating), checkRequired("suffix", suffix), + checkRequired("thirdPartyVerification", thirdPartyVerification), + checkRequired("tickerSymbol", tickerSymbol), checkRequired("updatedAt", updatedAt), checkRequired("wealthAndEmploymentDetails", wealthAndEmploymentDetails), checkRequired("website", website), @@ -1930,6 +2130,7 @@ private constructor( legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalEntityType().validate() legalStructure().ifPresent { it.validate() } + listedExchange() liveMode() metadata().validate() middleName() @@ -1940,8 +2141,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() updatedAt() wealthAndEmploymentDetails().ifPresent { it.validate() } website() @@ -1987,6 +2191,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (if (liveMode.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + @@ -1997,8 +2202,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -4886,140 +5094,730 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. + * Returns the raw JSON value of [jurisdiction]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not have - * the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction } - return other is RiskRating && value == other.value - } + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) - override fun hashCode() = value.hashCode() + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } - override fun toString() = value.toString() + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") @ExcludeMissing vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -7274,6 +8072,7 @@ private constructor( legalEntityAssociations == other.legalEntityAssociations && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && liveMode == other.liveMode && metadata == other.metadata && middleName == other.middleName && @@ -7284,8 +8083,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && updatedAt == other.updatedAt && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && @@ -7318,6 +8120,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -7328,8 +8131,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, updatedAt, wealthAndEmploymentDetails, website, @@ -7340,5 +8146,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt index 09979c9d..c45cc15f 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt @@ -46,6 +46,7 @@ private constructor( private val legalEntityAssociations: JsonField>, private val legalEntityType: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -54,8 +55,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, private val additionalProperties: MutableMap, @@ -122,6 +126,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @ExcludeMissing @@ -142,10 +149,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("wealth_and_employment_details") @ExcludeMissing wealthAndEmploymentDetails: JsonField = JsonMissing.of(), @@ -172,6 +188,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -180,8 +197,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -364,6 +384,14 @@ private constructor( */ fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -429,6 +457,14 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -445,6 +481,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -653,6 +706,15 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -722,6 +784,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -738,6 +809,25 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -802,6 +892,7 @@ private constructor( null private var legalEntityType: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -810,8 +901,11 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -843,6 +937,7 @@ private constructor( childLegalEntityCreate.legalEntityAssociations.map { it.toMutableList() } legalEntityType = childLegalEntityCreate.legalEntityType legalStructure = childLegalEntityCreate.legalStructure + listedExchange = childLegalEntityCreate.listedExchange metadata = childLegalEntityCreate.metadata middleName = childLegalEntityCreate.middleName operatingJurisdictions = @@ -853,8 +948,11 @@ private constructor( prefix = childLegalEntityCreate.prefix primarySocialMediaSites = childLegalEntityCreate.primarySocialMediaSites.map { it.toMutableList() } + regulators = childLegalEntityCreate.regulators.map { it.toMutableList() } riskRating = childLegalEntityCreate.riskRating suffix = childLegalEntityCreate.suffix + thirdPartyVerification = childLegalEntityCreate.thirdPartyVerification + tickerSymbol = childLegalEntityCreate.tickerSymbol wealthAndEmploymentDetails = childLegalEntityCreate.wealthAndEmploymentDetails website = childLegalEntityCreate.website additionalProperties = childLegalEntityCreate.additionalProperties.toMutableMap() @@ -1306,6 +1404,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1479,6 +1596,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -1508,6 +1656,46 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -1592,6 +1780,7 @@ private constructor( (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalEntityType, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -1600,8 +1789,11 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -1636,6 +1828,7 @@ private constructor( legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalEntityType().ifPresent { it.validate() } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -1644,8 +1837,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -1687,6 +1883,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -1695,8 +1892,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -2862,140 +3062,730 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. + * Returns the raw JSON value of [jurisdiction]. * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. - * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not have - * the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction } - return other is RiskRating && value == other.value - } + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) - override fun hashCode() = value.hashCode() + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } - override fun toString() = value.toString() + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") @ExcludeMissing vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -5247,6 +6037,7 @@ private constructor( legalEntityAssociations == other.legalEntityAssociations && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -5255,8 +6046,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -5285,6 +6079,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -5293,8 +6088,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -5304,5 +6102,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt index 863ab3a8..bace0e1f 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt @@ -597,6 +597,7 @@ private constructor( private val legalEntityAssociations: JsonField>, private val legalEntityType: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -605,8 +606,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, private val additionalProperties: MutableMap, @@ -677,6 +681,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -699,10 +706,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("wealth_and_employment_details") @ExcludeMissing wealthAndEmploymentDetails: JsonField = @@ -730,6 +746,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -738,8 +755,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -924,6 +944,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -989,6 +1017,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -1005,6 +1042,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1219,6 +1273,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -1292,6 +1356,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -1308,6 +1381,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -1372,6 +1465,7 @@ private constructor( null private var legalEntityType: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -1380,8 +1474,11 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -1412,6 +1509,7 @@ private constructor( legalEntity.legalEntityAssociations.map { it.toMutableList() } legalEntityType = legalEntity.legalEntityType legalStructure = legalEntity.legalStructure + listedExchange = legalEntity.listedExchange metadata = legalEntity.metadata middleName = legalEntity.middleName operatingJurisdictions = @@ -1422,8 +1520,11 @@ private constructor( prefix = legalEntity.prefix primarySocialMediaSites = legalEntity.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating suffix = legalEntity.suffix + thirdPartyVerification = legalEntity.thirdPartyVerification + tickerSymbol = legalEntity.tickerSymbol wealthAndEmploymentDetails = legalEntity.wealthAndEmploymentDetails website = legalEntity.website additionalProperties = legalEntity.additionalProperties.toMutableMap() @@ -1894,6 +1995,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2071,6 +2191,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -2103,6 +2254,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -2188,6 +2381,7 @@ private constructor( (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalEntityType, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -2196,8 +2390,11 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -2232,6 +2429,7 @@ private constructor( legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalEntityType().ifPresent { it.validate() } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -2240,8 +2438,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -2286,6 +2487,7 @@ private constructor( ?: 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -2294,8 +2496,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -3498,142 +3703,749 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : - Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. + * Returns the raw JSON value of [jurisdiction]. * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not - * have the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() } - return other is RiskRating && value == other.value - } + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format + * (e.g., "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) - override fun hashCode() = value.hashCode() + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } - override fun toString() = value.toString() + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") + @ExcludeMissing + vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = + thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -5933,6 +6745,7 @@ private constructor( legalEntityAssociations == other.legalEntityAssociations && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -5941,8 +6754,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -5971,6 +6787,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -5979,8 +6796,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -5990,7 +6810,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt index 69d70472..e373aa6b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt @@ -3961,6 +3961,7 @@ private constructor( private val lastName: JsonField, private val legalEntityAssociations: JsonField>, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -3969,8 +3970,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, private val additionalProperties: MutableMap, @@ -4041,6 +4045,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -4063,10 +4070,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("wealth_and_employment_details") @ExcludeMissing wealthAndEmploymentDetails: JsonField = @@ -4094,6 +4110,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -4102,8 +4119,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -4287,6 +4307,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -4352,6 +4380,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -4368,6 +4405,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4582,6 +4636,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -4655,6 +4719,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -4671,6 +4744,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -4742,6 +4835,7 @@ private constructor( JsonField>? = null private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -4750,8 +4844,11 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -4784,6 +4881,7 @@ private constructor( legalEntityAssociations = legalEntityCreateRequest.legalEntityAssociations.map { it.toMutableList() } legalStructure = legalEntityCreateRequest.legalStructure + listedExchange = legalEntityCreateRequest.listedExchange metadata = legalEntityCreateRequest.metadata middleName = legalEntityCreateRequest.middleName operatingJurisdictions = @@ -4794,8 +4892,11 @@ private constructor( prefix = legalEntityCreateRequest.prefix primarySocialMediaSites = legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating suffix = legalEntityCreateRequest.suffix + thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification + tickerSymbol = legalEntityCreateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityCreateRequest.wealthAndEmploymentDetails website = legalEntityCreateRequest.website additionalProperties = legalEntityCreateRequest.additionalProperties.toMutableMap() @@ -5266,6 +5367,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -5443,6 +5563,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -5475,6 +5626,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -5567,6 +5760,7 @@ private constructor( lastName, (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -5575,8 +5769,11 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -5611,6 +5808,7 @@ private constructor( lastName() legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -5619,8 +5817,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -5665,6 +5866,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -5673,8 +5875,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -6877,142 +7082,749 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : - Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. + * Returns the raw JSON value of [jurisdiction]. * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not - * have the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() } - return other is RiskRating && value == other.value - } + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format + * (e.g., "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) - override fun hashCode() = value.hashCode() + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } - override fun toString() = value.toString() + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") + @ExcludeMissing + vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = + thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -9312,6 +10124,7 @@ private constructor( lastName == other.lastName && legalEntityAssociations == other.legalEntityAssociations && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -9320,8 +10133,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -9350,6 +10166,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -9358,8 +10175,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -9369,7 +10189,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt index 34f67891..9ebc3ced 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt @@ -48,6 +48,7 @@ private constructor( private val lastName: JsonField, private val legalEntityType: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val liveMode: JsonField, private val metadata: JsonField, private val middleName: JsonField, @@ -58,8 +59,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val updatedAt: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, @@ -131,6 +135,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("live_mode") @ExcludeMissing liveMode: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @JsonProperty("middle_name") @@ -153,10 +160,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), @@ -191,6 +207,7 @@ private constructor( lastName, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -201,8 +218,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, updatedAt, wealthAndEmploymentDetails, website, @@ -388,6 +408,14 @@ private constructor( */ fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * This field will be true if this object exists in the live environment or false if it exists * in the test environment. @@ -468,6 +496,14 @@ private constructor( fun primarySocialMediaSites(): List = primarySocialMediaSites.getRequired("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -484,6 +520,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -721,6 +774,15 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [liveMode]. * @@ -804,6 +866,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -820,6 +891,25 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [updatedAt]. * @@ -900,6 +990,7 @@ private constructor( * .lastName() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -910,8 +1001,11 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -948,6 +1042,7 @@ private constructor( private var lastName: JsonField? = null private var legalEntityType: JsonField? = null private var legalStructure: JsonField? = null + private var listedExchange: JsonField? = null private var liveMode: JsonField? = null private var metadata: JsonField? = null private var middleName: JsonField? = null @@ -958,8 +1053,11 @@ private constructor( private var preferredName: JsonField? = null private var prefix: JsonField? = null private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField? = null private var suffix: JsonField? = null + private var thirdPartyVerification: JsonField? = null + private var tickerSymbol: JsonField? = null private var updatedAt: JsonField? = null private var wealthAndEmploymentDetails: JsonField? = null private var website: JsonField? = null @@ -991,6 +1089,7 @@ private constructor( lastName = legalEntity.lastName legalEntityType = legalEntity.legalEntityType legalStructure = legalEntity.legalStructure + listedExchange = legalEntity.listedExchange liveMode = legalEntity.liveMode metadata = legalEntity.metadata middleName = legalEntity.middleName @@ -1001,8 +1100,11 @@ private constructor( preferredName = legalEntity.preferredName prefix = legalEntity.prefix primarySocialMediaSites = legalEntity.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating suffix = legalEntity.suffix + thirdPartyVerification = legalEntity.thirdPartyVerification + tickerSymbol = legalEntity.tickerSymbol updatedAt = legalEntity.updatedAt wealthAndEmploymentDetails = legalEntity.wealthAndEmploymentDetails website = legalEntity.website @@ -1458,6 +1560,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * This field will be true if this object exists in the live environment or false if it * exists in the test environment. @@ -1656,6 +1777,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -1685,6 +1837,46 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) /** @@ -1819,6 +2011,7 @@ private constructor( * .lastName() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -1829,8 +2022,11 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -1867,6 +2063,7 @@ private constructor( checkRequired("lastName", lastName), checkRequired("legalEntityType", legalEntityType), checkRequired("legalStructure", legalStructure), + checkRequired("listedExchange", listedExchange), checkRequired("liveMode", liveMode), checkRequired("metadata", metadata), checkRequired("middleName", middleName), @@ -1881,8 +2078,11 @@ private constructor( checkRequired("primarySocialMediaSites", primarySocialMediaSites).map { it.toImmutable() }, + checkRequired("regulators", regulators).map { it.toImmutable() }, checkRequired("riskRating", riskRating), checkRequired("suffix", suffix), + checkRequired("thirdPartyVerification", thirdPartyVerification), + checkRequired("tickerSymbol", tickerSymbol), checkRequired("updatedAt", updatedAt), checkRequired("wealthAndEmploymentDetails", wealthAndEmploymentDetails), checkRequired("website", website), @@ -1921,6 +2121,7 @@ private constructor( lastName() legalEntityType().validate() legalStructure().ifPresent { it.validate() } + listedExchange() liveMode() metadata().validate() middleName() @@ -1931,8 +2132,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() updatedAt() wealthAndEmploymentDetails().ifPresent { it.validate() } website() @@ -1978,6 +2182,7 @@ private constructor( (if (lastName.asKnown().isPresent) 1 else 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (if (liveMode.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + @@ -1988,8 +2193,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) + @@ -4878,140 +5086,730 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. + * Returns the raw JSON value of [jurisdiction]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not have - * the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction } - return other is RiskRating && value == other.value - } + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) - override fun hashCode() = value.hashCode() + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } - override fun toString() = value.toString() + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") @ExcludeMissing vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -7265,6 +8063,7 @@ private constructor( lastName == other.lastName && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && liveMode == other.liveMode && metadata == other.metadata && middleName == other.middleName && @@ -7275,8 +8074,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && updatedAt == other.updatedAt && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && @@ -7309,6 +8111,7 @@ private constructor( lastName, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -7319,8 +8122,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, updatedAt, wealthAndEmploymentDetails, website, @@ -7332,5 +8138,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" + "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt index fd2b2c73..d2113435 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt @@ -201,6 +201,14 @@ private constructor( */ fun legalStructure(): Optional = body.legalStructure() + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = body.listedExchange() + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -263,6 +271,14 @@ private constructor( */ fun primarySocialMediaSites(): Optional> = body.primarySocialMediaSites() + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = body.regulators() + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -279,6 +295,22 @@ private constructor( */ fun suffix(): Optional = body.suffix() + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = body.thirdPartyVerification() + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = body.tickerSymbol() + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -451,6 +483,13 @@ private constructor( */ fun _legalStructure(): JsonField = body._legalStructure() + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _listedExchange(): JsonField = body._listedExchange() + /** * Returns the raw JSON value of [metadata]. * @@ -510,6 +549,13 @@ private constructor( */ fun _primarySocialMediaSites(): JsonField> = body._primarySocialMediaSites() + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _regulators(): JsonField> = body._regulators() + /** * Returns the raw JSON value of [riskRating]. * @@ -524,6 +570,22 @@ private constructor( */ fun _suffix(): JsonField = body._suffix() + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _thirdPartyVerification(): JsonField = + body._thirdPartyVerification() + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _tickerSymbol(): JsonField = body._tickerSymbol() + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -1027,6 +1089,24 @@ private constructor( body.legalStructure(legalStructure) } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = apply { body.listedExchange(listedExchange) } + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + body.listedExchange(listedExchange) + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1193,6 +1273,33 @@ private constructor( body.addPrimarySocialMediaSite(primarySocialMediaSite) } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = apply { + body.regulators(regulators) + } + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + body.regulators(regulators) + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { body.addRegulator(regulator) } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = apply { body.riskRating(riskRating) } @@ -1222,6 +1329,47 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { body.suffix(suffix) } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = apply { body.tickerSymbol(tickerSymbol) } + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + body.tickerSymbol(tickerSymbol) + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = apply { body.wealthAndEmploymentDetails(wealthAndEmploymentDetails) } @@ -1426,6 +1574,7 @@ private constructor( private val lastName: JsonField, private val legalEntityAssociations: JsonField>, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -1434,8 +1583,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, private val additionalProperties: MutableMap, @@ -1506,6 +1658,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -1528,10 +1683,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("wealth_and_employment_details") @ExcludeMissing wealthAndEmploymentDetails: JsonField = @@ -1559,6 +1723,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -1567,8 +1732,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -1752,6 +1920,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -1817,6 +1993,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -1833,6 +2018,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -2047,6 +2249,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -2120,6 +2332,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -2136,6 +2357,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -2207,6 +2448,7 @@ private constructor( JsonField>? = null private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -2215,8 +2457,11 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -2249,6 +2494,7 @@ private constructor( legalEntityAssociations = legalEntityCreateRequest.legalEntityAssociations.map { it.toMutableList() } legalStructure = legalEntityCreateRequest.legalStructure + listedExchange = legalEntityCreateRequest.listedExchange metadata = legalEntityCreateRequest.metadata middleName = legalEntityCreateRequest.middleName operatingJurisdictions = @@ -2259,8 +2505,11 @@ private constructor( prefix = legalEntityCreateRequest.prefix primarySocialMediaSites = legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating suffix = legalEntityCreateRequest.suffix + thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification + tickerSymbol = legalEntityCreateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityCreateRequest.wealthAndEmploymentDetails website = legalEntityCreateRequest.website additionalProperties = legalEntityCreateRequest.additionalProperties.toMutableMap() @@ -2731,6 +2980,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2908,6 +3176,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -2940,6 +3239,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -3032,6 +3373,7 @@ private constructor( lastName, (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -3040,8 +3382,11 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -3076,6 +3421,7 @@ private constructor( lastName() legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -3084,8 +3430,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -3130,6 +3479,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -3138,8 +3488,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -3170,6 +3523,7 @@ private constructor( lastName == other.lastName && legalEntityAssociations == other.legalEntityAssociations && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -3178,8 +3532,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -3208,6 +3565,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -3216,8 +3574,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -3227,7 +3588,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -4392,79 +4753,335 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. + * Returns the raw JSON value of [jurisdiction]. * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction + + /** + * Returns the raw JSON value of [name]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. + * + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. */ fun known(): Known = when (this) { @@ -4528,6 +5145,340 @@ private constructor( override fun toString() = value.toString() } + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") @ExcludeMissing vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" + } + class LegalEntityWealthEmploymentDetail @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt index dd67c517..4b76e2f1 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt @@ -176,6 +176,14 @@ private constructor( */ fun legalStructure(): Optional = body.legalStructure() + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = body.listedExchange() + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -238,6 +246,14 @@ private constructor( */ fun primarySocialMediaSites(): Optional> = body.primarySocialMediaSites() + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = body.regulators() + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -254,6 +270,22 @@ private constructor( */ fun suffix(): Optional = body.suffix() + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = body.thirdPartyVerification() + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = body.tickerSymbol() + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -403,6 +435,13 @@ private constructor( */ fun _legalStructure(): JsonField = body._legalStructure() + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _listedExchange(): JsonField = body._listedExchange() + /** * Returns the raw JSON value of [metadata]. * @@ -462,6 +501,13 @@ private constructor( */ fun _primarySocialMediaSites(): JsonField> = body._primarySocialMediaSites() + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _regulators(): JsonField> = body._regulators() + /** * Returns the raw JSON value of [riskRating]. * @@ -476,6 +522,22 @@ private constructor( */ fun _suffix(): JsonField = body._suffix() + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _thirdPartyVerification(): JsonField = + body._thirdPartyVerification() + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _tickerSymbol(): JsonField = body._tickerSymbol() + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -909,6 +971,24 @@ private constructor( body.legalStructure(legalStructure) } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = apply { body.listedExchange(listedExchange) } + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + body.listedExchange(listedExchange) + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1075,6 +1155,33 @@ private constructor( body.addPrimarySocialMediaSite(primarySocialMediaSite) } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = apply { + body.regulators(regulators) + } + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + body.regulators(regulators) + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { body.addRegulator(regulator) } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = apply { body.riskRating(riskRating) } @@ -1104,6 +1211,47 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { body.suffix(suffix) } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = apply { body.tickerSymbol(tickerSymbol) } + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + body.tickerSymbol(tickerSymbol) + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = apply { body.wealthAndEmploymentDetails(wealthAndEmploymentDetails) } @@ -1305,6 +1453,7 @@ private constructor( private val intendedUse: JsonField, private val lastName: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -1313,8 +1462,11 @@ private constructor( private val preferredName: JsonField, private val prefix: JsonField, private val primarySocialMediaSites: JsonField>, + private val regulators: JsonField>, private val riskRating: JsonField, private val suffix: JsonField, + private val thirdPartyVerification: JsonField, + private val tickerSymbol: JsonField, private val wealthAndEmploymentDetails: JsonField, private val website: JsonField, private val additionalProperties: MutableMap, @@ -1375,6 +1527,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -1397,10 +1552,19 @@ private constructor( @JsonProperty("primary_social_media_sites") @ExcludeMissing primarySocialMediaSites: JsonField> = JsonMissing.of(), + @JsonProperty("regulators") + @ExcludeMissing + regulators: JsonField> = JsonMissing.of(), @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), + @JsonProperty("third_party_verification") + @ExcludeMissing + thirdPartyVerification: JsonField = JsonMissing.of(), + @JsonProperty("ticker_symbol") + @ExcludeMissing + tickerSymbol: JsonField = JsonMissing.of(), @JsonProperty("wealth_and_employment_details") @ExcludeMissing wealthAndEmploymentDetails: JsonField = @@ -1425,6 +1589,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -1433,8 +1598,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -1590,6 +1758,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -1655,6 +1831,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -1671,6 +1856,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1854,6 +2056,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -1927,6 +2139,15 @@ private constructor( @ExcludeMissing fun _primarySocialMediaSites(): JsonField> = primarySocialMediaSites + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("regulators") + @ExcludeMissing + fun _regulators(): JsonField> = regulators + /** * Returns the raw JSON value of [riskRating]. * @@ -1943,6 +2164,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -2004,6 +2245,7 @@ private constructor( private var intendedUse: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -2012,8 +2254,11 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -2042,6 +2287,7 @@ private constructor( intendedUse = legalEntityUpdateRequest.intendedUse lastName = legalEntityUpdateRequest.lastName legalStructure = legalEntityUpdateRequest.legalStructure + listedExchange = legalEntityUpdateRequest.listedExchange metadata = legalEntityUpdateRequest.metadata middleName = legalEntityUpdateRequest.middleName operatingJurisdictions = @@ -2052,8 +2298,11 @@ private constructor( prefix = legalEntityUpdateRequest.prefix primarySocialMediaSites = legalEntityUpdateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityUpdateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityUpdateRequest.riskRating suffix = legalEntityUpdateRequest.suffix + thirdPartyVerification = legalEntityUpdateRequest.thirdPartyVerification + tickerSymbol = legalEntityUpdateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityUpdateRequest.wealthAndEmploymentDetails website = legalEntityUpdateRequest.website additionalProperties = legalEntityUpdateRequest.additionalProperties.toMutableMap() @@ -2445,6 +2694,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2622,6 +2890,37 @@ private constructor( } } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = + regulators(JsonField.ofNullable(regulators)) + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + this.regulators = regulators.map { it.toMutableList() } + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { + regulators = + (regulators ?: JsonField.of(mutableListOf())).also { + checkKnown("regulators", it).add(regulator) + } + } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = riskRating(JsonField.ofNullable(riskRating)) @@ -2654,6 +2953,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -2736,6 +3077,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -2744,8 +3086,11 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -2777,6 +3122,7 @@ private constructor( intendedUse() lastName() legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -2785,8 +3131,11 @@ private constructor( preferredName() prefix() primarySocialMediaSites() + regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } suffix() + thirdPartyVerification().ifPresent { it.validate() } + tickerSymbol() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -2827,6 +3176,7 @@ private constructor( (if (intendedUse.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -2835,8 +3185,11 @@ private constructor( (if (preferredName.asKnown().isPresent) 1 else 0) + (if (prefix.asKnown().isPresent) 1 else 0) + (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -2864,6 +3217,7 @@ private constructor( intendedUse == other.intendedUse && lastName == other.lastName && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -2872,8 +3226,11 @@ private constructor( preferredName == other.preferredName && prefix == other.prefix && primarySocialMediaSites == other.primarySocialMediaSites && + regulators == other.regulators && riskRating == other.riskRating && suffix == other.suffix && + thirdPartyVerification == other.thirdPartyVerification && + tickerSymbol == other.tickerSymbol && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -2899,6 +3256,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -2907,8 +3265,11 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -2918,7 +3279,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } class LegalEntityBankSetting @@ -3951,79 +4312,335 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. + * Returns the raw JSON value of [jurisdiction]. * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction + + /** + * Returns the raw JSON value of [name]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. + * + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. */ fun known(): Known = when (this) { @@ -4087,6 +4704,340 @@ private constructor( override fun toString() = value.toString() } + /** Information describing a third-party verification run by an external vendor. */ + class ThirdPartyVerification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val vendor: JsonField, + private val vendorVerificationId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("vendor") @ExcludeMissing vendor: JsonField = JsonMissing.of(), + @JsonProperty("vendor_verification_id") + @ExcludeMissing + vendorVerificationId: JsonField = JsonMissing.of(), + ) : this(vendor, vendorVerificationId, mutableMapOf()) + + /** + * The vendor that performed the verification, e.g. `persona`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendor(): Vendor = vendor.getRequired("vendor") + + /** + * The identification of the third party verification in `vendor`'s system. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun vendorVerificationId(): String = + vendorVerificationId.getRequired("vendor_verification_id") + + /** + * Returns the raw JSON value of [vendor]. + * + * Unlike [vendor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor") @ExcludeMissing fun _vendor(): JsonField = vendor + + /** + * Returns the raw JSON value of [vendorVerificationId]. + * + * Unlike [vendorVerificationId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("vendor_verification_id") + @ExcludeMissing + fun _vendorVerificationId(): JsonField = vendorVerificationId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ThirdPartyVerification]. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ThirdPartyVerification]. */ + class Builder internal constructor() { + + private var vendor: JsonField? = null + private var vendorVerificationId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { + vendor = thirdPartyVerification.vendor + vendorVerificationId = thirdPartyVerification.vendorVerificationId + additionalProperties = thirdPartyVerification.additionalProperties.toMutableMap() + } + + /** The vendor that performed the verification, e.g. `persona`. */ + fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) + + /** + * Sets [Builder.vendor] to an arbitrary JSON value. + * + * You should usually call [Builder.vendor] with a well-typed [Vendor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendor(vendor: JsonField) = apply { this.vendor = vendor } + + /** The identification of the third party verification in `vendor`'s system. */ + fun vendorVerificationId(vendorVerificationId: String) = + vendorVerificationId(JsonField.of(vendorVerificationId)) + + /** + * Sets [Builder.vendorVerificationId] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorVerificationId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vendorVerificationId(vendorVerificationId: JsonField) = apply { + this.vendorVerificationId = vendorVerificationId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [ThirdPartyVerification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .vendor() + * .vendorVerificationId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ThirdPartyVerification = + ThirdPartyVerification( + checkRequired("vendor", vendor), + checkRequired("vendorVerificationId", vendorVerificationId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ThirdPartyVerification = apply { + if (validated) { + return@apply + } + + vendor().validate() + vendorVerificationId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (vendor.asKnown().getOrNull()?.validity() ?: 0) + + (if (vendorVerificationId.asKnown().isPresent) 1 else 0) + + /** The vendor that performed the verification, e.g. `persona`. */ + class Vendor @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERSONA = of("persona") + + @JvmStatic fun of(value: String) = Vendor(JsonField.of(value)) + } + + /** An enum containing [Vendor]'s known values. */ + enum class Known { + PERSONA + } + + /** + * An enum containing [Vendor]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Vendor] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERSONA, + /** + * An enum member indicating that [Vendor] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERSONA -> Value.PERSONA + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERSONA -> Known.PERSONA + else -> throw ModernTreasuryInvalidDataException("Unknown Vendor: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Vendor = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vendor && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" + } + class LegalEntityWealthEmploymentDetail @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt index e45b45cf..b25fba7d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt @@ -1784,7 +1784,7 @@ private constructor( @JvmField val JPMC = of("jpmc") - @JvmField val MT_FLOW = of("mt_flow") + @JvmField val MODERN_TREASURY = of("modern_treasury") @JvmField val MX = of("mx") @@ -1828,7 +1828,7 @@ private constructor( HIFI, ISO20022, JPMC, - MT_FLOW, + MODERN_TREASURY, MX, PAXOS, PAYPAL, @@ -1868,7 +1868,7 @@ private constructor( HIFI, ISO20022, JPMC, - MT_FLOW, + MODERN_TREASURY, MX, PAXOS, PAYPAL, @@ -1912,7 +1912,7 @@ private constructor( HIFI -> Value.HIFI ISO20022 -> Value.ISO20022 JPMC -> Value.JPMC - MT_FLOW -> Value.MT_FLOW + MODERN_TREASURY -> Value.MODERN_TREASURY MX -> Value.MX PAXOS -> Value.PAXOS PAYPAL -> Value.PAYPAL @@ -1954,7 +1954,7 @@ private constructor( HIFI -> Known.HIFI ISO20022 -> Known.ISO20022 JPMC -> Known.JPMC - MT_FLOW -> Known.MT_FLOW + MODERN_TREASURY -> Known.MODERN_TREASURY MX -> Known.MX PAXOS -> Known.PAXOS PAYPAL -> Known.PAYPAL diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt index ac348e2f..9f8eb439 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt @@ -106,6 +106,7 @@ internal class ChildLegalEntityCreateTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -122,8 +123,22 @@ internal class ChildLegalEntityCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -265,6 +280,7 @@ internal class ChildLegalEntityCreateTest { .contains(ChildLegalEntityCreate.LegalEntityType.BUSINESS) assertThat(childLegalEntityCreate.legalStructure()) .contains(ChildLegalEntityCreate.LegalStructure.CORPORATION) + assertThat(childLegalEntityCreate.listedExchange()).contains("listed_exchange") assertThat(childLegalEntityCreate.metadata()) .contains( ChildLegalEntityCreate.Metadata.builder() @@ -285,9 +301,25 @@ internal class ChildLegalEntityCreateTest { assertThat(childLegalEntityCreate.prefix()).contains("prefix") assertThat(childLegalEntityCreate.primarySocialMediaSites().getOrNull()) .containsExactly("string") + assertThat(childLegalEntityCreate.regulators().getOrNull()) + .containsExactly( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(childLegalEntityCreate.riskRating()) .contains(ChildLegalEntityCreate.RiskRating.LOW) assertThat(childLegalEntityCreate.suffix()).contains("suffix") + assertThat(childLegalEntityCreate.thirdPartyVerification()) + .contains( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(childLegalEntityCreate.tickerSymbol()).contains("ticker_symbol") assertThat(childLegalEntityCreate.wealthAndEmploymentDetails()) .contains( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() @@ -425,6 +457,7 @@ internal class ChildLegalEntityCreateTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -441,8 +474,22 @@ internal class ChildLegalEntityCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt index 908e73cb..90ea68c6 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt @@ -390,6 +390,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -410,8 +411,24 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -479,6 +496,7 @@ internal class ChildLegalEntityTest { ) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -497,8 +515,22 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -897,6 +929,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -917,8 +950,22 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -983,6 +1030,7 @@ internal class ChildLegalEntityTest { .isEqualTo(ChildLegalEntity.LegalEntityType.BUSINESS) assertThat(childLegalEntity.legalStructure()) .contains(ChildLegalEntity.LegalStructure.CORPORATION) + assertThat(childLegalEntity.listedExchange()).contains("listed_exchange") assertThat(childLegalEntity.liveMode()).isEqualTo(true) assertThat(childLegalEntity.metadata()) .isEqualTo( @@ -1003,8 +1051,24 @@ internal class ChildLegalEntityTest { assertThat(childLegalEntity.preferredName()).contains("preferred_name") assertThat(childLegalEntity.prefix()).contains("prefix") assertThat(childLegalEntity.primarySocialMediaSites()).containsExactly("string") + assertThat(childLegalEntity.regulators().getOrNull()) + .containsExactly( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(childLegalEntity.riskRating()).contains(ChildLegalEntity.RiskRating.LOW) assertThat(childLegalEntity.suffix()).contains("suffix") + assertThat(childLegalEntity.thirdPartyVerification()) + .contains( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(childLegalEntity.tickerSymbol()).contains("ticker_symbol") assertThat(childLegalEntity.updatedAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(childLegalEntity.wealthAndEmploymentDetails()) @@ -1425,6 +1489,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -1445,8 +1510,24 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -1514,6 +1595,7 @@ internal class ChildLegalEntityTest { ) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -1532,8 +1614,22 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt index fd1b2cc0..95e37bc7 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt @@ -213,6 +213,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -234,8 +235,25 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -309,6 +327,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -327,8 +346,27 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail @@ -598,6 +636,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -622,8 +661,26 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -697,6 +754,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -715,8 +773,29 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail @@ -980,6 +1059,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1001,8 +1081,25 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -1076,6 +1173,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1094,8 +1192,27 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index 7f4912da..fb072ec0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -301,6 +301,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -322,8 +323,25 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -394,6 +412,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -412,8 +431,29 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail @@ -784,6 +824,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -808,8 +849,26 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -881,6 +940,7 @@ internal class CounterpartyCreateParamsTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -899,10 +959,31 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail @@ -1265,6 +1346,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1286,8 +1368,25 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -1358,6 +1457,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1376,8 +1476,29 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt index 60550049..572d9f29 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt @@ -109,6 +109,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -127,8 +128,22 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -284,6 +299,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -302,8 +318,24 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -456,6 +488,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -474,8 +507,22 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt index a908f50c..570bbdb3 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt @@ -103,6 +103,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -121,8 +122,24 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -262,6 +279,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -280,8 +298,22 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -427,6 +459,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -445,8 +478,24 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt index a9b71fd1..d2cd7f01 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt @@ -190,6 +190,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -210,8 +211,22 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -439,6 +454,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -457,8 +473,22 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -697,6 +727,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -717,8 +748,22 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt index 516a02b6..7bc1d93a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt @@ -181,6 +181,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -199,8 +200,24 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -256,6 +273,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -272,8 +290,22 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -502,6 +534,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -520,8 +553,25 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -580,6 +630,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -598,8 +649,22 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -820,6 +885,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -838,8 +904,24 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -896,6 +978,7 @@ internal class LegalEntityCreateParamsTest { ) assertThat(body.legalStructure()) .contains(LegalEntityCreateParams.LegalStructure.CORPORATION) + assertThat(body.listedExchange()).contains("listed_exchange") assertThat(body.metadata()) .contains( LegalEntityCreateParams.Metadata.builder() @@ -914,8 +997,24 @@ internal class LegalEntityCreateParamsTest { assertThat(body.preferredName()).contains("preferred_name") assertThat(body.prefix()).contains("prefix") assertThat(body.primarySocialMediaSites().getOrNull()).containsExactly("string") + assertThat(body.regulators().getOrNull()) + .containsExactly( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(body.riskRating()).contains(LegalEntityCreateParams.RiskRating.LOW) assertThat(body.suffix()).contains("suffix") + assertThat(body.thirdPartyVerification()) + .contains( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(body.tickerSymbol()).contains("ticker_symbol") assertThat(body.wealthAndEmploymentDetails()) .contains( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt index 4b808df6..1f892783 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt @@ -177,6 +177,7 @@ internal class LegalEntityTest { .lastName("last_name") .legalEntityType(LegalEntity.LegalEntityType.BUSINESS) .legalStructure(LegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( LegalEntity.Metadata.builder() @@ -195,8 +196,22 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( LegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -447,6 +462,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -467,8 +483,24 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -700,6 +732,7 @@ internal class LegalEntityTest { assertThat(legalEntity.lastName()).contains("last_name") assertThat(legalEntity.legalEntityType()).isEqualTo(LegalEntity.LegalEntityType.BUSINESS) assertThat(legalEntity.legalStructure()).contains(LegalEntity.LegalStructure.CORPORATION) + assertThat(legalEntity.listedExchange()).contains("listed_exchange") assertThat(legalEntity.liveMode()).isEqualTo(true) assertThat(legalEntity.metadata()) .isEqualTo( @@ -718,8 +751,24 @@ internal class LegalEntityTest { assertThat(legalEntity.preferredName()).contains("preferred_name") assertThat(legalEntity.prefix()).contains("prefix") assertThat(legalEntity.primarySocialMediaSites()).containsExactly("string") + assertThat(legalEntity.regulators().getOrNull()) + .containsExactly( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(legalEntity.riskRating()).contains(LegalEntity.RiskRating.LOW) assertThat(legalEntity.suffix()).contains("suffix") + assertThat(legalEntity.thirdPartyVerification()) + .contains( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(legalEntity.tickerSymbol()).contains("ticker_symbol") assertThat(legalEntity.updatedAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(legalEntity.wealthAndEmploymentDetails()) @@ -949,6 +998,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -969,8 +1019,22 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -1198,6 +1262,7 @@ internal class LegalEntityTest { .lastName("last_name") .legalEntityType(LegalEntity.LegalEntityType.BUSINESS) .legalStructure(LegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( LegalEntity.Metadata.builder() @@ -1216,8 +1281,22 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( LegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -1468,6 +1547,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -1488,8 +1568,24 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt index 668d3f6c..05d5efcb 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt @@ -90,6 +90,7 @@ internal class LegalEntityUpdateParamsTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -106,8 +107,22 @@ internal class LegalEntityUpdateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -243,6 +258,7 @@ internal class LegalEntityUpdateParamsTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -261,8 +277,22 @@ internal class LegalEntityUpdateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -390,6 +420,7 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.lastName()).contains("last_name") assertThat(body.legalStructure()) .contains(LegalEntityUpdateParams.LegalStructure.CORPORATION) + assertThat(body.listedExchange()).contains("listed_exchange") assertThat(body.metadata()) .contains( LegalEntityUpdateParams.Metadata.builder() @@ -408,8 +439,24 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.preferredName()).contains("preferred_name") assertThat(body.prefix()).contains("prefix") assertThat(body.primarySocialMediaSites().getOrNull()).containsExactly("string") + assertThat(body.regulators().getOrNull()) + .containsExactly( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(body.riskRating()).contains(LegalEntityUpdateParams.RiskRating.LOW) assertThat(body.suffix()).contains("suffix") + assertThat(body.thirdPartyVerification()) + .contains( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(body.tickerSymbol()).contains("ticker_symbol") assertThat(body.wealthAndEmploymentDetails()) .contains( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 5e40e52a..99cdfb5b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -351,6 +351,7 @@ internal class ServiceParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -375,8 +376,26 @@ internal class ServiceParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -448,6 +467,7 @@ internal class ServiceParamsTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -466,10 +486,31 @@ internal class ServiceParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt index eae938c1..1464d462 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt @@ -267,6 +267,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -294,8 +295,29 @@ internal class ConnectionLegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -378,6 +400,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -396,10 +419,31 @@ internal class ConnectionLegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index 95ed8a4f..d14f441a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -373,6 +373,7 @@ internal class CounterpartyServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -400,8 +401,29 @@ internal class CounterpartyServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -480,6 +502,7 @@ internal class CounterpartyServiceAsyncTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -499,10 +522,33 @@ internal class CounterpartyServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest + .LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt index 325cb2e4..3a223759 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt @@ -135,6 +135,7 @@ internal class LegalEntityAssociationServiceAsyncTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -153,8 +154,24 @@ internal class LegalEntityAssociationServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt index 2fbc669a..69e6f73b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt @@ -233,6 +233,7 @@ internal class LegalEntityServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -254,8 +255,25 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -324,6 +342,7 @@ internal class LegalEntityServiceAsyncTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -342,8 +361,22 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -503,6 +536,7 @@ internal class LegalEntityServiceAsyncTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -521,8 +555,22 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt index fa8159a3..6d9eca07 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt @@ -267,6 +267,7 @@ internal class ConnectionLegalEntityServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -294,8 +295,29 @@ internal class ConnectionLegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -378,6 +400,7 @@ internal class ConnectionLegalEntityServiceTest { ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -396,10 +419,31 @@ internal class ConnectionLegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index 4d9119ba..05fa5ed2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -373,6 +373,7 @@ internal class CounterpartyServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -400,8 +401,29 @@ internal class CounterpartyServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -480,6 +502,7 @@ internal class CounterpartyServiceTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -499,10 +522,33 @@ internal class CounterpartyServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest + .LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt index 22139fe5..82de9c9f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt @@ -135,6 +135,7 @@ internal class LegalEntityAssociationServiceTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -153,8 +154,24 @@ internal class LegalEntityAssociationServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt index 95a03411..85ecfab2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt @@ -233,6 +233,7 @@ internal class LegalEntityServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -254,8 +255,25 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -324,6 +342,7 @@ internal class LegalEntityServiceTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -342,8 +361,22 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -501,6 +534,7 @@ internal class LegalEntityServiceTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -519,8 +553,22 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") From 9235076457a287b3e6ed6746d9d4ec15f4f18799 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:29:43 +0000 Subject: [PATCH 16/27] chore(client): improve example values --- .../api/models/BalanceReportRetrieveParamsTest.kt | 6 +++--- .../async/internalAccounts/BalanceReportServiceAsyncTest.kt | 2 +- .../blocking/internalAccounts/BalanceReportServiceTest.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt index 6a7f239c..a5e8b0c2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt @@ -11,7 +11,7 @@ internal class BalanceReportRetrieveParamsTest { fun create() { BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() } @@ -20,11 +20,11 @@ internal class BalanceReportRetrieveParamsTest { val params = BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() assertThat(params._pathParam(0)).isEqualTo("internal_account_id") - assertThat(params._pathParam(1)).isEqualTo("string") + assertThat(params._pathParam(1)).isEqualTo("latest") // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt index 9ff74ef6..44b7e4ec 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt @@ -63,7 +63,7 @@ internal class BalanceReportServiceAsyncTest { balanceReportServiceAsync.retrieve( BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt index 043093aa..7ab1790e 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt @@ -62,7 +62,7 @@ internal class BalanceReportServiceTest { balanceReportService.retrieve( BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() ) From 611eed44fe5aefa6f34f3877bbaf6d618d22c864 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:36:23 +0000 Subject: [PATCH 17/27] fix(docs): fix mcp installation instructions for remote servers --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1144d66d..764b5995 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The Modern Treasury Java SDK is similar to the Modern Treasury Kotlin SDK but wi Use the Modern Treasury MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXSwiZW52Ijp7Ik1PREVSTl9UUkVBU1VSWV9BUElfS0VZIjoiTXkgQVBJIEtleSIsIk1PREVSTl9UUkVBU1VSWV9PUkdBTklaQVRJT05fSUQiOiJteS1vcmdhbml6YXRpb24tSUQiLCJNT0RFUk5fVFJFQVNVUllfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%2C%22env%22%3A%7B%22MODERN_TREASURY_API_KEY%22%3A%22My%20API%20Key%22%2C%22MODERN_TREASURY_ORGANIZATION_ID%22%3A%22my-organization-ID%22%2C%22MODERN_TREASURY_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D) > Note: You may need to set environment variables in your MCP client. From 9cd6197fcfd104bb4a139105620f3cc7065fd5df Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 22:41:21 +0000 Subject: [PATCH 18/27] chore(internal): allow passing args to `./scripts/test` --- scripts/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index f4063482..16a2b00d 100755 --- a/scripts/build +++ b/scripts/build @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Building classes" -./gradlew build testClasses -x test +./gradlew build testClasses "$@" -x test From 90660fedbfb03f5a991e7a470a76e2cdcffd06cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 23:23:26 +0000 Subject: [PATCH 19/27] feat(api): api update --- .stats.yml | 4 +- .../api/models/IncomingPaymentDetail.kt | 169 +++++++++++++++++- .../api/models/IncomingPaymentDetailTest.kt | 53 ++++++ 3 files changed, 222 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index d70d0999..b20de802 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-d8140aaa2f4b9b2fd803a2135c87078d7081b3fdac301913eb1263d0a4ee794d.yml -openapi_spec_hash: b5ff512582cc4da8d4cd625ef651bc84 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-3704615933ba38dcde41513f88b894dc101467d2d4baee175a0e4a58774f1343.yml +openapi_spec_hash: e96f06509912fb5fe6dc11a4209e89e6 config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt index e422d37e..204ae77a 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt @@ -50,6 +50,9 @@ private constructor( private val virtualAccount: JsonField, private val virtualAccountId: JsonField, private val originatingAccountNumber: JsonField, + private val originatingPartyAddress: JsonField
, + private val originatingPartyName: JsonField, + private val originatingPartyVendorIdentifier: JsonField, private val additionalProperties: MutableMap, ) { @@ -113,6 +116,15 @@ private constructor( @JsonProperty("originating_account_number") @ExcludeMissing originatingAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("originating_party_address") + @ExcludeMissing + originatingPartyAddress: JsonField
= JsonMissing.of(), + @JsonProperty("originating_party_name") + @ExcludeMissing + originatingPartyName: JsonField = JsonMissing.of(), + @JsonProperty("originating_party_vendor_identifier") + @ExcludeMissing + originatingPartyVendorIdentifier: JsonField = JsonMissing.of(), ) : this( id, amount, @@ -140,6 +152,9 @@ private constructor( virtualAccount, virtualAccountId, originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, mutableMapOf(), ) @@ -354,6 +369,34 @@ private constructor( fun originatingAccountNumber(): Optional = originatingAccountNumber.getOptional("originating_account_number") + /** + * The address of the originating party for the incoming payment detail, or `null`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyAddress(): Optional
= + originatingPartyAddress.getOptional("originating_party_address") + + /** + * The name of the originating party for the incoming payment detail. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyName(): Optional = + originatingPartyName.getOptional("originating_party_name") + + /** + * The vendor-assigned identifier for the originating party of the incoming payment detail, or + * `null`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyVendorIdentifier(): Optional = + originatingPartyVendorIdentifier.getOptional("originating_party_vendor_identifier") + /** * Returns the raw JSON value of [id]. * @@ -578,6 +621,36 @@ private constructor( @ExcludeMissing fun _originatingAccountNumber(): JsonField = originatingAccountNumber + /** + * Returns the raw JSON value of [originatingPartyAddress]. + * + * Unlike [originatingPartyAddress], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("originating_party_address") + @ExcludeMissing + fun _originatingPartyAddress(): JsonField
= originatingPartyAddress + + /** + * Returns the raw JSON value of [originatingPartyName]. + * + * Unlike [originatingPartyName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("originating_party_name") + @ExcludeMissing + fun _originatingPartyName(): JsonField = originatingPartyName + + /** + * Returns the raw JSON value of [originatingPartyVendorIdentifier]. + * + * Unlike [originatingPartyVendorIdentifier], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("originating_party_vendor_identifier") + @ExcludeMissing + fun _originatingPartyVendorIdentifier(): JsonField = originatingPartyVendorIdentifier + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -656,6 +729,9 @@ private constructor( private var virtualAccount: JsonField? = null private var virtualAccountId: JsonField? = null private var originatingAccountNumber: JsonField = JsonMissing.of() + private var originatingPartyAddress: JsonField
= JsonMissing.of() + private var originatingPartyName: JsonField = JsonMissing.of() + private var originatingPartyVendorIdentifier: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -686,6 +762,10 @@ private constructor( virtualAccount = incomingPaymentDetail.virtualAccount virtualAccountId = incomingPaymentDetail.virtualAccountId originatingAccountNumber = incomingPaymentDetail.originatingAccountNumber + originatingPartyAddress = incomingPaymentDetail.originatingPartyAddress + originatingPartyName = incomingPaymentDetail.originatingPartyName + originatingPartyVendorIdentifier = + incomingPaymentDetail.originatingPartyVendorIdentifier additionalProperties = incomingPaymentDetail.additionalProperties.toMutableMap() } @@ -1110,6 +1190,76 @@ private constructor( this.originatingAccountNumber = originatingAccountNumber } + /** The address of the originating party for the incoming payment detail, or `null`. */ + fun originatingPartyAddress(originatingPartyAddress: Address?) = + originatingPartyAddress(JsonField.ofNullable(originatingPartyAddress)) + + /** + * Alias for calling [Builder.originatingPartyAddress] with + * `originatingPartyAddress.orElse(null)`. + */ + fun originatingPartyAddress(originatingPartyAddress: Optional
) = + originatingPartyAddress(originatingPartyAddress.getOrNull()) + + /** + * Sets [Builder.originatingPartyAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyAddress] with a well-typed [Address] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun originatingPartyAddress(originatingPartyAddress: JsonField
) = apply { + this.originatingPartyAddress = originatingPartyAddress + } + + /** The name of the originating party for the incoming payment detail. */ + fun originatingPartyName(originatingPartyName: String?) = + originatingPartyName(JsonField.ofNullable(originatingPartyName)) + + /** + * Alias for calling [Builder.originatingPartyName] with + * `originatingPartyName.orElse(null)`. + */ + fun originatingPartyName(originatingPartyName: Optional) = + originatingPartyName(originatingPartyName.getOrNull()) + + /** + * Sets [Builder.originatingPartyName] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun originatingPartyName(originatingPartyName: JsonField) = apply { + this.originatingPartyName = originatingPartyName + } + + /** + * The vendor-assigned identifier for the originating party of the incoming payment detail, + * or `null`. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: String?) = + originatingPartyVendorIdentifier(JsonField.ofNullable(originatingPartyVendorIdentifier)) + + /** + * Alias for calling [Builder.originatingPartyVendorIdentifier] with + * `originatingPartyVendorIdentifier.orElse(null)`. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: Optional) = + originatingPartyVendorIdentifier(originatingPartyVendorIdentifier.getOrNull()) + + /** + * Sets [Builder.originatingPartyVendorIdentifier] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyVendorIdentifier] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: JsonField) = + apply { + this.originatingPartyVendorIdentifier = originatingPartyVendorIdentifier + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1193,6 +1343,9 @@ private constructor( checkRequired("virtualAccount", virtualAccount), checkRequired("virtualAccountId", virtualAccountId), originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, additionalProperties.toMutableMap(), ) } @@ -1230,6 +1383,9 @@ private constructor( virtualAccount().ifPresent { it.validate() } virtualAccountId() originatingAccountNumber() + originatingPartyAddress().ifPresent { it.validate() } + originatingPartyName() + originatingPartyVendorIdentifier() validated = true } @@ -1273,7 +1429,10 @@ private constructor( (if (vendorId.asKnown().isPresent) 1 else 0) + (virtualAccount.asKnown().getOrNull()?.validity() ?: 0) + (if (virtualAccountId.asKnown().isPresent) 1 else 0) + - (if (originatingAccountNumber.asKnown().isPresent) 1 else 0) + (if (originatingAccountNumber.asKnown().isPresent) 1 else 0) + + (originatingPartyAddress.asKnown().getOrNull()?.validity() ?: 0) + + (if (originatingPartyName.asKnown().isPresent) 1 else 0) + + (if (originatingPartyVendorIdentifier.asKnown().isPresent) 1 else 0) /** The raw data from the payment pre-notification file that we get from the bank. */ class Data @@ -2483,6 +2642,9 @@ private constructor( virtualAccount == other.virtualAccount && virtualAccountId == other.virtualAccountId && originatingAccountNumber == other.originatingAccountNumber && + originatingPartyAddress == other.originatingPartyAddress && + originatingPartyName == other.originatingPartyName && + originatingPartyVendorIdentifier == other.originatingPartyVendorIdentifier && additionalProperties == other.additionalProperties } @@ -2514,6 +2676,9 @@ private constructor( virtualAccount, virtualAccountId, originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, additionalProperties, ) } @@ -2521,5 +2686,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IncomingPaymentDetail{id=$id, amount=$amount, asOfDate=$asOfDate, createdAt=$createdAt, currency=$currency, data=$data, direction=$direction, internalAccountId=$internalAccountId, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, object_=$object_, originatingAccountNumberSafe=$originatingAccountNumberSafe, originatingAccountNumberType=$originatingAccountNumberType, originatingRoutingNumber=$originatingRoutingNumber, originatingRoutingNumberType=$originatingRoutingNumberType, reconciliationStatus=$reconciliationStatus, status=$status, transactionId=$transactionId, transactionLineItemId=$transactionLineItemId, type=$type, updatedAt=$updatedAt, vendorId=$vendorId, virtualAccount=$virtualAccount, virtualAccountId=$virtualAccountId, originatingAccountNumber=$originatingAccountNumber, additionalProperties=$additionalProperties}" + "IncomingPaymentDetail{id=$id, amount=$amount, asOfDate=$asOfDate, createdAt=$createdAt, currency=$currency, data=$data, direction=$direction, internalAccountId=$internalAccountId, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, object_=$object_, originatingAccountNumberSafe=$originatingAccountNumberSafe, originatingAccountNumberType=$originatingAccountNumberType, originatingRoutingNumber=$originatingRoutingNumber, originatingRoutingNumberType=$originatingRoutingNumberType, reconciliationStatus=$reconciliationStatus, status=$status, transactionId=$transactionId, transactionLineItemId=$transactionLineItemId, type=$type, updatedAt=$updatedAt, vendorId=$vendorId, virtualAccount=$virtualAccount, virtualAccountId=$virtualAccountId, originatingAccountNumber=$originatingAccountNumber, originatingPartyAddress=$originatingPartyAddress, originatingPartyName=$originatingPartyName, originatingPartyVendorIdentifier=$originatingPartyVendorIdentifier, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt index 5ae2460a..2d2ec274 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt @@ -121,6 +121,23 @@ internal class IncomingPaymentDetailTest { ) .virtualAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .originatingAccountNumber("originating_account_number") + .originatingPartyAddress( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .originatingPartyName("originating_party_name") + .originatingPartyVendorIdentifier("originating_party_vendor_identifier") .build() assertThat(incomingPaymentDetail.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -241,6 +258,25 @@ internal class IncomingPaymentDetailTest { .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(incomingPaymentDetail.originatingAccountNumber()) .contains("originating_account_number") + assertThat(incomingPaymentDetail.originatingPartyAddress()) + .contains( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + assertThat(incomingPaymentDetail.originatingPartyName()).contains("originating_party_name") + assertThat(incomingPaymentDetail.originatingPartyVendorIdentifier()) + .contains("originating_party_vendor_identifier") } @Test @@ -353,6 +389,23 @@ internal class IncomingPaymentDetailTest { ) .virtualAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .originatingAccountNumber("originating_account_number") + .originatingPartyAddress( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .originatingPartyName("originating_party_name") + .originatingPartyVendorIdentifier("originating_party_vendor_identifier") .build() val roundtrippedIncomingPaymentDetail = From 75c34880a3598ff9c1d70a01c6cb7b60942a4d14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 20:23:26 +0000 Subject: [PATCH 20/27] feat(api): api update --- .stats.yml | 4 +- .../api/models/ChildLegalEntity.kt | 185 ++++++++++++++- .../api/models/ChildLegalEntityCreate.kt | 183 ++++++++++++++- .../ConnectionLegalEntityCreateParams.kt | 189 ++++++++++++++- .../api/models/CounterpartyCreateParams.kt | 189 ++++++++++++++- .../moderntreasury/api/models/LegalEntity.kt | 185 ++++++++++++++- .../api/models/LegalEntityCreateParams.kt | 216 +++++++++++++++++- .../api/models/LegalEntityListParams.kt | 155 ++++++++++++- .../api/models/LegalEntityUpdateParams.kt | 216 +++++++++++++++++- .../api/models/ChildLegalEntityCreateTest.kt | 3 + .../api/models/ChildLegalEntityTest.kt | 6 + .../ConnectionLegalEntityCreateParamsTest.kt | 6 + .../models/CounterpartyCreateParamsTest.kt | 6 + .../LegalEntityAssociationCreateParamsTest.kt | 3 + .../LegalEntityAssociationInlineCreateTest.kt | 3 + .../api/models/LegalEntityAssociationTest.kt | 3 + .../api/models/LegalEntityCreateParamsTest.kt | 6 + .../api/models/LegalEntityListParamsTest.kt | 3 + .../api/models/LegalEntityTest.kt | 6 + .../api/models/LegalEntityUpdateParamsTest.kt | 3 + .../api/services/ServiceParamsTest.kt | 2 + .../ConnectionLegalEntityServiceAsyncTest.kt | 2 + .../async/CounterpartyServiceAsyncTest.kt | 2 + .../LegalEntityAssociationServiceAsyncTest.kt | 1 + .../async/LegalEntityServiceAsyncTest.kt | 3 + .../ConnectionLegalEntityServiceTest.kt | 2 + .../blocking/CounterpartyServiceTest.kt | 2 + .../LegalEntityAssociationServiceTest.kt | 1 + .../blocking/LegalEntityServiceTest.kt | 3 + 29 files changed, 1578 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index b20de802..720060d9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-3704615933ba38dcde41513f88b894dc101467d2d4baee175a0e4a58774f1343.yml -openapi_spec_hash: e96f06509912fb5fe6dc11a4209e89e6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-2447552f3c4fb0bca7b73774333098a01857ded98c0bd581d02385ee1ef29996.yml +openapi_spec_hash: eae03289efeec45844cd66747f5c782e config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt index e6154e19..cdc3245c 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt @@ -62,6 +62,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -169,6 +170,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -221,6 +223,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -521,6 +524,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -895,6 +906,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -1004,6 +1022,7 @@ private constructor( * .primarySocialMediaSites() * .regulators() * .riskRating() + * .status() * .suffix() * .thirdPartyVerification() * .tickerSymbol() @@ -1057,6 +1076,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField? = null + private var status: JsonField? = null private var suffix: JsonField? = null private var thirdPartyVerification: JsonField? = null private var tickerSymbol: JsonField? = null @@ -1108,6 +1128,7 @@ private constructor( childLegalEntity.primarySocialMediaSites.map { it.toMutableList() } regulators = childLegalEntity.regulators.map { it.toMutableList() } riskRating = childLegalEntity.riskRating + status = childLegalEntity.status suffix = childLegalEntity.suffix thirdPartyVerification = childLegalEntity.thirdPartyVerification tickerSymbol = childLegalEntity.tickerSymbol @@ -1865,6 +1886,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2030,6 +2067,7 @@ private constructor( * .primarySocialMediaSites() * .regulators() * .riskRating() + * .status() * .suffix() * .thirdPartyVerification() * .tickerSymbol() @@ -2089,6 +2127,7 @@ private constructor( }, checkRequired("regulators", regulators).map { it.toImmutable() }, checkRequired("riskRating", riskRating), + checkRequired("status", status), checkRequired("suffix", suffix), checkRequired("thirdPartyVerification", thirdPartyVerification), checkRequired("tickerSymbol", tickerSymbol), @@ -2143,6 +2182,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -2204,6 +2244,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -5486,6 +5527,146 @@ private constructor( override fun toString() = value.toString() } + /** The activation status of the legal entity. One of pending, active, suspended, or closed. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8085,6 +8266,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -8133,6 +8315,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -8146,5 +8329,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt index c45cc15f..31af57a8 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt @@ -57,6 +57,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -155,6 +156,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -199,6 +201,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -473,6 +476,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -802,6 +813,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -903,6 +921,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() private var thirdPartyVerification: JsonField = JsonMissing.of() private var tickerSymbol: JsonField = JsonMissing.of() @@ -950,6 +969,7 @@ private constructor( childLegalEntityCreate.primarySocialMediaSites.map { it.toMutableList() } regulators = childLegalEntityCreate.regulators.map { it.toMutableList() } riskRating = childLegalEntityCreate.riskRating + status = childLegalEntityCreate.status suffix = childLegalEntityCreate.suffix thirdPartyVerification = childLegalEntityCreate.thirdPartyVerification tickerSymbol = childLegalEntityCreate.tickerSymbol @@ -1642,6 +1662,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -1791,6 +1827,7 @@ private constructor( (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -1839,6 +1876,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -1894,6 +1932,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -3454,6 +3493,146 @@ private constructor( override fun toString() = value.toString() } + /** The activation status of the legal entity. One of pending, active, suspended, or closed. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6048,6 +6227,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -6090,6 +6270,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -6102,5 +6283,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt index bace0e1f..e0c09135 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt @@ -608,6 +608,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -712,6 +713,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -757,6 +759,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -1034,6 +1037,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -1374,6 +1385,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -1476,6 +1494,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() private var thirdPartyVerification: JsonField = JsonMissing.of() private var tickerSymbol: JsonField = JsonMissing.of() @@ -1522,6 +1541,7 @@ private constructor( legalEntity.primarySocialMediaSites.map { it.toMutableList() } regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating + status = legalEntity.status suffix = legalEntity.suffix thirdPartyVerification = legalEntity.thirdPartyVerification tickerSymbol = legalEntity.tickerSymbol @@ -2239,6 +2259,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2392,6 +2430,7 @@ private constructor( (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -2440,6 +2479,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -2498,6 +2538,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -4103,6 +4144,150 @@ private constructor( override fun toString() = value.toString() } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** + * An enum member indicating that [Status] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6756,6 +6941,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -6798,6 +6984,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -6810,7 +6997,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt index e373aa6b..193d6ae4 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt @@ -3972,6 +3972,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -4076,6 +4077,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -4121,6 +4123,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -4397,6 +4400,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -4737,6 +4748,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -4846,6 +4864,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() private var thirdPartyVerification: JsonField = JsonMissing.of() private var tickerSymbol: JsonField = JsonMissing.of() @@ -4894,6 +4913,7 @@ private constructor( legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating + status = legalEntityCreateRequest.status suffix = legalEntityCreateRequest.suffix thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification tickerSymbol = legalEntityCreateRequest.tickerSymbol @@ -5611,6 +5631,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -5771,6 +5809,7 @@ private constructor( (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -5819,6 +5858,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -5877,6 +5917,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -7482,6 +7523,150 @@ private constructor( override fun toString() = value.toString() } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** + * An enum member indicating that [Status] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -10135,6 +10320,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -10177,6 +10363,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -10189,7 +10376,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt index 9ebc3ced..5f8a0e84 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt @@ -61,6 +61,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -166,6 +167,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -220,6 +222,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -512,6 +515,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -884,6 +895,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -1003,6 +1021,7 @@ private constructor( * .primarySocialMediaSites() * .regulators() * .riskRating() + * .status() * .suffix() * .thirdPartyVerification() * .tickerSymbol() @@ -1055,6 +1074,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField? = null + private var status: JsonField? = null private var suffix: JsonField? = null private var thirdPartyVerification: JsonField? = null private var tickerSymbol: JsonField? = null @@ -1102,6 +1122,7 @@ private constructor( primarySocialMediaSites = legalEntity.primarySocialMediaSites.map { it.toMutableList() } regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating + status = legalEntity.status suffix = legalEntity.suffix thirdPartyVerification = legalEntity.thirdPartyVerification tickerSymbol = legalEntity.tickerSymbol @@ -1823,6 +1844,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2024,6 +2061,7 @@ private constructor( * .primarySocialMediaSites() * .regulators() * .riskRating() + * .status() * .suffix() * .thirdPartyVerification() * .tickerSymbol() @@ -2080,6 +2118,7 @@ private constructor( }, checkRequired("regulators", regulators).map { it.toImmutable() }, checkRequired("riskRating", riskRating), + checkRequired("status", status), checkRequired("suffix", suffix), checkRequired("thirdPartyVerification", thirdPartyVerification), checkRequired("tickerSymbol", tickerSymbol), @@ -2134,6 +2173,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -2195,6 +2235,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -5478,6 +5519,146 @@ private constructor( override fun toString() = value.toString() } + /** The activation status of the legal entity. One of pending, active, suspended, or closed. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8076,6 +8257,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -8124,6 +8306,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -8138,5 +8321,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" + "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt index d2113435..b53ec042 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt @@ -287,6 +287,14 @@ private constructor( */ fun riskRating(): Optional = body.riskRating() + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = body.status() + /** * An individual's suffix. * @@ -563,6 +571,13 @@ private constructor( */ fun _riskRating(): JsonField = body._riskRating() + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + /** * Returns the raw JSON value of [suffix]. * @@ -1315,6 +1330,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { body.riskRating(riskRating) } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = apply { body.status(status) } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { body.status(status) } + /** An individual's suffix. */ fun suffix(suffix: String?) = apply { body.suffix(suffix) } @@ -1585,6 +1616,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -1689,6 +1721,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -1734,6 +1767,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -2010,6 +2044,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -2350,6 +2392,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -2459,6 +2508,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() private var thirdPartyVerification: JsonField = JsonMissing.of() private var tickerSymbol: JsonField = JsonMissing.of() @@ -2507,6 +2557,7 @@ private constructor( legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating + status = legalEntityCreateRequest.status suffix = legalEntityCreateRequest.suffix thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification tickerSymbol = legalEntityCreateRequest.tickerSymbol @@ -3224,6 +3275,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -3384,6 +3453,7 @@ private constructor( (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -3432,6 +3502,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -3490,6 +3561,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -3534,6 +3606,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -3576,6 +3649,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -3588,7 +3662,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -5145,6 +5219,146 @@ private constructor( override fun toString() = value.toString() } + /** The activation status of the legal entity. One of pending, active, suspended, or closed. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt index 350c3cc0..57c33d00 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt @@ -21,6 +21,7 @@ private constructor( private val metadata: Metadata?, private val perPage: Long?, private val showDeleted: String?, + private val status: Status?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -39,6 +40,8 @@ private constructor( fun showDeleted(): Optional = Optional.ofNullable(showDeleted) + fun status(): Optional = Optional.ofNullable(status) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -63,6 +66,7 @@ private constructor( private var metadata: Metadata? = null private var perPage: Long? = null private var showDeleted: String? = null + private var status: Status? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -73,6 +77,7 @@ private constructor( metadata = legalEntityListParams.metadata perPage = legalEntityListParams.perPage showDeleted = legalEntityListParams.showDeleted + status = legalEntityListParams.status additionalHeaders = legalEntityListParams.additionalHeaders.toBuilder() additionalQueryParams = legalEntityListParams.additionalQueryParams.toBuilder() } @@ -116,6 +121,11 @@ private constructor( /** Alias for calling [Builder.showDeleted] with `showDeleted.orElse(null)`. */ fun showDeleted(showDeleted: Optional) = showDeleted(showDeleted.getOrNull()) + fun status(status: Status?) = apply { this.status = status } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -226,6 +236,7 @@ private constructor( metadata, perPage, showDeleted, + status, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -247,6 +258,7 @@ private constructor( } perPage?.let { put("per_page", it.toString()) } showDeleted?.let { put("show_deleted", it) } + status?.let { put("status", it.toString()) } putAll(additionalQueryParams) } .build() @@ -481,6 +493,145 @@ private constructor( override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PENDING = of("pending") + + @JvmField val ACTIVE = of("active") + + @JvmField val SUSPENDED = of("suspended") + + @JvmField val CLOSED = of("closed") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + PENDING, + ACTIVE, + SUSPENDED, + CLOSED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PENDING, + ACTIVE, + SUSPENDED, + CLOSED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING -> Value.PENDING + ACTIVE -> Value.ACTIVE + SUSPENDED -> Value.SUSPENDED + CLOSED -> Value.CLOSED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PENDING -> Known.PENDING + ACTIVE -> Known.ACTIVE + SUSPENDED -> Known.SUSPENDED + CLOSED -> Known.CLOSED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -492,6 +643,7 @@ private constructor( metadata == other.metadata && perPage == other.perPage && showDeleted == other.showDeleted && + status == other.status && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -503,10 +655,11 @@ private constructor( metadata, perPage, showDeleted, + status, additionalHeaders, additionalQueryParams, ) override fun toString() = - "LegalEntityListParams{afterCursor=$afterCursor, legalEntityType=$legalEntityType, metadata=$metadata, perPage=$perPage, showDeleted=$showDeleted, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LegalEntityListParams{afterCursor=$afterCursor, legalEntityType=$legalEntityType, metadata=$metadata, perPage=$perPage, showDeleted=$showDeleted, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt index 4b76e2f1..7949c45b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt @@ -262,6 +262,14 @@ private constructor( */ fun riskRating(): Optional = body.riskRating() + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = body.status() + /** * An individual's suffix. * @@ -515,6 +523,13 @@ private constructor( */ fun _riskRating(): JsonField = body._riskRating() + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + /** * Returns the raw JSON value of [suffix]. * @@ -1197,6 +1212,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { body.riskRating(riskRating) } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = apply { body.status(status) } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { body.status(status) } + /** An individual's suffix. */ fun suffix(suffix: String?) = apply { body.suffix(suffix) } @@ -1464,6 +1495,7 @@ private constructor( private val primarySocialMediaSites: JsonField>, private val regulators: JsonField>, private val riskRating: JsonField, + private val status: JsonField, private val suffix: JsonField, private val thirdPartyVerification: JsonField, private val tickerSymbol: JsonField, @@ -1558,6 +1590,7 @@ private constructor( @JsonProperty("risk_rating") @ExcludeMissing riskRating: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("suffix") @ExcludeMissing suffix: JsonField = JsonMissing.of(), @JsonProperty("third_party_verification") @ExcludeMissing @@ -1600,6 +1633,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -1848,6 +1882,14 @@ private constructor( */ fun riskRating(): Optional = riskRating.getOptional("risk_rating") + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * An individual's suffix. * @@ -2157,6 +2199,13 @@ private constructor( @ExcludeMissing fun _riskRating(): JsonField = riskRating + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + /** * Returns the raw JSON value of [suffix]. * @@ -2256,6 +2305,7 @@ private constructor( private var primarySocialMediaSites: JsonField>? = null private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() private var thirdPartyVerification: JsonField = JsonMissing.of() private var tickerSymbol: JsonField = JsonMissing.of() @@ -2300,6 +2350,7 @@ private constructor( legalEntityUpdateRequest.primarySocialMediaSites.map { it.toMutableList() } regulators = legalEntityUpdateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityUpdateRequest.riskRating + status = legalEntityUpdateRequest.status suffix = legalEntityUpdateRequest.suffix thirdPartyVerification = legalEntityUpdateRequest.thirdPartyVerification tickerSymbol = legalEntityUpdateRequest.tickerSymbol @@ -2938,6 +2989,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -3088,6 +3157,7 @@ private constructor( (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -3133,6 +3203,7 @@ private constructor( primarySocialMediaSites() regulators().ifPresent { it.forEach { it.validate() } } riskRating().ifPresent { it.validate() } + status().ifPresent { it.validate() } suffix() thirdPartyVerification().ifPresent { it.validate() } tickerSymbol() @@ -3187,6 +3258,7 @@ private constructor( (primarySocialMediaSites.asKnown().getOrNull()?.size ?: 0) + (regulators.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (riskRating.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (suffix.asKnown().isPresent) 1 else 0) + (thirdPartyVerification.asKnown().getOrNull()?.validity() ?: 0) + (if (tickerSymbol.asKnown().isPresent) 1 else 0) + @@ -3228,6 +3300,7 @@ private constructor( primarySocialMediaSites == other.primarySocialMediaSites && regulators == other.regulators && riskRating == other.riskRating && + status == other.status && suffix == other.suffix && thirdPartyVerification == other.thirdPartyVerification && tickerSymbol == other.tickerSymbol && @@ -3267,6 +3340,7 @@ private constructor( primarySocialMediaSites, regulators, riskRating, + status, suffix, thirdPartyVerification, tickerSymbol, @@ -3279,7 +3353,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } class LegalEntityBankSetting @@ -4704,6 +4778,146 @@ private constructor( override fun toString() = value.toString() } + /** The activation status of the legal entity. One of pending, active, suspended, or closed. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val CLOSED = of("closed") + + @JvmField val PENDING = of("pending") + + @JvmField val SUSPENDED = of("suspended") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ACTIVE, + CLOSED, + PENDING, + SUSPENDED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + CLOSED -> Value.CLOSED + PENDING -> Value.PENDING + SUSPENDED -> Value.SUSPENDED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + CLOSED -> Known.CLOSED + PENDING -> Known.PENDING + SUSPENDED -> Known.SUSPENDED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** Information describing a third-party verification run by an external vendor. */ class ThirdPartyVerification @JsonCreator(mode = JsonCreator.Mode.DISABLED) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt index 9f8eb439..9f7e0bfe 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt @@ -131,6 +131,7 @@ internal class ChildLegalEntityCreateTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -311,6 +312,7 @@ internal class ChildLegalEntityCreateTest { ) assertThat(childLegalEntityCreate.riskRating()) .contains(ChildLegalEntityCreate.RiskRating.LOW) + assertThat(childLegalEntityCreate.status()).contains(ChildLegalEntityCreate.Status.ACTIVE) assertThat(childLegalEntityCreate.suffix()).contains("suffix") assertThat(childLegalEntityCreate.thirdPartyVerification()) .contains( @@ -482,6 +484,7 @@ internal class ChildLegalEntityCreateTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt index 90ea68c6..6b42051f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt @@ -419,6 +419,7 @@ internal class ChildLegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -523,6 +524,7 @@ internal class ChildLegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -958,6 +960,7 @@ internal class ChildLegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -1060,6 +1063,7 @@ internal class ChildLegalEntityTest { .build() ) assertThat(childLegalEntity.riskRating()).contains(ChildLegalEntity.RiskRating.LOW) + assertThat(childLegalEntity.status()).contains(ChildLegalEntity.Status.ACTIVE) assertThat(childLegalEntity.suffix()).contains("suffix") assertThat(childLegalEntity.thirdPartyVerification()) .contains( @@ -1518,6 +1522,7 @@ internal class ChildLegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -1622,6 +1627,7 @@ internal class ChildLegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt index 95e37bc7..f1b8ffbd 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt @@ -243,6 +243,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -354,6 +355,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification @@ -669,6 +671,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -782,6 +785,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification @@ -1089,6 +1093,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -1200,6 +1205,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .build() ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index fb072ec0..1d667e10 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -331,6 +331,7 @@ internal class CounterpartyCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -440,6 +441,7 @@ internal class CounterpartyCreateParamsTest { .build() ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification @@ -857,6 +859,7 @@ internal class CounterpartyCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -970,6 +973,7 @@ internal class CounterpartyCreateParamsTest { .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification @@ -1376,6 +1380,7 @@ internal class CounterpartyCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -1485,6 +1490,7 @@ internal class CounterpartyCreateParamsTest { .build() ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt index 572d9f29..6eab9b31 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt @@ -136,6 +136,7 @@ internal class LegalEntityAssociationCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -326,6 +327,7 @@ internal class LegalEntityAssociationCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -515,6 +517,7 @@ internal class LegalEntityAssociationCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt index 570bbdb3..d1dacf18 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt @@ -130,6 +130,7 @@ internal class LegalEntityAssociationInlineCreateTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -306,6 +307,7 @@ internal class LegalEntityAssociationInlineCreateTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -486,6 +488,7 @@ internal class LegalEntityAssociationInlineCreateTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt index d2cd7f01..5aa53d73 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt @@ -219,6 +219,7 @@ internal class LegalEntityAssociationTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -481,6 +482,7 @@ internal class LegalEntityAssociationTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -756,6 +758,7 @@ internal class LegalEntityAssociationTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt index 7bc1d93a..1cb1e9ff 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt @@ -208,6 +208,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -298,6 +299,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityCreateParams.ThirdPartyVerification.builder() @@ -561,6 +563,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -657,6 +660,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityCreateParams.ThirdPartyVerification.builder() @@ -912,6 +916,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -1006,6 +1011,7 @@ internal class LegalEntityCreateParamsTest { .build() ) assertThat(body.riskRating()).contains(LegalEntityCreateParams.RiskRating.LOW) + assertThat(body.status()).contains(LegalEntityCreateParams.Status.ACTIVE) assertThat(body.suffix()).contains("suffix") assertThat(body.thirdPartyVerification()) .contains( diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt index 09b64475..84e7aac6 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt @@ -20,6 +20,7 @@ internal class LegalEntityListParamsTest { ) .perPage(0L) .showDeleted("show_deleted") + .status(LegalEntityListParams.Status.PENDING) .build() } @@ -36,6 +37,7 @@ internal class LegalEntityListParamsTest { ) .perPage(0L) .showDeleted("show_deleted") + .status(LegalEntityListParams.Status.PENDING) .build() val queryParams = params._queryParams() @@ -48,6 +50,7 @@ internal class LegalEntityListParamsTest { .put("metadata[foo]", "string") .put("per_page", "0") .put("show_deleted", "show_deleted") + .put("status", "pending") .build() ) } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt index 1f892783..fd140fda 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt @@ -204,6 +204,7 @@ internal class LegalEntityTest { .build() ) .riskRating(LegalEntity.RiskRating.LOW) + .status(LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntity.ThirdPartyVerification.builder() @@ -491,6 +492,7 @@ internal class LegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -760,6 +762,7 @@ internal class LegalEntityTest { .build() ) assertThat(legalEntity.riskRating()).contains(LegalEntity.RiskRating.LOW) + assertThat(legalEntity.status()).contains(LegalEntity.Status.ACTIVE) assertThat(legalEntity.suffix()).contains("suffix") assertThat(legalEntity.thirdPartyVerification()) .contains( @@ -1027,6 +1030,7 @@ internal class LegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() @@ -1289,6 +1293,7 @@ internal class LegalEntityTest { .build() ) .riskRating(LegalEntity.RiskRating.LOW) + .status(LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntity.ThirdPartyVerification.builder() @@ -1576,6 +1581,7 @@ internal class LegalEntityTest { .build() ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntity.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt index 05d5efcb..d3a9300f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt @@ -115,6 +115,7 @@ internal class LegalEntityUpdateParamsTest { .build() ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityUpdateParams.ThirdPartyVerification.builder() @@ -285,6 +286,7 @@ internal class LegalEntityUpdateParamsTest { .build() ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityUpdateParams.ThirdPartyVerification.builder() @@ -448,6 +450,7 @@ internal class LegalEntityUpdateParamsTest { .build() ) assertThat(body.riskRating()).contains(LegalEntityUpdateParams.RiskRating.LOW) + assertThat(body.status()).contains(LegalEntityUpdateParams.Status.ACTIVE) assertThat(body.suffix()).contains("suffix") assertThat(body.thirdPartyVerification()) .contains( diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 99cdfb5b..00ae7071 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -384,6 +384,7 @@ internal class ServiceParamsTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -497,6 +498,7 @@ internal class ServiceParamsTest { .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt index 1464d462..83e75ea5 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt @@ -304,6 +304,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification @@ -430,6 +431,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index d14f441a..f4f87c26 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -410,6 +410,7 @@ internal class CounterpartyServiceAsyncTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification @@ -534,6 +535,7 @@ internal class CounterpartyServiceAsyncTest { .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt index 3a223759..48eb7d4a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt @@ -162,6 +162,7 @@ internal class LegalEntityAssociationServiceAsyncTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt index 69e6f73b..16032d92 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt @@ -263,6 +263,7 @@ internal class LegalEntityServiceAsyncTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -369,6 +370,7 @@ internal class LegalEntityServiceAsyncTest { .build() ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityCreateParams.ThirdPartyVerification.builder() @@ -563,6 +565,7 @@ internal class LegalEntityServiceAsyncTest { .build() ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityUpdateParams.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt index 6d9eca07..4d80399a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt @@ -304,6 +304,7 @@ internal class ConnectionLegalEntityServiceTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification @@ -430,6 +431,7 @@ internal class ConnectionLegalEntityServiceTest { .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index 05fa5ed2..de18d81b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -410,6 +410,7 @@ internal class CounterpartyServiceTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification @@ -534,6 +535,7 @@ internal class CounterpartyServiceTest { .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( CounterpartyCreateParams.LegalEntityCreateRequest diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt index 82de9c9f..7e322615 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt @@ -162,6 +162,7 @@ internal class LegalEntityAssociationServiceTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt index 85ecfab2..fd480528 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt @@ -263,6 +263,7 @@ internal class LegalEntityServiceTest { .build() ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( ChildLegalEntityCreate.ThirdPartyVerification.builder() @@ -369,6 +370,7 @@ internal class LegalEntityServiceTest { .build() ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityCreateParams.ThirdPartyVerification.builder() @@ -561,6 +563,7 @@ internal class LegalEntityServiceTest { .build() ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") .thirdPartyVerification( LegalEntityUpdateParams.ThirdPartyVerification.builder() From 9984da52ae74a9b1629489d385def66853738e59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 20:52:35 +0000 Subject: [PATCH 21/27] chore(internal): upgrade AssertJ --- modern-treasury-java-client-okhttp/build.gradle.kts | 2 +- modern-treasury-java-core/build.gradle.kts | 2 +- modern-treasury-java-proguard-test/build.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modern-treasury-java-client-okhttp/build.gradle.kts b/modern-treasury-java-client-okhttp/build.gradle.kts index 205e7798..12a1a82f 100644 --- a/modern-treasury-java-client-okhttp/build.gradle.kts +++ b/modern-treasury-java-client-okhttp/build.gradle.kts @@ -10,6 +10,6 @@ dependencies { implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") testImplementation(kotlin("test")) - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") } diff --git a/modern-treasury-java-core/build.gradle.kts b/modern-treasury-java-core/build.gradle.kts index 37cd91a2..865d8b73 100644 --- a/modern-treasury-java-core/build.gradle.kts +++ b/modern-treasury-java-core/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { testImplementation(kotlin("test")) testImplementation(project(":modern-treasury-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3") testImplementation("org.junit-pioneer:junit-pioneer:1.9.1") diff --git a/modern-treasury-java-proguard-test/build.gradle.kts b/modern-treasury-java-proguard-test/build.gradle.kts index b5335010..e410c949 100644 --- a/modern-treasury-java-proguard-test/build.gradle.kts +++ b/modern-treasury-java-proguard-test/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { testImplementation(project(":modern-treasury-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } From 0e988d3abb3f194c78a4bc3136537db1b325049a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 00:22:59 +0000 Subject: [PATCH 22/27] feat(api): api update --- .stats.yml | 4 +- .../LedgerAccountCategoryCreateParams.kt | 76 ++++++++++++++++++- .../api/models/LedgerAccountCreateRequest.kt | 44 ++++++++++- .../api/models/BulkRequestCreateParamsTest.kt | 3 + .../models/CounterpartyCreateParamsTest.kt | 3 + .../models/ExternalAccountCreateParamsTest.kt | 3 + .../LedgerAccountCategoryCreateParamsTest.kt | 3 + .../models/LedgerAccountCreateParamsTest.kt | 3 + .../models/LedgerAccountCreateRequestTest.kt | 3 + .../PaymentOrderCreateAsyncParamsTest.kt | 3 + .../models/PaymentOrderCreateParamsTest.kt | 3 + .../models/PaymentOrderUpdateParamsTest.kt | 3 + .../models/VirtualAccountCreateParamsTest.kt | 3 + .../api/services/ErrorHandlingTest.kt | 17 +++++ .../api/services/ServiceParamsTest.kt | 1 + .../async/BulkRequestServiceAsyncTest.kt | 1 + .../async/CounterpartyServiceAsyncTest.kt | 1 + .../async/ExternalAccountServiceAsyncTest.kt | 1 + .../LedgerAccountCategoryServiceAsyncTest.kt | 1 + .../async/LedgerAccountServiceAsyncTest.kt | 1 + .../async/PaymentOrderServiceAsyncTest.kt | 3 + .../async/VirtualAccountServiceAsyncTest.kt | 1 + .../blocking/BulkRequestServiceTest.kt | 1 + .../blocking/CounterpartyServiceTest.kt | 1 + .../blocking/ExternalAccountServiceTest.kt | 1 + .../LedgerAccountCategoryServiceTest.kt | 1 + .../blocking/LedgerAccountServiceTest.kt | 1 + .../blocking/PaymentOrderServiceTest.kt | 3 + .../blocking/VirtualAccountServiceTest.kt | 1 + 29 files changed, 186 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 720060d9..32b59e14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-2447552f3c4fb0bca7b73774333098a01857ded98c0bd581d02385ee1ef29996.yml -openapi_spec_hash: eae03289efeec45844cd66747f5c782e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-01390b6789af65c5b8e71531455f173bda9633dbf7e8dca0c71b41da4807ca70.yml +openapi_spec_hash: 2e7ae98bd7950304cd08889380f532ab config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt index 776fe504..8ed27e5d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt @@ -78,6 +78,14 @@ private constructor( */ fun description(): Optional = body.description() + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalId(): Optional = body.externalId() + /** * The array of ledger account category ids that this ledger account category should be a child * of. @@ -138,6 +146,13 @@ private constructor( */ fun _description(): JsonField = body._description() + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _externalId(): JsonField = body._externalId() + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -302,6 +317,21 @@ private constructor( */ fun description(description: JsonField) = apply { body.description(description) } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = apply { body.externalId(externalId) } + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun externalId(externalId: JsonField) = apply { body.externalId(externalId) } + /** * The array of ledger account category ids that this ledger account category should be a * child of. @@ -499,6 +529,7 @@ private constructor( private val normalBalance: JsonField, private val currencyExponent: JsonField, private val description: JsonField, + private val externalId: JsonField, private val ledgerAccountCategoryIds: JsonField>, private val metadata: JsonField, private val additionalProperties: MutableMap, @@ -522,6 +553,9 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), @JsonProperty("ledger_account_category_ids") @ExcludeMissing ledgerAccountCategoryIds: JsonField> = JsonMissing.of(), @@ -535,6 +569,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, metadata, mutableMapOf(), @@ -588,6 +623,14 @@ private constructor( */ fun description(): Optional = description.getOptional("description") + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + /** * The array of ledger account category ids that this ledger account category should be a * child of. @@ -656,6 +699,15 @@ private constructor( @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("external_id") + @ExcludeMissing + fun _externalId(): JsonField = externalId + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -711,6 +763,7 @@ private constructor( private var normalBalance: JsonField? = null private var currencyExponent: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var ledgerAccountCategoryIds: JsonField>? = null private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -725,6 +778,7 @@ private constructor( normalBalance = ledgerAccountCategoryCreateRequest.normalBalance currencyExponent = ledgerAccountCategoryCreateRequest.currencyExponent description = ledgerAccountCategoryCreateRequest.description + externalId = ledgerAccountCategoryCreateRequest.externalId ledgerAccountCategoryIds = ledgerAccountCategoryCreateRequest.ledgerAccountCategoryIds.map { it.toMutableList() @@ -831,6 +885,21 @@ private constructor( this.description = description } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + /** * The array of ledger account category ids that this ledger account category should be * a child of. @@ -920,6 +989,7 @@ private constructor( checkRequired("normalBalance", normalBalance), currencyExponent, description, + externalId, (ledgerAccountCategoryIds ?: JsonMissing.of()).map { it.toImmutable() }, metadata, additionalProperties.toMutableMap(), @@ -939,6 +1009,7 @@ private constructor( normalBalance().validate() currencyExponent() description() + externalId() ledgerAccountCategoryIds() metadata().ifPresent { it.validate() } validated = true @@ -966,6 +1037,7 @@ private constructor( (normalBalance.asKnown().getOrNull()?.validity() ?: 0) + (if (currencyExponent.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + (ledgerAccountCategoryIds.asKnown().getOrNull()?.size ?: 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) @@ -981,6 +1053,7 @@ private constructor( normalBalance == other.normalBalance && currencyExponent == other.currencyExponent && description == other.description && + externalId == other.externalId && ledgerAccountCategoryIds == other.ledgerAccountCategoryIds && metadata == other.metadata && additionalProperties == other.additionalProperties @@ -994,6 +1067,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, metadata, additionalProperties, @@ -1003,7 +1077,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LedgerAccountCategoryCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, metadata=$metadata, additionalProperties=$additionalProperties}" + "LedgerAccountCategoryCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, externalId=$externalId, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, metadata=$metadata, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt index 317fe02e..683ce25e 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt @@ -29,6 +29,7 @@ private constructor( private val normalBalance: JsonField, private val currencyExponent: JsonField, private val description: JsonField, + private val externalId: JsonField, private val ledgerAccountCategoryIds: JsonField>, private val ledgerableId: JsonField, private val ledgerableType: JsonField, @@ -50,6 +51,9 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), @JsonProperty("ledger_account_category_ids") @ExcludeMissing ledgerAccountCategoryIds: JsonField> = JsonMissing.of(), @@ -67,6 +71,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, ledgerableId, ledgerableType, @@ -122,6 +127,14 @@ private constructor( */ fun description(): Optional = description.getOptional("description") + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + /** * The array of ledger account category ids that this ledger account should be a child of. * @@ -204,6 +217,13 @@ private constructor( */ @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId(): JsonField = externalId + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -276,6 +296,7 @@ private constructor( private var normalBalance: JsonField? = null private var currencyExponent: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var ledgerAccountCategoryIds: JsonField>? = null private var ledgerableId: JsonField = JsonMissing.of() private var ledgerableType: JsonField = JsonMissing.of() @@ -290,6 +311,7 @@ private constructor( normalBalance = ledgerAccountCreateRequest.normalBalance currencyExponent = ledgerAccountCreateRequest.currencyExponent description = ledgerAccountCreateRequest.description + externalId = ledgerAccountCreateRequest.externalId ledgerAccountCategoryIds = ledgerAccountCreateRequest.ledgerAccountCategoryIds.map { it.toMutableList() } ledgerableId = ledgerAccountCreateRequest.ledgerableId @@ -387,6 +409,21 @@ private constructor( */ fun description(description: JsonField) = apply { this.description = description } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + /** * The array of ledger account category ids that this ledger account should be a child of. */ @@ -507,6 +544,7 @@ private constructor( checkRequired("normalBalance", normalBalance), currencyExponent, description, + externalId, (ledgerAccountCategoryIds ?: JsonMissing.of()).map { it.toImmutable() }, ledgerableId, ledgerableType, @@ -528,6 +566,7 @@ private constructor( normalBalance().validate() currencyExponent() description() + externalId() ledgerAccountCategoryIds() ledgerableId() ledgerableType().ifPresent { it.validate() } @@ -556,6 +595,7 @@ private constructor( (normalBalance.asKnown().getOrNull()?.validity() ?: 0) + (if (currencyExponent.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + (ledgerAccountCategoryIds.asKnown().getOrNull()?.size ?: 0) + (if (ledgerableId.asKnown().isPresent) 1 else 0) + (ledgerableType.asKnown().getOrNull()?.validity() ?: 0) + @@ -820,6 +860,7 @@ private constructor( normalBalance == other.normalBalance && currencyExponent == other.currencyExponent && description == other.description && + externalId == other.externalId && ledgerAccountCategoryIds == other.ledgerAccountCategoryIds && ledgerableId == other.ledgerableId && ledgerableType == other.ledgerableType && @@ -835,6 +876,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, ledgerableId, ledgerableType, @@ -846,5 +888,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LedgerAccountCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, ledgerableId=$ledgerableId, ledgerableType=$ledgerableType, metadata=$metadata, additionalProperties=$additionalProperties}" + "LedgerAccountCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, externalId=$externalId, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, ledgerableId=$ledgerableId, ledgerableType=$ledgerableType, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt index a33c60f8..0e4c8447 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt @@ -180,6 +180,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -463,6 +464,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -749,6 +751,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index 1d667e10..17b09084 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -49,6 +49,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -566,6 +567,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1097,6 +1099,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt index 8bfe2757..8f27c615 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt @@ -37,6 +37,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -114,6 +115,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -189,6 +191,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt index 6b7f5e2d..a0a93d5d 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt @@ -18,6 +18,7 @@ internal class LedgerAccountCategoryCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() @@ -39,6 +40,7 @@ internal class LedgerAccountCategoryCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() @@ -57,6 +59,7 @@ internal class LedgerAccountCategoryCreateParamsTest { assertThat(body.normalBalance()).isEqualTo(TransactionDirection.CREDIT) assertThat(body.currencyExponent()).contains(0L) assertThat(body.description()).contains("description") + assertThat(body.externalId()).contains("external_id") assertThat(body.ledgerAccountCategoryIds().getOrNull()) .containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.metadata()) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt index 7a7de140..d71ace6e 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt @@ -19,6 +19,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -46,6 +47,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -71,6 +73,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt index 9df869bc..0139f096 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt @@ -21,6 +21,7 @@ internal class LedgerAccountCreateRequestTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -41,6 +42,7 @@ internal class LedgerAccountCreateRequestTest { .isEqualTo(TransactionDirection.CREDIT) assertThat(ledgerAccountCreateRequest.currencyExponent()).contains(0L) assertThat(ledgerAccountCreateRequest.description()).contains("description") + assertThat(ledgerAccountCreateRequest.externalId()).contains("external_id") assertThat(ledgerAccountCreateRequest.ledgerAccountCategoryIds().getOrNull()) .containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(ledgerAccountCreateRequest.ledgerableId()) @@ -68,6 +70,7 @@ internal class LedgerAccountCreateRequestTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt index 5ecf6667..25fefe1c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt @@ -143,6 +143,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -343,6 +344,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -548,6 +550,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt index a74cda64..9455deae 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt @@ -154,6 +154,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -364,6 +365,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -638,6 +640,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt index a3c55e33..b4828d22 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt @@ -93,6 +93,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -250,6 +251,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -400,6 +402,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt index 24ec67f5..7bb05ca2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt @@ -35,6 +35,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -93,6 +94,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -151,6 +153,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt index 5be4e301..f300b72d 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt @@ -106,6 +106,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -204,6 +205,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -302,6 +304,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -400,6 +403,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -498,6 +502,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -596,6 +601,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -694,6 +700,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -792,6 +799,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -890,6 +898,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -988,6 +997,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1086,6 +1096,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1184,6 +1195,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1282,6 +1294,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1380,6 +1393,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1478,6 +1492,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1576,6 +1591,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1672,6 +1688,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 00ae7071..3db5d7c7 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -91,6 +91,7 @@ internal class ServiceParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt index 6571a951..1c3e230d 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt @@ -233,6 +233,7 @@ internal class BulkRequestServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index f4f87c26..f82e5fc8 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -76,6 +76,7 @@ internal class CounterpartyServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt index 94967068..a267c8c0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt @@ -62,6 +62,7 @@ internal class ExternalAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt index 42ff35cd..927307eb 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt @@ -40,6 +40,7 @@ internal class LedgerAccountCategoryServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt index fc31ea0f..ac7e8573 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt @@ -36,6 +36,7 @@ internal class LedgerAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt index eba7e306..48f60fc9 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt @@ -184,6 +184,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -370,6 +371,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -613,6 +615,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt index 0c7bf453..4388d572 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt @@ -52,6 +52,7 @@ internal class VirtualAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt index ca9fc331..237327f4 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt @@ -233,6 +233,7 @@ internal class BulkRequestServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index de18d81b..544b4a0c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -76,6 +76,7 @@ internal class CounterpartyServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt index 7a9a5991..e067bc77 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt @@ -62,6 +62,7 @@ internal class ExternalAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt index 5ebd74f4..b8091e71 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt @@ -40,6 +40,7 @@ internal class LedgerAccountCategoryServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt index 19a5b444..87c0f162 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt @@ -36,6 +36,7 @@ internal class LedgerAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt index 66ecce34..2cd99b5f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt @@ -184,6 +184,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -368,6 +369,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -609,6 +611,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt index b7701d69..6a27e5df 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt @@ -52,6 +52,7 @@ internal class VirtualAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) From d17a141a575ba4c2dfe6f3009e0b2539f8ff27f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:19:52 +0000 Subject: [PATCH 23/27] chore(internal): codegen related update --- .../models/LedgerAccountCategoryListParams.kt | 33 +++++-------------- .../api/models/LedgerEntryListParams.kt | 29 +++++++--------- .../LedgerAccountCategoryListParamsTest.kt | 6 ++-- .../api/models/LedgerEntryListParamsTest.kt | 6 ++-- 4 files changed, 26 insertions(+), 48 deletions(-) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt index b0326bc8..5466db7b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt @@ -23,7 +23,7 @@ private constructor( private val ledgerAccountId: String?, private val ledgerId: String?, private val metadata: Metadata?, - private val name: List?, + private val name: String?, private val parentLedgerAccountCategoryId: String?, private val perPage: Long?, private val additionalHeaders: Headers, @@ -61,11 +61,7 @@ private constructor( */ fun metadata(): Optional = Optional.ofNullable(metadata) - /** - * If you have specific names to retrieve in bulk, you can pass them as query parameters - * delimited with `name[]=`, for example `?name[]=123&name[]=abc`. - */ - fun name(): Optional> = Optional.ofNullable(name) + fun name(): Optional = Optional.ofNullable(name) /** Query categories that are nested underneath a parent category */ fun parentLedgerAccountCategoryId(): Optional = @@ -103,7 +99,7 @@ private constructor( private var ledgerAccountId: String? = null private var ledgerId: String? = null private var metadata: Metadata? = null - private var name: MutableList? = null + private var name: String? = null private var parentLedgerAccountCategoryId: String? = null private var perPage: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -120,7 +116,7 @@ private constructor( ledgerAccountId = ledgerAccountCategoryListParams.ledgerAccountId ledgerId = ledgerAccountCategoryListParams.ledgerId metadata = ledgerAccountCategoryListParams.metadata - name = ledgerAccountCategoryListParams.name?.toMutableList() + name = ledgerAccountCategoryListParams.name parentLedgerAccountCategoryId = ledgerAccountCategoryListParams.parentLedgerAccountCategoryId perPage = ledgerAccountCategoryListParams.perPage @@ -194,23 +190,10 @@ private constructor( /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) - /** - * If you have specific names to retrieve in bulk, you can pass them as query parameters - * delimited with `name[]=`, for example `?name[]=123&name[]=abc`. - */ - fun name(name: List?) = apply { this.name = name?.toMutableList() } + fun name(name: String?) = apply { this.name = name } /** Alias for calling [Builder.name] with `name.orElse(null)`. */ - fun name(name: Optional>) = name(name.getOrNull()) - - /** - * Adds a single [String] to [Builder.name]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addName(name: String) = apply { - this.name = (this.name ?: mutableListOf()).apply { add(name) } - } + fun name(name: Optional) = name(name.getOrNull()) /** Query categories that are nested underneath a parent category */ fun parentLedgerAccountCategoryId(parentLedgerAccountCategoryId: String?) = apply { @@ -349,7 +332,7 @@ private constructor( ledgerAccountId, ledgerId, metadata, - name?.toImmutable(), + name, parentLedgerAccountCategoryId, perPage, additionalHeaders.build(), @@ -388,7 +371,7 @@ private constructor( } } } - name?.forEach { put("name[]", it) } + name?.let { put("name", it) } parentLedgerAccountCategoryId?.let { put("parent_ledger_account_category_id", it) } perPage?.let { put("per_page", it.toString()) } putAll(additionalQueryParams) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt index 8a0f9519..1555030b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt @@ -36,7 +36,7 @@ private constructor( private val perPage: Long?, private val showBalances: Boolean?, private val showDeleted: Boolean?, - private val status: List?, + private val status: Status?, private val updatedAt: UpdatedAt?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -131,7 +131,7 @@ private constructor( * Get all ledger entries that match the status specified. One of `pending`, `posted`, or * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. */ - fun status(): Optional> = Optional.ofNullable(status) + fun status(): Optional = Optional.ofNullable(status) /** * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the posted at @@ -178,7 +178,7 @@ private constructor( private var perPage: Long? = null private var showBalances: Boolean? = null private var showDeleted: Boolean? = null - private var status: MutableList? = null + private var status: Status? = null private var updatedAt: UpdatedAt? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -204,7 +204,7 @@ private constructor( perPage = ledgerEntryListParams.perPage showBalances = ledgerEntryListParams.showBalances showDeleted = ledgerEntryListParams.showDeleted - status = ledgerEntryListParams.status?.toMutableList() + status = ledgerEntryListParams.status updatedAt = ledgerEntryListParams.updatedAt additionalHeaders = ledgerEntryListParams.additionalHeaders.toBuilder() additionalQueryParams = ledgerEntryListParams.additionalQueryParams.toBuilder() @@ -433,19 +433,10 @@ private constructor( * Get all ledger entries that match the status specified. One of `pending`, `posted`, or * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. */ - fun status(status: List?) = apply { this.status = status?.toMutableList() } + fun status(status: Status?) = apply { this.status = status } /** Alias for calling [Builder.status] with `status.orElse(null)`. */ - fun status(status: Optional>) = status(status.getOrNull()) - - /** - * Adds a single [Status] to [Builder.status]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addStatus(status: Status) = apply { - this.status = (this.status ?: mutableListOf()).apply { add(status) } - } + fun status(status: Optional) = status(status.getOrNull()) /** * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the posted at @@ -581,7 +572,7 @@ private constructor( perPage, showBalances, showDeleted, - status?.toImmutable(), + status, updatedAt, additionalHeaders.build(), additionalQueryParams.build(), @@ -655,7 +646,7 @@ private constructor( perPage?.let { put("per_page", it.toString()) } showBalances?.let { put("show_balances", it.toString()) } showDeleted?.let { put("show_deleted", it.toString()) } - status?.forEach { put("status[]", it.toString()) } + status?.let { put("status", it.toString()) } updatedAt?.let { it._additionalProperties().keys().forEach { key -> it._additionalProperties().values(key).forEach { value -> @@ -1655,6 +1646,10 @@ private constructor( "OrderBy{createdAt=$createdAt, effectiveAt=$effectiveAt, additionalProperties=$additionalProperties}" } + /** + * Get all ledger entries that match the status specified. One of `pending`, `posted`, or + * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. + */ class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt index 334159f6..5200c81f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt @@ -28,7 +28,7 @@ internal class LedgerAccountCategoryListParamsTest { .putAdditionalProperty("foo", "string") .build() ) - .addName("string") + .name("name") .parentLedgerAccountCategoryId("parent_ledger_account_category_id") .perPage(0L) .build() @@ -54,7 +54,7 @@ internal class LedgerAccountCategoryListParamsTest { .putAdditionalProperty("foo", "string") .build() ) - .addName("string") + .name("name") .parentLedgerAccountCategoryId("parent_ledger_account_category_id") .perPage(0L) .build() @@ -72,7 +72,7 @@ internal class LedgerAccountCategoryListParamsTest { .put("ledger_account_id", "ledger_account_id") .put("ledger_id", "ledger_id") .put("metadata[foo]", "string") - .put("name[]", "string") + .put("name", "name") .put("parent_ledger_account_category_id", "parent_ledger_account_category_id") .put("per_page", "0") .build() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt index fd6bead8..afecac26 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt @@ -53,7 +53,7 @@ internal class LedgerEntryListParamsTest { .perPage(0L) .showBalances(true) .showDeleted(true) - .addStatus(LedgerEntryListParams.Status.PENDING) + .status(LedgerEntryListParams.Status.PENDING) .updatedAt( LedgerEntryListParams.UpdatedAt.builder() .putAdditionalProperty("foo", "2019-12-27T18:11:19.117Z") @@ -114,7 +114,7 @@ internal class LedgerEntryListParamsTest { .perPage(0L) .showBalances(true) .showDeleted(true) - .addStatus(LedgerEntryListParams.Status.PENDING) + .status(LedgerEntryListParams.Status.PENDING) .updatedAt( LedgerEntryListParams.UpdatedAt.builder() .putAdditionalProperty("foo", "2019-12-27T18:11:19.117Z") @@ -151,7 +151,7 @@ internal class LedgerEntryListParamsTest { .put("per_page", "0") .put("show_balances", "true") .put("show_deleted", "true") - .put("status[]", "pending") + .put("status", "pending") .put("updated_at[foo]", "2019-12-27T18:11:19.117Z") .build() ) From 059766e4bb2f1f5173050e3ae6ab60be32545386 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 22:28:26 +0000 Subject: [PATCH 24/27] feat(api): api update --- .stats.yml | 4 +- .../api/models/ChildLegalEntity.kt | 47 +- .../api/models/ChildLegalEntityCreate.kt | 49 +- .../ConnectionLegalEntityCreateParams.kt | 52 +- .../api/models/CounterpartyCreateParams.kt | 52 +- .../moderntreasury/api/models/LegalEntity.kt | 47 +- .../api/models/LegalEntityComplianceDetail.kt | 663 ------------------ .../api/models/LegalEntityCreateParams.kt | 85 +-- .../api/models/LegalEntityUpdateParams.kt | 85 +-- .../moderntreasury/api/models/PaymentOrder.kt | 47 +- .../api/models/BulkResultTest.kt | 3 + .../api/models/ChildLegalEntityCreateTest.kt | 49 -- .../api/models/ChildLegalEntityTest.kt | 122 +--- .../ConnectionLegalEntityCreateParamsTest.kt | 132 ---- .../models/CounterpartyCreateParamsTest.kt | 132 ---- .../moderntreasury/api/models/InvoiceTest.kt | 3 + .../LegalEntityAssociationCreateParamsTest.kt | 48 -- .../LegalEntityAssociationInlineCreateTest.kt | 48 -- .../api/models/LegalEntityAssociationTest.kt | 51 +- .../models/LegalEntityComplianceDetailTest.kt | 79 --- .../api/models/LegalEntityCreateParamsTest.kt | 109 --- .../api/models/LegalEntityTest.kt | 121 +--- .../api/models/LegalEntityUpdateParamsTest.kt | 49 -- .../api/models/PaymentOrderTest.kt | 3 + .../api/services/ServiceParamsTest.kt | 45 -- .../ConnectionLegalEntityServiceAsyncTest.kt | 59 -- .../async/CounterpartyServiceAsyncTest.kt | 59 -- .../LegalEntityAssociationServiceAsyncTest.kt | 19 - .../async/LegalEntityServiceAsyncTest.kt | 61 -- .../ConnectionLegalEntityServiceTest.kt | 59 -- .../blocking/CounterpartyServiceTest.kt | 59 -- .../LegalEntityAssociationServiceTest.kt | 19 - .../blocking/LegalEntityServiceTest.kt | 61 -- 33 files changed, 104 insertions(+), 2417 deletions(-) delete mode 100644 modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt delete mode 100644 modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt diff --git a/.stats.yml b/.stats.yml index 32b59e14..ef3682f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-01390b6789af65c5b8e71531455f173bda9633dbf7e8dca0c71b41da4807ca70.yml -openapi_spec_hash: 2e7ae98bd7950304cd08889380f532ab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-a78ca984074c091219e7b10aefe1d72fbbd4f4297fb70b2a49bed1cb5999f27a.yml +openapi_spec_hash: c15c4f96e77008a4b2947be54c3def9a config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt index cdc3245c..ac415d58 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt @@ -31,7 +31,7 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, + private val complianceDetails: JsonValue, private val countryOfIncorporation: JsonField, private val createdAt: JsonField, private val dateFormed: JsonField, @@ -92,7 +92,7 @@ private constructor( citizenshipCountry: JsonField = JsonMissing.of(), @JsonProperty("compliance_details") @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), + complianceDetails: JsonValue = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -280,11 +280,15 @@ private constructor( citizenshipCountry.getOptional("citizenship_country") /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = childLegalEntity.complianceDetails().convert(MyClass.class); + * ``` */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") + @Deprecated("deprecated") + @JsonProperty("compliance_details") + @ExcludeMissing + fun _complianceDetails(): JsonValue = complianceDetails /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 @@ -632,16 +636,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -1043,7 +1037,7 @@ private constructor( private var businessDescription: JsonField? = null private var businessName: JsonField? = null private var citizenshipCountry: JsonField? = null - private var complianceDetails: JsonField? = null + private var complianceDetails: JsonValue? = null private var countryOfIncorporation: JsonField? = null private var createdAt: JsonField? = null private var dateFormed: JsonField? = null @@ -1251,21 +1245,8 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { + @Deprecated("deprecated") + fun complianceDetails(complianceDetails: JsonValue) = apply { this.complianceDetails = complianceDetails } @@ -2151,7 +2132,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } countryOfIncorporation() createdAt() dateFormed() @@ -2213,7 +2193,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt index 31af57a8..5df909c8 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreate.kt @@ -30,7 +30,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, @@ -83,9 +82,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("connection_id") @ExcludeMissing connectionId: JsonField = JsonMissing.of(), @@ -174,7 +170,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -251,13 +246,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The connection ID for the connection the legal entity is associated with. Defaults to the id * of the connection designated with an is_default value of true or the id of an existing @@ -571,16 +559,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [connectionId]. * @@ -890,7 +868,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() @@ -937,7 +914,6 @@ private constructor( businessDescription = childLegalEntityCreate.businessDescription businessName = childLegalEntityCreate.businessName citizenshipCountry = childLegalEntityCreate.citizenshipCountry - complianceDetails = childLegalEntityCreate.complianceDetails connectionId = childLegalEntityCreate.connectionId countryOfIncorporation = childLegalEntityCreate.countryOfIncorporation dateFormed = childLegalEntityCreate.dateFormed @@ -1082,24 +1058,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { - this.complianceDetails = complianceDetails - } - /** * The connection ID for the connection the legal entity is associated with. Defaults to the * id of the connection designated with an is_default value of true or the id of an existing @@ -1800,7 +1758,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -1849,7 +1806,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } connectionId() countryOfIncorporation() dateFormed() @@ -1905,7 +1861,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + @@ -6200,7 +6155,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && @@ -6243,7 +6197,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -6283,5 +6236,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt index e0c09135..7e5a560d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt @@ -581,7 +581,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, @@ -634,9 +633,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("connection_id") @ExcludeMissing connectionId: JsonField = JsonMissing.of(), @@ -732,7 +728,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -810,13 +805,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The connection ID for the connection the legal entity is associated with. Defaults to the * id of the connection designated with an is_default value of true or the id of an existing @@ -1134,16 +1122,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [connectionId]. * @@ -1463,7 +1441,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() @@ -1510,7 +1487,6 @@ private constructor( businessDescription = legalEntity.businessDescription businessName = legalEntity.businessName citizenshipCountry = legalEntity.citizenshipCountry - complianceDetails = legalEntity.complianceDetails connectionId = legalEntity.connectionId countryOfIncorporation = legalEntity.countryOfIncorporation dateFormed = legalEntity.dateFormed @@ -1658,27 +1634,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. - */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } - /** * The connection ID for the connection the legal entity is associated with. Defaults to * the id of the connection designated with an is_default value of true or the id of an @@ -2403,7 +2358,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -2452,7 +2406,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } connectionId() countryOfIncorporation() dateFormed() @@ -2509,7 +2462,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + @@ -6914,7 +6866,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && @@ -6957,7 +6908,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -6997,7 +6947,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt index 193d6ae4..29c95d15 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt @@ -3946,7 +3946,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, @@ -4001,9 +4000,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("connection_id") @ExcludeMissing connectionId: JsonField = JsonMissing.of(), @@ -4097,7 +4093,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -4182,13 +4177,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The connection ID for the connection the legal entity is associated with. Defaults to the * id of the connection designated with an is_default value of true or the id of an existing @@ -4507,16 +4495,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [connectionId]. * @@ -4834,7 +4812,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() @@ -4881,7 +4858,6 @@ private constructor( businessDescription = legalEntityCreateRequest.businessDescription businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry - complianceDetails = legalEntityCreateRequest.complianceDetails connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed @@ -5045,27 +5021,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. - */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } - /** * The connection ID for the connection the legal entity is associated with. Defaults to * the id of the connection designated with an is_default value of true or the id of an @@ -5783,7 +5738,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -5832,7 +5786,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } connectionId() countryOfIncorporation() dateFormed() @@ -5889,7 +5842,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + @@ -10294,7 +10246,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && @@ -10337,7 +10288,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -10376,7 +10326,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt index 5f8a0e84..3a7691ff 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt @@ -31,7 +31,7 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, + private val complianceDetails: JsonValue, private val countryOfIncorporation: JsonField, private val createdAt: JsonField, private val dateFormed: JsonField, @@ -92,7 +92,7 @@ private constructor( citizenshipCountry: JsonField = JsonMissing.of(), @JsonProperty("compliance_details") @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), + complianceDetails: JsonValue = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -280,11 +280,15 @@ private constructor( citizenshipCountry.getOptional("citizenship_country") /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = legalEntity.complianceDetails().convert(MyClass.class); + * ``` */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") + @Deprecated("deprecated") + @JsonProperty("compliance_details") + @ExcludeMissing + fun _complianceDetails(): JsonValue = complianceDetails /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 @@ -632,16 +636,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -1042,7 +1036,7 @@ private constructor( private var businessDescription: JsonField? = null private var businessName: JsonField? = null private var citizenshipCountry: JsonField? = null - private var complianceDetails: JsonField? = null + private var complianceDetails: JsonValue? = null private var countryOfIncorporation: JsonField? = null private var createdAt: JsonField? = null private var dateFormed: JsonField? = null @@ -1246,21 +1240,8 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { + @Deprecated("deprecated") + fun complianceDetails(complianceDetails: JsonValue) = apply { this.complianceDetails = complianceDetails } @@ -2143,7 +2124,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } countryOfIncorporation() createdAt() dateFormed() @@ -2205,7 +2185,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt deleted file mode 100644 index 095bb575..00000000 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt +++ /dev/null @@ -1,663 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.moderntreasury.api.models - -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import com.moderntreasury.api.core.ExcludeMissing -import com.moderntreasury.api.core.JsonField -import com.moderntreasury.api.core.JsonMissing -import com.moderntreasury.api.core.JsonValue -import com.moderntreasury.api.core.checkRequired -import com.moderntreasury.api.errors.ModernTreasuryInvalidDataException -import java.time.OffsetDateTime -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -class LegalEntityComplianceDetail -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val id: JsonField, - private val createdAt: JsonField, - private val discardedAt: JsonField, - private val issuer: JsonField, - private val liveMode: JsonField, - private val object_: JsonField, - private val tokenExpiresAt: JsonField, - private val tokenIssuedAt: JsonField, - private val tokenUrl: JsonField, - private val updatedAt: JsonField, - private val entityValidated: JsonField, - private val validatedAt: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("discarded_at") - @ExcludeMissing - discardedAt: JsonField = JsonMissing.of(), - @JsonProperty("issuer") @ExcludeMissing issuer: JsonField = JsonMissing.of(), - @JsonProperty("live_mode") @ExcludeMissing liveMode: JsonField = JsonMissing.of(), - @JsonProperty("object") @ExcludeMissing object_: JsonField = JsonMissing.of(), - @JsonProperty("token_expires_at") - @ExcludeMissing - tokenExpiresAt: JsonField = JsonMissing.of(), - @JsonProperty("token_issued_at") - @ExcludeMissing - tokenIssuedAt: JsonField = JsonMissing.of(), - @JsonProperty("token_url") @ExcludeMissing tokenUrl: JsonField = JsonMissing.of(), - @JsonProperty("updated_at") - @ExcludeMissing - updatedAt: JsonField = JsonMissing.of(), - @JsonProperty("validated") - @ExcludeMissing - entityValidated: JsonField = JsonMissing.of(), - @JsonProperty("validated_at") - @ExcludeMissing - validatedAt: JsonField = JsonMissing.of(), - ) : this( - id, - createdAt, - discardedAt, - issuer, - liveMode, - object_, - tokenExpiresAt, - tokenIssuedAt, - tokenUrl, - updatedAt, - entityValidated, - validatedAt, - mutableMapOf(), - ) - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun id(): String = id.getRequired("id") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") - - /** - * The issuer of the compliance token. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun issuer(): String = issuer.getRequired("issuer") - - /** - * This field will be true if this object exists in the live environment or false if it exists - * in the test environment. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun liveMode(): Boolean = liveMode.getRequired("live_mode") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun object_(): String = object_.getRequired("object") - - /** - * The timestamp when the compliance token expires. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenExpiresAt(): Optional = tokenExpiresAt.getOptional("token_expires_at") - - /** - * The timestamp when the compliance token was issued. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenIssuedAt(): Optional = tokenIssuedAt.getOptional("token_issued_at") - - /** - * The URL to the compliance token. (ex. provider portal URL) - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenUrl(): Optional = tokenUrl.getOptional("token_url") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") - - /** - * Whether entity corresponding to the compliance token has been validated. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun entityValidated(): Boolean = entityValidated.getRequired("validated") - - /** - * The timestamp when the entity was validated. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun validatedAt(): Optional = validatedAt.getOptional("validated_at") - - /** - * Returns the raw JSON value of [id]. - * - * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [discardedAt]. - * - * Unlike [discardedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("discarded_at") - @ExcludeMissing - fun _discardedAt(): JsonField = discardedAt - - /** - * Returns the raw JSON value of [issuer]. - * - * Unlike [issuer], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("issuer") @ExcludeMissing fun _issuer(): JsonField = issuer - - /** - * Returns the raw JSON value of [liveMode]. - * - * Unlike [liveMode], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("live_mode") @ExcludeMissing fun _liveMode(): JsonField = liveMode - - /** - * Returns the raw JSON value of [object_]. - * - * Unlike [object_], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("object") @ExcludeMissing fun _object_(): JsonField = object_ - - /** - * Returns the raw JSON value of [tokenExpiresAt]. - * - * Unlike [tokenExpiresAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_expires_at") - @ExcludeMissing - fun _tokenExpiresAt(): JsonField = tokenExpiresAt - - /** - * Returns the raw JSON value of [tokenIssuedAt]. - * - * Unlike [tokenIssuedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_issued_at") - @ExcludeMissing - fun _tokenIssuedAt(): JsonField = tokenIssuedAt - - /** - * Returns the raw JSON value of [tokenUrl]. - * - * Unlike [tokenUrl], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_url") @ExcludeMissing fun _tokenUrl(): JsonField = tokenUrl - - /** - * Returns the raw JSON value of [updatedAt]. - * - * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("updated_at") - @ExcludeMissing - fun _updatedAt(): JsonField = updatedAt - - /** - * Returns the raw JSON value of [entityValidated]. - * - * Unlike [entityValidated], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("validated") - @ExcludeMissing - fun _entityValidated(): JsonField = entityValidated - - /** - * Returns the raw JSON value of [validatedAt]. - * - * Unlike [validatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("validated_at") - @ExcludeMissing - fun _validatedAt(): JsonField = validatedAt - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [LegalEntityComplianceDetail]. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .discardedAt() - * .issuer() - * .liveMode() - * .object_() - * .tokenExpiresAt() - * .tokenIssuedAt() - * .tokenUrl() - * .updatedAt() - * .entityValidated() - * .validatedAt() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [LegalEntityComplianceDetail]. */ - class Builder internal constructor() { - - private var id: JsonField? = null - private var createdAt: JsonField? = null - private var discardedAt: JsonField? = null - private var issuer: JsonField? = null - private var liveMode: JsonField? = null - private var object_: JsonField? = null - private var tokenExpiresAt: JsonField? = null - private var tokenIssuedAt: JsonField? = null - private var tokenUrl: JsonField? = null - private var updatedAt: JsonField? = null - private var entityValidated: JsonField? = null - private var validatedAt: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(legalEntityComplianceDetail: LegalEntityComplianceDetail) = apply { - id = legalEntityComplianceDetail.id - createdAt = legalEntityComplianceDetail.createdAt - discardedAt = legalEntityComplianceDetail.discardedAt - issuer = legalEntityComplianceDetail.issuer - liveMode = legalEntityComplianceDetail.liveMode - object_ = legalEntityComplianceDetail.object_ - tokenExpiresAt = legalEntityComplianceDetail.tokenExpiresAt - tokenIssuedAt = legalEntityComplianceDetail.tokenIssuedAt - tokenUrl = legalEntityComplianceDetail.tokenUrl - updatedAt = legalEntityComplianceDetail.updatedAt - entityValidated = legalEntityComplianceDetail.entityValidated - validatedAt = legalEntityComplianceDetail.validatedAt - additionalProperties = legalEntityComplianceDetail.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - /** - * Sets [Builder.id] to an arbitrary JSON value. - * - * You should usually call [Builder.id] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun id(id: JsonField) = apply { this.id = id } - - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - - fun discardedAt(discardedAt: OffsetDateTime?) = - discardedAt(JsonField.ofNullable(discardedAt)) - - /** Alias for calling [Builder.discardedAt] with `discardedAt.orElse(null)`. */ - fun discardedAt(discardedAt: Optional) = - discardedAt(discardedAt.getOrNull()) - - /** - * Sets [Builder.discardedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.discardedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun discardedAt(discardedAt: JsonField) = apply { - this.discardedAt = discardedAt - } - - /** The issuer of the compliance token. */ - fun issuer(issuer: String) = issuer(JsonField.of(issuer)) - - /** - * Sets [Builder.issuer] to an arbitrary JSON value. - * - * You should usually call [Builder.issuer] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun issuer(issuer: JsonField) = apply { this.issuer = issuer } - - /** - * This field will be true if this object exists in the live environment or false if it - * exists in the test environment. - */ - fun liveMode(liveMode: Boolean) = liveMode(JsonField.of(liveMode)) - - /** - * Sets [Builder.liveMode] to an arbitrary JSON value. - * - * You should usually call [Builder.liveMode] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun liveMode(liveMode: JsonField) = apply { this.liveMode = liveMode } - - fun object_(object_: String) = object_(JsonField.of(object_)) - - /** - * Sets [Builder.object_] to an arbitrary JSON value. - * - * You should usually call [Builder.object_] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun object_(object_: JsonField) = apply { this.object_ = object_ } - - /** The timestamp when the compliance token expires. */ - fun tokenExpiresAt(tokenExpiresAt: OffsetDateTime?) = - tokenExpiresAt(JsonField.ofNullable(tokenExpiresAt)) - - /** Alias for calling [Builder.tokenExpiresAt] with `tokenExpiresAt.orElse(null)`. */ - fun tokenExpiresAt(tokenExpiresAt: Optional) = - tokenExpiresAt(tokenExpiresAt.getOrNull()) - - /** - * Sets [Builder.tokenExpiresAt] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenExpiresAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tokenExpiresAt(tokenExpiresAt: JsonField) = apply { - this.tokenExpiresAt = tokenExpiresAt - } - - /** The timestamp when the compliance token was issued. */ - fun tokenIssuedAt(tokenIssuedAt: OffsetDateTime?) = - tokenIssuedAt(JsonField.ofNullable(tokenIssuedAt)) - - /** Alias for calling [Builder.tokenIssuedAt] with `tokenIssuedAt.orElse(null)`. */ - fun tokenIssuedAt(tokenIssuedAt: Optional) = - tokenIssuedAt(tokenIssuedAt.getOrNull()) - - /** - * Sets [Builder.tokenIssuedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenIssuedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tokenIssuedAt(tokenIssuedAt: JsonField) = apply { - this.tokenIssuedAt = tokenIssuedAt - } - - /** The URL to the compliance token. (ex. provider portal URL) */ - fun tokenUrl(tokenUrl: String?) = tokenUrl(JsonField.ofNullable(tokenUrl)) - - /** Alias for calling [Builder.tokenUrl] with `tokenUrl.orElse(null)`. */ - fun tokenUrl(tokenUrl: Optional) = tokenUrl(tokenUrl.getOrNull()) - - /** - * Sets [Builder.tokenUrl] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenUrl] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun tokenUrl(tokenUrl: JsonField) = apply { this.tokenUrl = tokenUrl } - - fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) - - /** - * Sets [Builder.updatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } - - /** Whether entity corresponding to the compliance token has been validated. */ - fun entityValidated(entityValidated: Boolean) = - entityValidated(JsonField.of(entityValidated)) - - /** - * Sets [Builder.entityValidated] to an arbitrary JSON value. - * - * You should usually call [Builder.entityValidated] with a well-typed [Boolean] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun entityValidated(entityValidated: JsonField) = apply { - this.entityValidated = entityValidated - } - - /** The timestamp when the entity was validated. */ - fun validatedAt(validatedAt: OffsetDateTime?) = - validatedAt(JsonField.ofNullable(validatedAt)) - - /** Alias for calling [Builder.validatedAt] with `validatedAt.orElse(null)`. */ - fun validatedAt(validatedAt: Optional) = - validatedAt(validatedAt.getOrNull()) - - /** - * Sets [Builder.validatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.validatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun validatedAt(validatedAt: JsonField) = apply { - this.validatedAt = validatedAt - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [LegalEntityComplianceDetail]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .discardedAt() - * .issuer() - * .liveMode() - * .object_() - * .tokenExpiresAt() - * .tokenIssuedAt() - * .tokenUrl() - * .updatedAt() - * .entityValidated() - * .validatedAt() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): LegalEntityComplianceDetail = - LegalEntityComplianceDetail( - checkRequired("id", id), - checkRequired("createdAt", createdAt), - checkRequired("discardedAt", discardedAt), - checkRequired("issuer", issuer), - checkRequired("liveMode", liveMode), - checkRequired("object_", object_), - checkRequired("tokenExpiresAt", tokenExpiresAt), - checkRequired("tokenIssuedAt", tokenIssuedAt), - checkRequired("tokenUrl", tokenUrl), - checkRequired("updatedAt", updatedAt), - checkRequired("entityValidated", entityValidated), - checkRequired("validatedAt", validatedAt), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): LegalEntityComplianceDetail = apply { - if (validated) { - return@apply - } - - id() - createdAt() - discardedAt() - issuer() - liveMode() - object_() - tokenExpiresAt() - tokenIssuedAt() - tokenUrl() - updatedAt() - entityValidated() - validatedAt() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (id.asKnown().isPresent) 1 else 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (discardedAt.asKnown().isPresent) 1 else 0) + - (if (issuer.asKnown().isPresent) 1 else 0) + - (if (liveMode.asKnown().isPresent) 1 else 0) + - (if (object_.asKnown().isPresent) 1 else 0) + - (if (tokenExpiresAt.asKnown().isPresent) 1 else 0) + - (if (tokenIssuedAt.asKnown().isPresent) 1 else 0) + - (if (tokenUrl.asKnown().isPresent) 1 else 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + - (if (entityValidated.asKnown().isPresent) 1 else 0) + - (if (validatedAt.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is LegalEntityComplianceDetail && - id == other.id && - createdAt == other.createdAt && - discardedAt == other.discardedAt && - issuer == other.issuer && - liveMode == other.liveMode && - object_ == other.object_ && - tokenExpiresAt == other.tokenExpiresAt && - tokenIssuedAt == other.tokenIssuedAt && - tokenUrl == other.tokenUrl && - updatedAt == other.updatedAt && - entityValidated == other.entityValidated && - validatedAt == other.validatedAt && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - id, - createdAt, - discardedAt, - issuer, - liveMode, - object_, - tokenExpiresAt, - tokenIssuedAt, - tokenUrl, - updatedAt, - entityValidated, - validatedAt, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "LegalEntityComplianceDetail{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, issuer=$issuer, liveMode=$liveMode, object_=$object_, tokenExpiresAt=$tokenExpiresAt, tokenIssuedAt=$tokenIssuedAt, tokenUrl=$tokenUrl, updatedAt=$updatedAt, entityValidated=$entityValidated, validatedAt=$validatedAt, additionalProperties=$additionalProperties}" -} diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt index b53ec042..60b3a04a 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt @@ -79,12 +79,6 @@ private constructor( */ fun citizenshipCountry(): Optional = body.citizenshipCountry() - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = body.complianceDetails() - /** * The connection ID for the connection the legal entity is associated with. Defaults to the id * of the connection designated with an is_default value of true or the id of an existing @@ -378,14 +372,6 @@ private constructor( */ fun _citizenshipCountry(): JsonField = body._citizenshipCountry() - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - fun _complianceDetails(): JsonField = body._complianceDetails() - /** * Returns the raw JSON value of [connectionId]. * @@ -789,25 +775,6 @@ private constructor( body.citizenshipCountry(citizenshipCountry) } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = apply { - body.complianceDetails(complianceDetails) - } - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { - body.complianceDetails(complianceDetails) - } - /** * The connection ID for the connection the legal entity is associated with. Defaults to the * id of the connection designated with an is_default value of true or the id of an existing @@ -1590,7 +1557,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val connectionId: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, @@ -1645,9 +1611,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("connection_id") @ExcludeMissing connectionId: JsonField = JsonMissing.of(), @@ -1741,7 +1704,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -1826,13 +1788,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The connection ID for the connection the legal entity is associated with. Defaults to the * id of the connection designated with an is_default value of true or the id of an existing @@ -2151,16 +2106,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [connectionId]. * @@ -2478,7 +2423,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() @@ -2525,7 +2469,6 @@ private constructor( businessDescription = legalEntityCreateRequest.businessDescription businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry - complianceDetails = legalEntityCreateRequest.complianceDetails connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed @@ -2689,27 +2632,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. - */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } - /** * The connection ID for the connection the legal entity is associated with. Defaults to * the id of the connection designated with an is_default value of true or the id of an @@ -3427,7 +3349,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -3476,7 +3397,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } connectionId() countryOfIncorporation() dateFormed() @@ -3533,7 +3453,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + @@ -3580,7 +3499,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && @@ -3623,7 +3541,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, connectionId, countryOfIncorporation, dateFormed, @@ -3662,7 +3579,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt index 7949c45b..4a13a0a2 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt @@ -74,12 +74,6 @@ private constructor( */ fun citizenshipCountry(): Optional = body.citizenshipCountry() - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = body.complianceDetails() - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -346,14 +340,6 @@ private constructor( */ fun _citizenshipCountry(): JsonField = body._citizenshipCountry() - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - fun _complianceDetails(): JsonField = body._complianceDetails() - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -727,25 +713,6 @@ private constructor( body.citizenshipCountry(citizenshipCountry) } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = apply { - body.complianceDetails(complianceDetails) - } - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { - body.complianceDetails(complianceDetails) - } - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -1471,7 +1438,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -1521,9 +1487,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -1609,7 +1572,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1684,13 +1646,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -1979,16 +1934,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -2279,7 +2224,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -2321,7 +2265,6 @@ private constructor( businessDescription = legalEntityUpdateRequest.businessDescription businessName = legalEntityUpdateRequest.businessName citizenshipCountry = legalEntityUpdateRequest.citizenshipCountry - complianceDetails = legalEntityUpdateRequest.complianceDetails countryOfIncorporation = legalEntityUpdateRequest.countryOfIncorporation dateFormed = legalEntityUpdateRequest.dateFormed dateOfBirth = legalEntityUpdateRequest.dateOfBirth @@ -2467,27 +2410,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. - */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or * alpha-3 formats. @@ -3133,7 +3055,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -3179,7 +3100,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } countryOfIncorporation() dateFormed() dateOfBirth() @@ -3233,7 +3153,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -3276,7 +3195,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -3316,7 +3234,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -3353,7 +3270,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } class LegalEntityBankSetting diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt index ab4743ee..2ea155fb 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt @@ -41,6 +41,7 @@ private constructor( private val accountingCategoryId: JsonField, private val accountingLedgerClassId: JsonField, private val amount: JsonField, + private val batchId: JsonField, private val chargeBearer: JsonField, private val counterpartyId: JsonField, private val createdAt: JsonField, @@ -102,6 +103,7 @@ private constructor( @ExcludeMissing accountingLedgerClassId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("batch_id") @ExcludeMissing batchId: JsonField = JsonMissing.of(), @JsonProperty("charge_bearer") @ExcludeMissing chargeBearer: JsonField = JsonMissing.of(), @@ -228,6 +230,7 @@ private constructor( accountingCategoryId, accountingLedgerClassId, amount, + batchId, chargeBearer, counterpartyId, createdAt, @@ -319,6 +322,15 @@ private constructor( */ fun amount(): Long = amount.getRequired("amount") + /** + * The ID of the batch in which the payment order is included. Only populated after the payment + * order begins processing. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun batchId(): Optional = batchId.getOptional("batch_id") + /** * The party that will pay the fees for the payment order. See * https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the differences @@ -770,6 +782,13 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** + * Returns the raw JSON value of [batchId]. + * + * Unlike [batchId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("batch_id") @ExcludeMissing fun _batchId(): JsonField = batchId + /** * Returns the raw JSON value of [chargeBearer]. * @@ -1190,6 +1209,7 @@ private constructor( * .accountingCategoryId() * .accountingLedgerClassId() * .amount() + * .batchId() * .chargeBearer() * .counterpartyId() * .createdAt() @@ -1248,6 +1268,7 @@ private constructor( private var accountingCategoryId: JsonField? = null private var accountingLedgerClassId: JsonField? = null private var amount: JsonField? = null + private var batchId: JsonField? = null private var chargeBearer: JsonField? = null private var counterpartyId: JsonField? = null private var createdAt: JsonField? = null @@ -1303,6 +1324,7 @@ private constructor( accountingCategoryId = paymentOrder.accountingCategoryId accountingLedgerClassId = paymentOrder.accountingLedgerClassId amount = paymentOrder.amount + batchId = paymentOrder.batchId chargeBearer = paymentOrder.chargeBearer counterpartyId = paymentOrder.counterpartyId createdAt = paymentOrder.createdAt @@ -1444,6 +1466,23 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** + * The ID of the batch in which the payment order is included. Only populated after the + * payment order begins processing. + */ + fun batchId(batchId: String?) = batchId(JsonField.ofNullable(batchId)) + + /** Alias for calling [Builder.batchId] with `batchId.orElse(null)`. */ + fun batchId(batchId: Optional) = batchId(batchId.getOrNull()) + + /** + * Sets [Builder.batchId] to an arbitrary JSON value. + * + * You should usually call [Builder.batchId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun batchId(batchId: JsonField) = apply { this.batchId = batchId } + /** * The party that will pay the fees for the payment order. See * https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the differences @@ -2363,6 +2402,7 @@ private constructor( * .accountingCategoryId() * .accountingLedgerClassId() * .amount() + * .batchId() * .chargeBearer() * .counterpartyId() * .createdAt() @@ -2419,6 +2459,7 @@ private constructor( checkRequired("accountingCategoryId", accountingCategoryId), checkRequired("accountingLedgerClassId", accountingLedgerClassId), checkRequired("amount", amount), + checkRequired("batchId", batchId), checkRequired("chargeBearer", chargeBearer), checkRequired("counterpartyId", counterpartyId), checkRequired("createdAt", createdAt), @@ -2483,6 +2524,7 @@ private constructor( accountingCategoryId() accountingLedgerClassId() amount() + batchId() chargeBearer().ifPresent { it.validate() } counterpartyId() createdAt() @@ -2550,6 +2592,7 @@ private constructor( (if (accountingCategoryId.asKnown().isPresent) 1 else 0) + (if (accountingLedgerClassId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + + (if (batchId.asKnown().isPresent) 1 else 0) + (chargeBearer.asKnown().getOrNull()?.validity() ?: 0) + (if (counterpartyId.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + @@ -6500,6 +6543,7 @@ private constructor( accountingCategoryId == other.accountingCategoryId && accountingLedgerClassId == other.accountingLedgerClassId && amount == other.amount && + batchId == other.batchId && chargeBearer == other.chargeBearer && counterpartyId == other.counterpartyId && createdAt == other.createdAt && @@ -6555,6 +6599,7 @@ private constructor( accountingCategoryId, accountingLedgerClassId, amount, + batchId, chargeBearer, counterpartyId, createdAt, @@ -6607,5 +6652,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentOrder{id=$id, accounting=$accounting, accountingCategoryId=$accountingCategoryId, accountingLedgerClassId=$accountingLedgerClassId, amount=$amount, chargeBearer=$chargeBearer, counterpartyId=$counterpartyId, createdAt=$createdAt, currency=$currency, currentHold=$currentHold, currentReturn=$currentReturn, description=$description, direction=$direction, effectiveDate=$effectiveDate, expiresAt=$expiresAt, externalId=$externalId, foreignExchangeContract=$foreignExchangeContract, foreignExchangeIndicator=$foreignExchangeIndicator, foreignExchangeRate=$foreignExchangeRate, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, nsfProtected=$nsfProtected, object_=$object_, originatingAccountId=$originatingAccountId, originatingPartyName=$originatingPartyName, priority=$priority, processAfter=$processAfter, purpose=$purpose, receivingAccountId=$receivingAccountId, receivingAccountType=$receivingAccountType, reconciliationStatus=$reconciliationStatus, referenceNumbers=$referenceNumbers, remittanceInformation=$remittanceInformation, sendRemittanceAdvice=$sendRemittanceAdvice, statementDescriptor=$statementDescriptor, status=$status, subtype=$subtype, transactionIds=$transactionIds, type=$type, ultimateOriginatingAccount=$ultimateOriginatingAccount, ultimateOriginatingAccountId=$ultimateOriginatingAccountId, ultimateOriginatingAccountType=$ultimateOriginatingAccountType, ultimateOriginatingPartyIdentifier=$ultimateOriginatingPartyIdentifier, ultimateOriginatingPartyName=$ultimateOriginatingPartyName, ultimateReceivingPartyIdentifier=$ultimateReceivingPartyIdentifier, ultimateReceivingPartyName=$ultimateReceivingPartyName, updatedAt=$updatedAt, vendorAttributes=$vendorAttributes, vendorFailureReason=$vendorFailureReason, additionalProperties=$additionalProperties}" + "PaymentOrder{id=$id, accounting=$accounting, accountingCategoryId=$accountingCategoryId, accountingLedgerClassId=$accountingLedgerClassId, amount=$amount, batchId=$batchId, chargeBearer=$chargeBearer, counterpartyId=$counterpartyId, createdAt=$createdAt, currency=$currency, currentHold=$currentHold, currentReturn=$currentReturn, description=$description, direction=$direction, effectiveDate=$effectiveDate, expiresAt=$expiresAt, externalId=$externalId, foreignExchangeContract=$foreignExchangeContract, foreignExchangeIndicator=$foreignExchangeIndicator, foreignExchangeRate=$foreignExchangeRate, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, nsfProtected=$nsfProtected, object_=$object_, originatingAccountId=$originatingAccountId, originatingPartyName=$originatingPartyName, priority=$priority, processAfter=$processAfter, purpose=$purpose, receivingAccountId=$receivingAccountId, receivingAccountType=$receivingAccountType, reconciliationStatus=$reconciliationStatus, referenceNumbers=$referenceNumbers, remittanceInformation=$remittanceInformation, sendRemittanceAdvice=$sendRemittanceAdvice, statementDescriptor=$statementDescriptor, status=$status, subtype=$subtype, transactionIds=$transactionIds, type=$type, ultimateOriginatingAccount=$ultimateOriginatingAccount, ultimateOriginatingAccountId=$ultimateOriginatingAccountId, ultimateOriginatingAccountType=$ultimateOriginatingAccountType, ultimateOriginatingPartyIdentifier=$ultimateOriginatingPartyIdentifier, ultimateOriginatingPartyName=$ultimateOriginatingPartyName, ultimateReceivingPartyIdentifier=$ultimateReceivingPartyIdentifier, ultimateReceivingPartyName=$ultimateReceivingPartyName, updatedAt=$updatedAt, vendorAttributes=$vendorAttributes, vendorFailureReason=$vendorFailureReason, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt index ee5ca601..fb0faf51 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt @@ -30,6 +30,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -292,6 +293,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -559,6 +561,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt index 9f7e0bfe..4bcc60da 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt @@ -45,22 +45,6 @@ internal class ChildLegalEntityCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -214,23 +198,6 @@ internal class ChildLegalEntityCreateTest { assertThat(childLegalEntityCreate.businessDescription()).contains("business_description") assertThat(childLegalEntityCreate.businessName()).contains("business_name") assertThat(childLegalEntityCreate.citizenshipCountry()).contains("citizenship_country") - assertThat(childLegalEntityCreate.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) assertThat(childLegalEntityCreate.connectionId()).contains("connection_id") assertThat(childLegalEntityCreate.countryOfIncorporation()) .contains("country_of_incorporation") @@ -398,22 +365,6 @@ internal class ChildLegalEntityCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt index 6b42051f..dd8ef704 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt @@ -52,22 +52,7 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -221,30 +206,7 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -611,23 +573,8 @@ internal class ChildLegalEntityTest { assertThat(childLegalEntity.businessDescription()).contains("business_description") assertThat(childLegalEntity.businessName()).contains("business_name") assertThat(childLegalEntity.citizenshipCountry()).contains("citizenship_country") - assertThat(childLegalEntity.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + assertThat(childLegalEntity._complianceDetails()) + .isEqualTo(JsonValue.from(mapOf())) assertThat(childLegalEntity.countryOfIncorporation()).contains("country_of_incorporation") assertThat(childLegalEntity.createdAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -779,24 +726,7 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -1155,22 +1085,7 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -1324,30 +1239,7 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt index f1b8ffbd..0ef49ede 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt @@ -45,22 +45,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -138,34 +122,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -468,22 +424,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -562,34 +502,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -895,22 +807,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -988,34 +884,6 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index 17b09084..4c93190b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -134,22 +134,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -227,34 +211,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -658,22 +614,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -752,34 +692,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -1185,22 +1097,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -1278,34 +1174,6 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt index ff245009..a5b6ae1c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt @@ -158,6 +158,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -548,6 +549,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -930,6 +932,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt index 6eab9b31..dadf5b12 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt @@ -47,22 +47,6 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -238,22 +222,6 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -428,22 +396,6 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt index d1dacf18..660076b5 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt @@ -51,22 +51,6 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -228,22 +212,6 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -409,22 +377,6 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt index 5aa53d73..eb655435 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt @@ -56,22 +56,7 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -325,22 +310,7 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -595,22 +565,7 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt deleted file mode 100644 index 60b46bf1..00000000 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt +++ /dev/null @@ -1,79 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.moderntreasury.api.models - -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.moderntreasury.api.core.jsonMapper -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class LegalEntityComplianceDetailTest { - - @Test - fun create() { - val legalEntityComplianceDetail = - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - assertThat(legalEntityComplianceDetail.id()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(legalEntityComplianceDetail.createdAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.discardedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.issuer()).isEqualTo("issuer") - assertThat(legalEntityComplianceDetail.liveMode()).isEqualTo(true) - assertThat(legalEntityComplianceDetail.object_()).isEqualTo("object") - assertThat(legalEntityComplianceDetail.tokenExpiresAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.tokenIssuedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.tokenUrl()).contains("token_url") - assertThat(legalEntityComplianceDetail.updatedAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.entityValidated()).isEqualTo(true) - assertThat(legalEntityComplianceDetail.validatedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val legalEntityComplianceDetail = - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - val roundtrippedLegalEntityComplianceDetail = - jsonMapper.readValue( - jsonMapper.writeValueAsString(legalEntityComplianceDetail), - jacksonTypeRef(), - ) - - assertThat(roundtrippedLegalEntityComplianceDetail).isEqualTo(legalEntityComplianceDetail) - } -} diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt index 1cb1e9ff..d05dd129 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt @@ -43,22 +43,6 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -127,24 +111,6 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -385,22 +351,6 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -473,30 +423,6 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -747,23 +673,6 @@ internal class LegalEntityCreateParamsTest { assertThat(body.businessDescription()).contains("business_description") assertThat(body.businessName()).contains("business_name") assertThat(body.citizenshipCountry()).contains("citizenship_country") - assertThat(body.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) assertThat(body.connectionId()).contains("connection_id") assertThat(body.countryOfIncorporation()).contains("country_of_incorporation") assertThat(body.dateFormed()).contains(LocalDate.parse("2019-12-27")) @@ -835,24 +744,6 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt index fd140fda..bd9ea83f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt @@ -52,22 +52,7 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -294,30 +279,7 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -607,23 +569,7 @@ internal class LegalEntityTest { assertThat(legalEntity.businessDescription()).contains("business_description") assertThat(legalEntity.businessName()).contains("business_name") assertThat(legalEntity.citizenshipCountry()).contains("citizenship_country") - assertThat(legalEntity.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + assertThat(legalEntity._complianceDetails()).isEqualTo(JsonValue.from(mapOf())) assertThat(legalEntity.countryOfIncorporation()).contains("country_of_incorporation") assertThat(legalEntity.createdAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -849,24 +795,7 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -1141,22 +1070,7 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) @@ -1383,30 +1297,7 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .complianceDetails(JsonValue.from(mapOf())) .countryOfIncorporation("country_of_incorporation") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt index d3a9300f..2ca72e6a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt @@ -43,22 +43,6 @@ internal class LegalEntityUpdateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -210,22 +194,6 @@ internal class LegalEntityUpdateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -371,23 +339,6 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.businessDescription()).contains("business_description") assertThat(body.businessName()).contains("business_name") assertThat(body.citizenshipCountry()).contains("citizenship_country") - assertThat(body.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) assertThat(body.countryOfIncorporation()).contains("country_of_incorporation") assertThat(body.dateFormed()).contains(LocalDate.parse("2019-12-27")) assertThat(body.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt index 56eae445..d4e139f8 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt @@ -26,6 +26,7 @@ internal class PaymentOrderTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -253,6 +254,7 @@ internal class PaymentOrderTest { assertThat(paymentOrder.accountingLedgerClassId()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.amount()).isEqualTo(0L) + assertThat(paymentOrder.batchId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.chargeBearer()).contains(PaymentOrder.ChargeBearer.SHARED) assertThat(paymentOrder.counterpartyId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.createdAt()) @@ -504,6 +506,7 @@ internal class PaymentOrderTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 3db5d7c7..8c6af7e4 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -24,7 +24,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -182,22 +181,6 @@ internal class ServiceParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -276,34 +259,6 @@ internal class ServiceParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt index 83e75ea5..99e56b11 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt @@ -11,7 +11,6 @@ import com.moderntreasury.api.models.ConnectionLegalEntityUpdateParams import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -68,24 +67,6 @@ internal class ConnectionLegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -171,46 +152,6 @@ internal class ConnectionLegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index f82e5fc8..e2f5f108 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -16,7 +16,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -175,24 +174,6 @@ internal class CounterpartyServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -278,46 +259,6 @@ internal class CounterpartyServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt index 48eb7d4a..0cc88fc9 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt @@ -10,7 +10,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationCreateParams import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -71,24 +70,6 @@ internal class LegalEntityAssociationServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt index 16032d92..6339cb4a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt @@ -9,7 +9,6 @@ import com.moderntreasury.api.models.ChildLegalEntityCreate import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityCreateParams import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.LegalEntityUpdateParams @@ -65,22 +64,6 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -158,34 +141,6 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -489,22 +444,6 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt index 4d80399a..961a212a 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt @@ -11,7 +11,6 @@ import com.moderntreasury.api.models.ConnectionLegalEntityUpdateParams import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -68,24 +67,6 @@ internal class ConnectionLegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -171,46 +152,6 @@ internal class ConnectionLegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index 544b4a0c..61b54670 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -16,7 +16,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -175,24 +174,6 @@ internal class CounterpartyServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -278,46 +259,6 @@ internal class CounterpartyServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt index 7e322615..71a35ed2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt @@ -10,7 +10,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationCreateParams import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -71,24 +70,6 @@ internal class LegalEntityAssociationServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt index fd480528..4894972b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt @@ -9,7 +9,6 @@ import com.moderntreasury.api.models.ChildLegalEntityCreate import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityCreateParams import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.LegalEntityUpdateParams @@ -65,22 +64,6 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -158,34 +141,6 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) @@ -487,22 +442,6 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) From 0ebee2fdee13cc1901615869f5316200baa29ca3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:28:21 +0000 Subject: [PATCH 25/27] feat(api): api update --- .stats.yml | 4 ++-- .../moderntreasury/api/models/PaymentOrder.kt | 20 ------------------- .../api/models/PaymentReference.kt | 20 ------------------- .../moderntreasury/api/models/ReturnObject.kt | 20 ------------------- 4 files changed, 2 insertions(+), 62 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef3682f0..abe29a7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-a78ca984074c091219e7b10aefe1d72fbbd4f4297fb70b2a49bed1cb5999f27a.yml -openapi_spec_hash: c15c4f96e77008a4b2947be54c3def9a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e282dfeb7416cbb65fe2a845a0d486933c710dbe4a0d3147cc3f4795ac6e27ad.yml +openapi_spec_hash: bc74fd834f3270e8791f37e81368a409 config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt index 2ea155fb..f3742d7b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt @@ -5454,14 +5454,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -5575,8 +5567,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -5679,8 +5669,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -5787,10 +5775,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -5897,10 +5881,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt index 7567b250..8a27ad3f 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt @@ -667,14 +667,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -787,8 +779,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -889,8 +879,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -997,10 +985,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -1107,10 +1091,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt index 08a8154c..47600689 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt @@ -3122,14 +3122,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -3243,8 +3235,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -3347,8 +3337,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -3455,10 +3443,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -3565,10 +3549,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER From c7f92a5ec7beea400b0bb892d7930a95fa65fd04 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 18:28:22 +0000 Subject: [PATCH 26/27] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index abe29a7a..95ee6247 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e282dfeb7416cbb65fe2a845a0d486933c710dbe4a0d3147cc3f4795ac6e27ad.yml -openapi_spec_hash: bc74fd834f3270e8791f37e81368a409 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e4fb4d2325c0fbb78e23f4695b974e00d81dc4480789478dbdd0e077152cd623.yml +openapi_spec_hash: 218b6e6d70e344395adc2fc5ff4c8f66 config_hash: 196d1bf0caae233683efb6abc123941f From 34c4dcbb0abeaa4d8d28f954ca5e4a3b6574c51f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 18:29:00 +0000 Subject: [PATCH 27/27] release: 7.16.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 47 +++++++++++++++++++++++++++++++++++ README.md | 10 ++++---- build.gradle.kts | 2 +- 4 files changed, 54 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c28c5649..811e1841 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "7.15.1" + ".": "7.16.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d935fa..f2c97766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,52 @@ # Changelog +## 7.16.0 (2026-02-13) + +Full Changelog: [v7.15.1...v7.16.0](https://github.com/Modern-Treasury/modern-treasury-java/compare/v7.15.1...v7.16.0) + +### Features + +* **api:** api update ([0ebee2f](https://github.com/Modern-Treasury/modern-treasury-java/commit/0ebee2fdee13cc1901615869f5316200baa29ca3)) +* **api:** api update ([059766e](https://github.com/Modern-Treasury/modern-treasury-java/commit/059766e4bb2f1f5173050e3ae6ab60be32545386)) +* **api:** api update ([0e988d3](https://github.com/Modern-Treasury/modern-treasury-java/commit/0e988d3abb3f194c78a4bc3136537db1b325049a)) +* **api:** api update ([75c3488](https://github.com/Modern-Treasury/modern-treasury-java/commit/75c34880a3598ff9c1d70a01c6cb7b60942a4d14)) +* **api:** api update ([90660fe](https://github.com/Modern-Treasury/modern-treasury-java/commit/90660fedbfb03f5a991e7a470a76e2cdcffd06cd)) +* **api:** api update ([de3c957](https://github.com/Modern-Treasury/modern-treasury-java/commit/de3c957e75bc5bab282952b6e363fa7f3bcc8523)) +* **api:** api update ([90d7c73](https://github.com/Modern-Treasury/modern-treasury-java/commit/90d7c73431dbd1361d753d1933c050d82a7a8ff8)) +* **client:** send `X-Stainless-Kotlin-Version` header ([2892b70](https://github.com/Modern-Treasury/modern-treasury-java/commit/2892b70eccf5ddca0c23ea56d45f8a75ae263af3)) + + +### Bug Fixes + +* **client:** disallow coercion from float to int ([732590c](https://github.com/Modern-Treasury/modern-treasury-java/commit/732590c941aaa40bd6881f8e2d073b8676e26433)) +* **client:** fully respect max retries ([7437475](https://github.com/Modern-Treasury/modern-treasury-java/commit/74374754fa0114a61908280775d0f08112757b4a)) +* **client:** preserve time zone in lenient date-time parsing ([121d5c6](https://github.com/Modern-Treasury/modern-treasury-java/commit/121d5c6f42466017cf7a0a76793adcf1beab09da)) +* **client:** send retry count header for max retries 0 ([7437475](https://github.com/Modern-Treasury/modern-treasury-java/commit/74374754fa0114a61908280775d0f08112757b4a)) +* date time deserialization leniency ([d97de31](https://github.com/Modern-Treasury/modern-treasury-java/commit/d97de31d7cf11c29ce6c8e7dc9ad475c4f2f6c61)) +* **docs:** fix mcp installation instructions for remote servers ([611eed4](https://github.com/Modern-Treasury/modern-treasury-java/commit/611eed44fe5aefa6f34f3877bbaf6d618d22c864)) + + +### Chores + +* **ci:** upgrade `actions/github-script` ([38dfbce](https://github.com/Modern-Treasury/modern-treasury-java/commit/38dfbcefd6d91762eae1d7dc91bfc64f4f11b1a0)) +* **ci:** upgrade `actions/setup-java` ([56fc0ac](https://github.com/Modern-Treasury/modern-treasury-java/commit/56fc0ac0d37400764c578cb70d63c17788f28280)) +* **client:** improve example values ([9235076](https://github.com/Modern-Treasury/modern-treasury-java/commit/9235076457a287b3e6ed6746d9d4ec15f4f18799)) +* **internal:** allow passing args to `./scripts/test` ([9cd6197](https://github.com/Modern-Treasury/modern-treasury-java/commit/9cd6197fcfd104bb4a139105620f3cc7065fd5df)) +* **internal:** clean up maven repo artifact script and add html documentation to repo root ([3c5ae6d](https://github.com/Modern-Treasury/modern-treasury-java/commit/3c5ae6d5e0c2ab0dba492faf7778253068dc3fbc)) +* **internal:** codegen related update ([d17a141](https://github.com/Modern-Treasury/modern-treasury-java/commit/d17a141a575ba4c2dfe6f3009e0b2539f8ff27f3)) +* **internal:** correct cache invalidation for `SKIP_MOCK_TESTS` ([1b09008](https://github.com/Modern-Treasury/modern-treasury-java/commit/1b090089c69c910d2ba40cb46b728e62985078de)) +* **internal:** depend on packages directly in example ([7437475](https://github.com/Modern-Treasury/modern-treasury-java/commit/74374754fa0114a61908280775d0f08112757b4a)) +* **internal:** improve maven repo docs ([5a6e3fb](https://github.com/Modern-Treasury/modern-treasury-java/commit/5a6e3fba0c4c9977132b8fafa656c43d6b44d1d5)) +* **internal:** update `actions/checkout` version ([d17454d](https://github.com/Modern-Treasury/modern-treasury-java/commit/d17454de0303262f63b6a82f4b972fdb7d938580)) +* **internal:** update maven repo doc to include authentication ([43d2f3a](https://github.com/Modern-Treasury/modern-treasury-java/commit/43d2f3ab1cc718fb402776cde26fbcb61b56c7f3)) +* **internal:** upgrade AssertJ ([9984da5](https://github.com/Modern-Treasury/modern-treasury-java/commit/9984da52ae74a9b1629489d385def66853738e59)) +* test on Jackson 2.14.0 to avoid encountering FasterXML/jackson-databind[#3240](https://github.com/Modern-Treasury/modern-treasury-java/issues/3240) in tests ([d97de31](https://github.com/Modern-Treasury/modern-treasury-java/commit/d97de31d7cf11c29ce6c8e7dc9ad475c4f2f6c61)) + + +### Documentation + +* add comment for arbitrary value fields ([571f58c](https://github.com/Modern-Treasury/modern-treasury-java/commit/571f58c847371e19b4b62a85a92fce5b9d8bcbec)) + ## 7.15.1 (2026-01-14) Full Changelog: [v7.15.0...v7.15.1](https://github.com/Modern-Treasury/modern-treasury-java/compare/v7.15.0...v7.15.1) diff --git a/README.md b/README.md index 764b5995..ce636aac 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.moderntreasury.api/modern-treasury-java)](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.15.1) -[![javadoc](https://javadoc.io/badge2/com.moderntreasury.api/modern-treasury-java/7.15.1/javadoc.svg)](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.15.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.moderntreasury.api/modern-treasury-java)](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.16.0) +[![javadoc](https://javadoc.io/badge2/com.moderntreasury.api/modern-treasury-java/7.16.0/javadoc.svg)](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.16.0) @@ -22,7 +22,7 @@ Use the Modern Treasury MCP Server to enable AI assistants to interact with this -The REST API documentation can be found on [docs.moderntreasury.com](https://docs.moderntreasury.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.15.1). +The REST API documentation can be found on [docs.moderntreasury.com](https://docs.moderntreasury.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.16.0). @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.moderntreasury.com](https://doc ### Gradle ```kotlin -implementation("com.moderntreasury:modern-treasury-java:7.15.1") +implementation("com.moderntreasury:modern-treasury-java:7.16.0") ``` ### Maven @@ -42,7 +42,7 @@ implementation("com.moderntreasury:modern-treasury-java:7.15.1") com.moderntreasury modern-treasury-java - 7.15.1 + 7.16.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 29affe7f..0ec23595 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.moderntreasury" - version = "7.15.1" // x-release-please-version + version = "7.16.0" // x-release-please-version } subprojects {