diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5e577baed..db1a43881 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,10 +20,10 @@ 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
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
@@ -47,10 +47,10 @@ 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
+ uses: actions/setup-java@v5
with:
distribution: temurin
java-version: |
@@ -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());
@@ -85,10 +85,10 @@ 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
+ 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 80f2d5e55..5494db7b4 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - 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/release-doctor.yml b/.github/workflows/release-doctor.yml
index 5413d37d1..46b4faac5 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: |
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c28c56495..811e18415 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/.stats.yml b/.stats.yml
index 0b16fcb8d..95ee62470 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-e4fb4d2325c0fbb78e23f4695b974e00d81dc4480789478dbdd0e077152cd623.yml
+openapi_spec_hash: 218b6e6d70e344395adc2fc5ff4c8f66
config_hash: 196d1bf0caae233683efb6abc123941f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 50d935faa..f2c97766f 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 280911d6c..ce636aacc 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.15.1)
-[](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.15.1)
+[](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.16.0)
+[](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.16.0)
@@ -15,14 +15,14 @@ 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.
-[](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXX0)
-[](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)
+[](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXSwiZW52Ijp7Ik1PREVSTl9UUkVBU1VSWV9BUElfS0VZIjoiTXkgQVBJIEtleSIsIk1PREVSTl9UUkVBU1VSWV9PUkdBTklaQVRJT05fSUQiOiJteS1vcmdhbml6YXRpb24tSUQiLCJNT0RFUk5fVFJFQVNVUllfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)
+[](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.
-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
```
@@ -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/build.gradle.kts b/build.gradle.kts
index 29affe7fe..0ec235951 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 {
diff --git a/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts b/buildSrc/src/main/kotlin/modern-treasury.kotlin.gradle.kts
index 4a7519caf..debe9fa1a 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
diff --git a/modern-treasury-java-client-okhttp/build.gradle.kts b/modern-treasury-java-client-okhttp/build.gradle.kts
index 205e7798b..12a1a82f8 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-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 81900e96f..4be73f7f7 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/build.gradle.kts b/modern-treasury-java-core/build.gradle.kts
index a9c96a7a5..865d8b736 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")
}
}
@@ -32,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-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 fa8167813..8ed79fe5e 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()) {
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 11dd48059..4729a3f65 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,7 +24,8 @@ import java.io.InputStream
import java.time.DateTimeException
import java.time.LocalDate
import java.time.LocalDateTime
-import java.time.ZonedDateTime
+import java.time.OffsetDateTime
+import java.time.ZoneId
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)
@@ -47,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)
@@ -64,6 +66,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 +132,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 +149,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) {
@@ -150,17 +158,20 @@ private class LenientLocalDateTimeDeserializer :
return when {
!temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
- LocalDate.from(temporal).atStartOfDay()
+ LocalDate.from(temporal)
+ .atStartOfDay()
+ .atZone(ZoneId.of("UTC"))
+ .toOffsetDateTime()
!temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
- LocalDateTime.from(temporal)
- else -> ZonedDateTime.from(temporal).toLocalDateTime()
+ LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime()
+ else -> OffsetDateTime.from(temporal)
}
} 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/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 414b34c6d..1b4632fea 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?,
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 ca09c3406..9e6f2fa06 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 88c1e8cfc..4b41e4e09 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 4405522a0..5d031b2cd 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
@@ -7972,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
@@ -15659,6 +15685,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 +15719,7 @@ private constructor(
enum class Known {
AU_NUMBER,
BASE_ADDRESS,
+ CARD_TOKEN,
CLABE,
ETHEREUM_ADDRESS,
HK_NUMBER,
@@ -15719,6 +15748,7 @@ private constructor(
enum class Value {
AU_NUMBER,
BASE_ADDRESS,
+ CARD_TOKEN,
CLABE,
ETHEREUM_ADDRESS,
HK_NUMBER,
@@ -15749,6 +15779,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 +15808,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
@@ -17746,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/ChildLegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ChildLegalEntity.kt
index 825462fcf..ac415d584 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,12 +31,13 @@ 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,
private val dateOfBirth: JsonField,
private val discardedAt: JsonField,
+ private val documents: JsonField>,
private val doingBusinessAsNames: JsonField>,
private val email: JsonField,
private val expectedActivityVolume: JsonField,
@@ -48,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,
@@ -58,8 +60,12 @@ private constructor(
private val preferredName: JsonField,
private val prefix: JsonField,
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,
private val updatedAt: JsonField,
private val wealthAndEmploymentDetails: JsonField,
private val website: JsonField,
@@ -86,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(),
@@ -102,6 +108,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(),
@@ -130,6 +139,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")
@@ -152,10 +164,20 @@ 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("status") @ExcludeMissing status: 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(),
@@ -176,6 +198,7 @@ private constructor(
dateFormed,
dateOfBirth,
discardedAt,
+ documents,
doingBusinessAsNames,
email,
expectedActivityVolume,
@@ -187,6 +210,7 @@ private constructor(
legalEntityAssociations,
legalEntityType,
legalStructure,
+ listedExchange,
liveMode,
metadata,
middleName,
@@ -197,8 +221,12 @@ private constructor(
preferredName,
prefix,
primarySocialMediaSites,
+ regulators,
riskRating,
+ status,
suffix,
+ thirdPartyVerification,
+ tickerSymbol,
updatedAt,
wealthAndEmploymentDetails,
website,
@@ -252,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
@@ -296,6 +328,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 +350,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).
@@ -386,6 +424,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.
@@ -466,6 +512,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.
*
@@ -474,6 +528,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.
*
@@ -482,6 +544,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).
@@ -557,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].
*
@@ -613,6 +682,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].
*
@@ -712,6 +790,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].
*
@@ -795,6 +882,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].
*
@@ -804,6 +900,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].
*
@@ -811,6 +914,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].
*
@@ -869,6 +991,7 @@ private constructor(
* .dateFormed()
* .dateOfBirth()
* .discardedAt()
+ * .documents()
* .doingBusinessAsNames()
* .email()
* .expectedActivityVolume()
@@ -880,6 +1003,7 @@ private constructor(
* .legalEntityAssociations()
* .legalEntityType()
* .legalStructure()
+ * .listedExchange()
* .liveMode()
* .metadata()
* .middleName()
@@ -890,8 +1014,12 @@ private constructor(
* .preferredName()
* .prefix()
* .primarySocialMediaSites()
+ * .regulators()
* .riskRating()
+ * .status()
* .suffix()
+ * .thirdPartyVerification()
+ * .tickerSymbol()
* .updatedAt()
* .wealthAndEmploymentDetails()
* .website()
@@ -909,12 +1037,13 @@ 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
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
@@ -928,6 +1057,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
@@ -938,8 +1068,12 @@ 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 status: 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
@@ -959,6 +1093,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
@@ -972,6 +1107,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
@@ -984,8 +1120,12 @@ private constructor(
prefix = childLegalEntity.prefix
primarySocialMediaSites =
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
updatedAt = childLegalEntity.updatedAt
wealthAndEmploymentDetails = childLegalEntity.wealthAndEmploymentDetails
website = childLegalEntity.website
@@ -1105,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
}
@@ -1209,6 +1336,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 +1401,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))
@@ -1452,6 +1604,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.
@@ -1650,6 +1821,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))
@@ -1665,6 +1867,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))
@@ -1679,6 +1897,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))
/**
@@ -1765,6 +2023,7 @@ private constructor(
* .dateFormed()
* .dateOfBirth()
* .discardedAt()
+ * .documents()
* .doingBusinessAsNames()
* .email()
* .expectedActivityVolume()
@@ -1776,6 +2035,7 @@ private constructor(
* .legalEntityAssociations()
* .legalEntityType()
* .legalStructure()
+ * .listedExchange()
* .liveMode()
* .metadata()
* .middleName()
@@ -1786,8 +2046,12 @@ private constructor(
* .preferredName()
* .prefix()
* .primarySocialMediaSites()
+ * .regulators()
* .riskRating()
+ * .status()
* .suffix()
+ * .thirdPartyVerification()
+ * .tickerSymbol()
* .updatedAt()
* .wealthAndEmploymentDetails()
* .website()
@@ -1809,6 +2073,7 @@ private constructor(
checkRequired("dateFormed", dateFormed),
checkRequired("dateOfBirth", dateOfBirth),
checkRequired("discardedAt", discardedAt),
+ checkRequired("documents", documents).map { it.toImmutable() },
checkRequired("doingBusinessAsNames", doingBusinessAsNames).map {
it.toImmutable()
},
@@ -1826,6 +2091,7 @@ private constructor(
},
checkRequired("legalEntityType", legalEntityType),
checkRequired("legalStructure", legalStructure),
+ checkRequired("listedExchange", listedExchange),
checkRequired("liveMode", liveMode),
checkRequired("metadata", metadata),
checkRequired("middleName", middleName),
@@ -1840,8 +2106,12 @@ private constructor(
checkRequired("primarySocialMediaSites", primarySocialMediaSites).map {
it.toImmutable()
},
+ checkRequired("regulators", regulators).map { it.toImmutable() },
checkRequired("riskRating", riskRating),
+ checkRequired("status", status),
checkRequired("suffix", suffix),
+ checkRequired("thirdPartyVerification", thirdPartyVerification),
+ checkRequired("tickerSymbol", tickerSymbol),
checkRequired("updatedAt", updatedAt),
checkRequired("wealthAndEmploymentDetails", wealthAndEmploymentDetails),
checkRequired("website", website),
@@ -1862,12 +2132,12 @@ private constructor(
businessDescription()
businessName()
citizenshipCountry()
- complianceDetails().ifPresent { it.validate() }
countryOfIncorporation()
createdAt()
dateFormed()
dateOfBirth()
discardedAt()
+ documents().forEach { it.validate() }
doingBusinessAsNames()
email()
expectedActivityVolume()
@@ -1879,6 +2149,7 @@ private constructor(
legalEntityAssociations().ifPresent { it.forEach { it.validate() } }
legalEntityType().validate()
legalStructure().ifPresent { it.validate() }
+ listedExchange()
liveMode()
metadata().validate()
middleName()
@@ -1889,8 +2160,12 @@ private constructor(
preferredName()
prefix()
primarySocialMediaSites()
+ regulators().ifPresent { it.forEach { it.validate() } }
riskRating().ifPresent { it.validate() }
+ status().ifPresent { it.validate() }
suffix()
+ thirdPartyVerification().ifPresent { it.validate() }
+ tickerSymbol()
updatedAt()
wealthAndEmploymentDetails().ifPresent { it.validate() }
website()
@@ -1918,12 +2193,12 @@ 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) +
(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) +
@@ -1935,6 +2210,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) +
@@ -1945,8 +2221,12 @@ 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) +
+ (status.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)
@@ -3424,6 +3704,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 +3724,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 +3748,7 @@ private constructor(
id,
createdAt,
discardedAt,
+ documents,
expirationDate,
idType,
issuingCountry,
@@ -3492,6 +3777,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 +3861,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 +3952,7 @@ private constructor(
* .id()
* .createdAt()
* .discardedAt()
+ * .documents()
* .expirationDate()
* .idType()
* .issuingCountry()
@@ -3670,6 +3971,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 +3986,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 +4039,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 +4204,7 @@ private constructor(
* .id()
* .createdAt()
* .discardedAt()
+ * .documents()
* .expirationDate()
* .idType()
* .issuingCountry()
@@ -3892,6 +4221,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 +4243,7 @@ private constructor(
id()
createdAt()
discardedAt()
+ documents().forEach { it.validate() }
expirationDate()
idType().validate()
issuingCountry()
@@ -3942,6 +4273,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 +4541,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 +4557,7 @@ private constructor(
id,
createdAt,
discardedAt,
+ documents,
expirationDate,
idType,
issuingCountry,
@@ -4238,7 +4572,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. */
@@ -4780,75 +5114,331 @@ 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")
+ fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction")
- @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value))
- }
+ /**
+ * Full name of the regulatory body.
+ *
+ * @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 name(): String = name.getRequired("name")
- /** An enum containing [RiskRating]'s known values. */
- enum class Known {
- LOW,
- MEDIUM,
- HIGH,
- }
+ /**
+ * Registration or identification number with the regulator.
+ *
+ * @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 registrationNumber(): String = registrationNumber.getRequired("registration_number")
/**
- * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member.
+ * Returns the raw JSON value of [jurisdiction].
*
- * 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.
+ * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- enum class Value {
- LOW,
- MEDIUM,
- HIGH,
- /**
- * An enum member indicating that [RiskRating] was instantiated with an unknown value.
- */
- _UNKNOWN,
- }
+ @JsonProperty("jurisdiction")
+ @ExcludeMissing
+ fun _jurisdiction(): JsonField = jurisdiction
/**
- * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
- * if the class was instantiated with an unknown value.
+ * Returns the raw JSON value of [name].
*
- * Use the [known] method instead if you're certain the value is always known or if you want
- * to throw for the unknown case.
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
*/
- fun value(): Value =
- when (this) {
- LOW -> Value.LOW
- MEDIUM -> Value.MEDIUM
- HIGH -> Value.HIGH
- else -> Value._UNKNOWN
- }
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
/**
- * Returns an enum member corresponding to this class instance's value.
+ * Returns the raw JSON value of [registrationNumber].
*
- * Use the [value] method instead if you're uncertain the value is always known and don't
+ * 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
@@ -4916,6 +5506,480 @@ 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)
+ 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(
@@ -5021,7 +6085,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 +6480,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 +8220,7 @@ private constructor(
dateFormed == other.dateFormed &&
dateOfBirth == other.dateOfBirth &&
discardedAt == other.discardedAt &&
+ documents == other.documents &&
doingBusinessAsNames == other.doingBusinessAsNames &&
email == other.email &&
expectedActivityVolume == other.expectedActivityVolume &&
@@ -7167,6 +8232,7 @@ private constructor(
legalEntityAssociations == other.legalEntityAssociations &&
legalEntityType == other.legalEntityType &&
legalStructure == other.legalStructure &&
+ listedExchange == other.listedExchange &&
liveMode == other.liveMode &&
metadata == other.metadata &&
middleName == other.middleName &&
@@ -7177,8 +8243,12 @@ private constructor(
preferredName == other.preferredName &&
prefix == other.prefix &&
primarySocialMediaSites == other.primarySocialMediaSites &&
+ regulators == other.regulators &&
riskRating == other.riskRating &&
+ status == other.status &&
suffix == other.suffix &&
+ thirdPartyVerification == other.thirdPartyVerification &&
+ tickerSymbol == other.tickerSymbol &&
updatedAt == other.updatedAt &&
wealthAndEmploymentDetails == other.wealthAndEmploymentDetails &&
website == other.website &&
@@ -7199,6 +8269,7 @@ private constructor(
dateFormed,
dateOfBirth,
discardedAt,
+ documents,
doingBusinessAsNames,
email,
expectedActivityVolume,
@@ -7210,6 +8281,7 @@ private constructor(
legalEntityAssociations,
legalEntityType,
legalStructure,
+ listedExchange,
liveMode,
metadata,
middleName,
@@ -7220,8 +8292,12 @@ private constructor(
preferredName,
prefix,
primarySocialMediaSites,
+ regulators,
riskRating,
+ status,
suffix,
+ thirdPartyVerification,
+ tickerSymbol,
updatedAt,
wealthAndEmploymentDetails,
website,
@@ -7232,5 +8308,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, 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 a5f12ab3a..5df909c80 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,7 @@ 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,
private val dateOfBirth: JsonField,
@@ -45,6 +45,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>,
@@ -53,8 +54,12 @@ private constructor(
private val preferredName: JsonField,
private val prefix: JsonField,
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,
private val wealthAndEmploymentDetails: JsonField,
private val website: JsonField,
private val additionalProperties: MutableMap,
@@ -77,9 +82,9 @@ private constructor(
@JsonProperty("citizenship_country")
@ExcludeMissing
citizenshipCountry: JsonField = JsonMissing.of(),
- @JsonProperty("compliance_details")
+ @JsonProperty("connection_id")
@ExcludeMissing
- complianceDetails: JsonField = JsonMissing.of(),
+ connectionId: JsonField = JsonMissing.of(),
@JsonProperty("country_of_incorporation")
@ExcludeMissing
countryOfIncorporation: JsonField = JsonMissing.of(),
@@ -118,6 +123,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
@@ -138,10 +146,20 @@ 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("status") @ExcludeMissing status: 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(),
@@ -152,7 +170,7 @@ private constructor(
businessDescription,
businessName,
citizenshipCountry,
- complianceDetails,
+ connectionId,
countryOfIncorporation,
dateFormed,
dateOfBirth,
@@ -167,6 +185,7 @@ private constructor(
legalEntityAssociations,
legalEntityType,
legalStructure,
+ listedExchange,
metadata,
middleName,
operatingJurisdictions,
@@ -175,8 +194,12 @@ private constructor(
preferredName,
prefix,
primarySocialMediaSites,
+ regulators,
riskRating,
+ status,
suffix,
+ thirdPartyVerification,
+ tickerSymbol,
wealthAndEmploymentDetails,
website,
mutableMapOf(),
@@ -224,11 +247,15 @@ private constructor(
citizenshipCountry.getOptional("citizenship_country")
/**
+ * 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 complianceDetails(): Optional =
- complianceDetails.getOptional("compliance_details")
+ 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
@@ -272,7 +299,7 @@ private constructor(
fun email(): Optional