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 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.moderntreasury.api/modern-treasury-java)](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.15.1) -[![javadoc](https://javadoc.io/badge2/com.moderntreasury.api/modern-treasury-java/7.15.1/javadoc.svg)](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.15.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.moderntreasury.api/modern-treasury-java)](https://central.sonatype.com/artifact/com.moderntreasury.api/modern-treasury-java/7.16.0) +[![javadoc](https://javadoc.io/badge2/com.moderntreasury.api/modern-treasury-java/7.16.0/javadoc.svg)](https://javadoc.io/doc/com.moderntreasury.api/modern-treasury-java/7.16.0) @@ -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. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXSwiZW52Ijp7Ik1PREVSTl9UUkVBU1VSWV9BUElfS0VZIjoiTXkgQVBJIEtleSIsIk1PREVSTl9UUkVBU1VSWV9PUkdBTklaQVRJT05fSUQiOiJteS1vcmdhbml6YXRpb24tSUQiLCJNT0RFUk5fVFJFQVNVUllfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%2C%22env%22%3A%7B%22MODERN_TREASURY_API_KEY%22%3A%22My%20API%20Key%22%2C%22MODERN_TREASURY_ORGANIZATION_ID%22%3A%22my-organization-ID%22%2C%22MODERN_TREASURY_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D) > Note: You may need to set environment variables in your MCP client. -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 = 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). @@ -348,6 +375,14 @@ private constructor( */ fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -413,6 +448,14 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -421,6 +464,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. * @@ -429,6 +480,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -492,14 +560,13 @@ private constructor( fun _citizenshipCountry(): JsonField = citizenshipCountry /** - * Returns the raw JSON value of [complianceDetails]. + * Returns the raw JSON value of [connectionId]. * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("compliance_details") + @JsonProperty("connection_id") @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails + fun _connectionId(): JsonField = connectionId /** * Returns the raw JSON value of [countryOfIncorporation]. @@ -628,6 +695,15 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -697,6 +773,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]. * @@ -706,6 +791,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]. * @@ -713,6 +805,25 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -757,7 +868,7 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -776,6 +887,7 @@ private constructor( null private var legalEntityType: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -784,8 +896,12 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -798,7 +914,7 @@ private constructor( businessDescription = childLegalEntityCreate.businessDescription businessName = childLegalEntityCreate.businessName citizenshipCountry = childLegalEntityCreate.citizenshipCountry - complianceDetails = childLegalEntityCreate.complianceDetails + connectionId = childLegalEntityCreate.connectionId countryOfIncorporation = childLegalEntityCreate.countryOfIncorporation dateFormed = childLegalEntityCreate.dateFormed dateOfBirth = childLegalEntityCreate.dateOfBirth @@ -816,6 +932,7 @@ private constructor( childLegalEntityCreate.legalEntityAssociations.map { it.toMutableList() } legalEntityType = childLegalEntityCreate.legalEntityType legalStructure = childLegalEntityCreate.legalStructure + listedExchange = childLegalEntityCreate.listedExchange metadata = childLegalEntityCreate.metadata middleName = childLegalEntityCreate.middleName operatingJurisdictions = @@ -826,8 +943,12 @@ private constructor( prefix = childLegalEntityCreate.prefix primarySocialMediaSites = childLegalEntityCreate.primarySocialMediaSites.map { it.toMutableList() } + regulators = childLegalEntityCreate.regulators.map { it.toMutableList() } riskRating = childLegalEntityCreate.riskRating + status = childLegalEntityCreate.status suffix = childLegalEntityCreate.suffix + thirdPartyVerification = childLegalEntityCreate.thirdPartyVerification + tickerSymbol = childLegalEntityCreate.tickerSymbol wealthAndEmploymentDetails = childLegalEntityCreate.wealthAndEmploymentDetails website = childLegalEntityCreate.website additionalProperties = childLegalEntityCreate.additionalProperties.toMutableMap() @@ -937,22 +1058,26 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = connectionId(JsonField.ofNullable(connectionId)) - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = connectionId(connectionId.getOrNull()) /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. + * Sets [Builder.connectionId] 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. + * You should usually call [Builder.connectionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun complianceDetails(complianceDetails: JsonField) = apply { - this.complianceDetails = complianceDetails + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId } /** @@ -1052,7 +1177,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)) @@ -1257,6 +1382,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1430,6 +1574,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)) @@ -1445,6 +1620,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)) @@ -1459,6 +1650,46 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -1527,7 +1758,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1542,6 +1773,7 @@ private constructor( (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalEntityType, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -1550,8 +1782,12 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -1570,7 +1806,7 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -1585,6 +1821,7 @@ private constructor( legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalEntityType().ifPresent { it.validate() } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -1593,8 +1830,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() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -1620,7 +1861,7 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -1635,6 +1876,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -1643,8 +1885,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) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -2810,140 +3056,870 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. + * Returns the raw JSON value of [jurisdiction]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. + * Returns the raw JSON value of [name]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not have - * the expected primitive type. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns the raw JSON value of [registrationNumber]. * - * Used for best match union deserialization. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - return other is RiskRating && value == other.value + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - override fun hashCode() = value.hashCode() + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - override fun toString() = value.toString() + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** 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 @@ -3051,7 +4027,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3446,7 +4422,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)) /** @@ -5179,7 +6155,7 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -5194,6 +6170,7 @@ private constructor( legalEntityAssociations == other.legalEntityAssociations && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -5202,8 +6179,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 && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -5216,7 +6197,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5231,6 +6212,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -5239,8 +6221,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -5250,5 +6236,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "ChildLegalEntityCreate{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt index 8b76ecd39..7e5a560d0 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParams.kt @@ -581,7 +581,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, @@ -596,6 +596,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>, @@ -604,8 +605,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, @@ -628,9 +633,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(), @@ -673,6 +678,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(), @@ -695,10 +703,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 = @@ -710,7 +728,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -725,6 +743,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -733,8 +752,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -783,11 +806,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 @@ -831,7 +858,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). @@ -908,6 +935,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -973,6 +1008,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -981,6 +1025,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. * @@ -989,6 +1041,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1054,14 +1123,14 @@ private constructor( fun _citizenshipCountry(): JsonField = citizenshipCountry /** - * Returns the raw JSON value of [complianceDetails]. + * Returns the raw JSON value of [connectionId]. * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("compliance_details") + @JsonProperty("connection_id") @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails + fun _connectionId(): JsonField = connectionId /** * Returns the raw JSON value of [countryOfIncorporation]. @@ -1193,6 +1262,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -1266,6 +1345,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]. * @@ -1275,6 +1363,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]. * @@ -1282,6 +1377,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -1326,7 +1441,7 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -1345,6 +1460,7 @@ private constructor( null private var legalEntityType: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -1353,8 +1469,12 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -1367,7 +1487,7 @@ private constructor( businessDescription = legalEntity.businessDescription businessName = legalEntity.businessName citizenshipCountry = legalEntity.citizenshipCountry - complianceDetails = legalEntity.complianceDetails + connectionId = legalEntity.connectionId countryOfIncorporation = legalEntity.countryOfIncorporation dateFormed = legalEntity.dateFormed dateOfBirth = legalEntity.dateOfBirth @@ -1384,6 +1504,7 @@ private constructor( legalEntity.legalEntityAssociations.map { it.toMutableList() } legalEntityType = legalEntity.legalEntityType legalStructure = legalEntity.legalStructure + listedExchange = legalEntity.listedExchange metadata = legalEntity.metadata middleName = legalEntity.middleName operatingJurisdictions = @@ -1394,8 +1515,12 @@ private constructor( prefix = legalEntity.prefix primarySocialMediaSites = legalEntity.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating + status = legalEntity.status suffix = legalEntity.suffix + thirdPartyVerification = legalEntity.thirdPartyVerification + tickerSymbol = legalEntity.tickerSymbol wealthAndEmploymentDetails = legalEntity.wealthAndEmploymentDetails website = legalEntity.website additionalProperties = legalEntity.additionalProperties.toMutableMap() @@ -1509,26 +1634,29 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. + * Sets [Builder.connectionId] 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. + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or @@ -1631,7 +1759,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)) @@ -1842,6 +1970,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2019,6 +2166,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)) @@ -2036,6 +2214,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2051,6 +2247,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -2120,7 +2358,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2135,6 +2373,7 @@ private constructor( (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalEntityType, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -2143,8 +2382,12 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -2163,7 +2406,7 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -2178,6 +2421,7 @@ private constructor( legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalEntityType().ifPresent { it.validate() } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -2186,8 +2430,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() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -2214,7 +2462,7 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -2231,6 +2479,7 @@ private constructor( ?: 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -2239,8 +2488,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) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -3443,117 +3696,731 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : - Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. + * Returns the raw JSON value of [jurisdiction]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [name]. * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not - * have the expected primitive type. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - private var validated: Boolean = false + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - known() - validated = true - } + fun toBuilder() = Builder().from(this) - fun isValid(): Boolean = - try { + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format + * (e.g., "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * 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) { @@ -3566,19 +4433,156 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @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 RiskRating && value == other.value + return other is ThirdPartyVerification && + vendor == other.vendor && + vendorVerificationId == other.vendorVerificationId && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { + Objects.hash(vendor, vendorVerificationId, additionalProperties) + } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "ThirdPartyVerification{vendor=$vendor, vendorVerificationId=$vendorVerificationId, additionalProperties=$additionalProperties}" } class LegalEntityWealthEmploymentDetail @@ -3689,7 +4693,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). @@ -4101,7 +5105,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)) @@ -5862,7 +6866,7 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -5877,6 +6881,7 @@ private constructor( legalEntityAssociations == other.legalEntityAssociations && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -5885,8 +6890,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 && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -5899,7 +6908,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5914,6 +6923,7 @@ private constructor( legalEntityAssociations, legalEntityType, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -5922,8 +6932,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -5933,7 +6947,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntity{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt index 5ed064379..29c95d15d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/CounterpartyCreateParams.kt @@ -2461,6 +2461,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -2492,6 +2494,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -2520,6 +2523,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -2550,6 +2554,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -2578,6 +2583,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER @@ -3940,7 +3946,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, @@ -3954,6 +3960,7 @@ private constructor( private val lastName: JsonField, private val legalEntityAssociations: JsonField>, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -3962,8 +3969,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, @@ -3989,9 +4000,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(), @@ -4031,6 +4042,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(), @@ -4053,10 +4067,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 = @@ -4069,7 +4093,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -4083,6 +4107,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -4091,8 +4116,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -4149,11 +4178,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 @@ -4197,7 +4230,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). @@ -4265,6 +4298,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -4330,6 +4371,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -4338,6 +4388,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. * @@ -4346,6 +4404,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4421,14 +4496,14 @@ private constructor( fun _citizenshipCountry(): JsonField = citizenshipCountry /** - * Returns the raw JSON value of [complianceDetails]. + * Returns the raw JSON value of [connectionId]. * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("compliance_details") + @JsonProperty("connection_id") @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails + fun _connectionId(): JsonField = connectionId /** * Returns the raw JSON value of [countryOfIncorporation]. @@ -4550,6 +4625,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -4623,6 +4708,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]. * @@ -4632,6 +4726,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]. * @@ -4639,6 +4740,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -4691,7 +4812,7 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -4709,6 +4830,7 @@ private constructor( JsonField>? = null private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -4717,8 +4839,12 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -4732,7 +4858,7 @@ private constructor( businessDescription = legalEntityCreateRequest.businessDescription businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry - complianceDetails = legalEntityCreateRequest.complianceDetails + connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed dateOfBirth = legalEntityCreateRequest.dateOfBirth @@ -4750,6 +4876,7 @@ private constructor( legalEntityAssociations = legalEntityCreateRequest.legalEntityAssociations.map { it.toMutableList() } legalStructure = legalEntityCreateRequest.legalStructure + listedExchange = legalEntityCreateRequest.listedExchange metadata = legalEntityCreateRequest.metadata middleName = legalEntityCreateRequest.middleName operatingJurisdictions = @@ -4760,8 +4887,12 @@ private constructor( prefix = legalEntityCreateRequest.prefix primarySocialMediaSites = legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating + status = legalEntityCreateRequest.status suffix = legalEntityCreateRequest.suffix + thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification + tickerSymbol = legalEntityCreateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityCreateRequest.wealthAndEmploymentDetails website = legalEntityCreateRequest.website additionalProperties = legalEntityCreateRequest.additionalProperties.toMutableMap() @@ -4890,26 +5021,29 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. + * Sets [Builder.connectionId] 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. + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or @@ -5012,7 +5146,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)) @@ -5208,6 +5342,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -5385,6 +5538,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)) @@ -5402,6 +5586,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -5417,6 +5619,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -5494,7 +5738,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -5508,6 +5752,7 @@ private constructor( lastName, (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -5516,8 +5761,12 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -5537,7 +5786,7 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -5551,6 +5800,7 @@ private constructor( lastName() legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -5559,8 +5809,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() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -5588,7 +5842,7 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -5604,6 +5858,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -5612,8 +5867,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) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -6816,142 +7075,893 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } - /** The risk rating of the legal entity. One of low, medium, high. */ - class RiskRating @JsonCreator private constructor(private val value: JsonField) : - Enum { + class LegalEntityRegulator + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val jurisdiction: JsonField, + private val name: JsonField, + private val registrationNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("jurisdiction") + @ExcludeMissing + jurisdiction: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("registration_number") + @ExcludeMissing + registrationNumber: JsonField = JsonMissing.of(), + ) : this(jurisdiction, name, registrationNumber, mutableMapOf()) /** - * Returns this class instance's raw value. + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOW = of("low") - - @JvmField val MEDIUM = of("medium") - - @JvmField val HIGH = of("high") - - @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) - } - - /** An enum containing [RiskRating]'s known values. */ - enum class Known { - LOW, - MEDIUM, - HIGH, - } + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") /** - * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * Full name of the regulatory body. * - * An instance of [RiskRating] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - enum class Value { - LOW, - MEDIUM, - HIGH, - /** - * An enum member indicating that [RiskRating] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + fun name(): String = name.getRequired("name") /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * Registration or identification number with the regulator. * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun value(): Value = - when (this) { - LOW -> Value.LOW - MEDIUM -> Value.MEDIUM - HIGH -> Value.HIGH - else -> Value._UNKNOWN - } + fun registrationNumber(): String = registrationNumber.getRequired("registration_number") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. + * Returns the raw JSON value of [jurisdiction]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a - * known member. + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun known(): Known = - when (this) { - LOW -> Known.LOW - MEDIUM -> Known.MEDIUM - HIGH -> Known.HIGH - else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") - } + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. + * Returns the raw JSON value of [name]. * - * @throws ModernTreasuryInvalidDataException if this class instance's value does not - * have the expected primitive type. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. */ - fun asString(): String = - _value().asString().orElseThrow { - ModernTreasuryInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): RiskRating = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns the raw JSON value of [registrationNumber]. * - * Used for best match union deserialization. + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber - return other is RiskRating && value == other.value + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format + * (e.g., "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val LOW = of("low") + + @JvmField val MEDIUM = of("medium") + + @JvmField val HIGH = of("high") + + @JvmStatic fun of(value: String) = RiskRating(JsonField.of(value)) + } + + /** An enum containing [RiskRating]'s known values. */ + enum class Known { + LOW, + MEDIUM, + HIGH, + } + + /** + * An enum containing [RiskRating]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [RiskRating] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + LOW, + MEDIUM, + HIGH, + /** + * An enum member indicating that [RiskRating] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LOW -> Value.LOW + MEDIUM -> Value.MEDIUM + HIGH -> Value.HIGH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + LOW -> Known.LOW + MEDIUM -> Known.MEDIUM + HIGH -> Known.HIGH + else -> throw ModernTreasuryInvalidDataException("Unknown RiskRating: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RiskRating = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RiskRating && value == other.value } override fun hashCode() = value.hashCode() - override fun toString() = value.toString() + 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 @@ -7062,7 +8072,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). @@ -7474,7 +8484,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)) @@ -9236,7 +10246,7 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -9250,6 +10260,7 @@ private constructor( lastName == other.lastName && legalEntityAssociations == other.legalEntityAssociations && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -9258,8 +10269,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 && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -9273,7 +10288,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -9287,6 +10302,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -9295,8 +10311,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -9306,7 +10326,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt index a3ffa79db..c4be80dbf 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPayment.kt @@ -340,12 +340,26 @@ private constructor( */ fun object_(): String = object_.getRequired("object") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPayment.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPayment.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt index b6f739fc5..6b5f0b786 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentCreateParams.kt @@ -185,10 +185,24 @@ private constructor( */ fun metadata(): Optional = body.metadata() - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateParams.reconciliationFilters().convert(MyClass.class); + * ``` + */ fun _reconciliationFilters(): JsonValue = body._reconciliationFilters() - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateParams.reconciliationGroups().convert(MyClass.class); + * ``` + */ fun _reconciliationGroups(): JsonValue = body._reconciliationGroups() /** @@ -1382,12 +1396,26 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentCreateRequest.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt index f90ec9706..a43f52379 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExpectedPaymentUpdateParams.kt @@ -161,10 +161,24 @@ private constructor( */ fun metadata(): Optional = body.metadata() - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateParams.reconciliationFilters().convert(MyClass.class); + * ``` + */ fun _reconciliationFilters(): JsonValue = body._reconciliationFilters() - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateParams.reconciliationGroups().convert(MyClass.class); + * ``` + */ fun _reconciliationGroups(): JsonValue = body._reconciliationGroups() /** @@ -1277,12 +1291,26 @@ private constructor( */ fun metadata(): Optional = metadata.getOptional("metadata") - /** The reconciliation filters you have for this payment. */ + /** + * The reconciliation filters you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequest.reconciliationFilters().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_filters") @ExcludeMissing fun _reconciliationFilters(): JsonValue = reconciliationFilters - /** The reconciliation groups you have for this payment. */ + /** + * The reconciliation groups you have for this payment. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = expectedPaymentUpdateRequest.reconciliationGroups().convert(MyClass.class); + * ``` + */ @JsonProperty("reconciliation_groups") @ExcludeMissing fun _reconciliationGroups(): JsonValue = reconciliationGroups diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt index cabc5c6ec..425b89d7b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParams.kt @@ -1684,6 +1684,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1715,6 +1717,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1742,6 +1745,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1772,6 +1776,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1800,6 +1805,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt index 3f913d091..204ae77aa 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetail.kt @@ -50,6 +50,9 @@ private constructor( private val virtualAccount: JsonField, private val virtualAccountId: JsonField, private val originatingAccountNumber: JsonField, + private val originatingPartyAddress: JsonField
, + private val originatingPartyName: JsonField, + private val originatingPartyVendorIdentifier: JsonField, private val additionalProperties: MutableMap, ) { @@ -113,6 +116,15 @@ private constructor( @JsonProperty("originating_account_number") @ExcludeMissing originatingAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("originating_party_address") + @ExcludeMissing + originatingPartyAddress: JsonField
= JsonMissing.of(), + @JsonProperty("originating_party_name") + @ExcludeMissing + originatingPartyName: JsonField = JsonMissing.of(), + @JsonProperty("originating_party_vendor_identifier") + @ExcludeMissing + originatingPartyVendorIdentifier: JsonField = JsonMissing.of(), ) : this( id, amount, @@ -140,6 +152,9 @@ private constructor( virtualAccount, virtualAccountId, originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, mutableMapOf(), ) @@ -354,6 +369,34 @@ private constructor( fun originatingAccountNumber(): Optional = originatingAccountNumber.getOptional("originating_account_number") + /** + * The address of the originating party for the incoming payment detail, or `null`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyAddress(): Optional
= + originatingPartyAddress.getOptional("originating_party_address") + + /** + * The name of the originating party for the incoming payment detail. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyName(): Optional = + originatingPartyName.getOptional("originating_party_name") + + /** + * The vendor-assigned identifier for the originating party of the incoming payment detail, or + * `null`. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun originatingPartyVendorIdentifier(): Optional = + originatingPartyVendorIdentifier.getOptional("originating_party_vendor_identifier") + /** * Returns the raw JSON value of [id]. * @@ -578,6 +621,36 @@ private constructor( @ExcludeMissing fun _originatingAccountNumber(): JsonField = originatingAccountNumber + /** + * Returns the raw JSON value of [originatingPartyAddress]. + * + * Unlike [originatingPartyAddress], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("originating_party_address") + @ExcludeMissing + fun _originatingPartyAddress(): JsonField
= originatingPartyAddress + + /** + * Returns the raw JSON value of [originatingPartyName]. + * + * Unlike [originatingPartyName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("originating_party_name") + @ExcludeMissing + fun _originatingPartyName(): JsonField = originatingPartyName + + /** + * Returns the raw JSON value of [originatingPartyVendorIdentifier]. + * + * Unlike [originatingPartyVendorIdentifier], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("originating_party_vendor_identifier") + @ExcludeMissing + fun _originatingPartyVendorIdentifier(): JsonField = originatingPartyVendorIdentifier + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -656,6 +729,9 @@ private constructor( private var virtualAccount: JsonField? = null private var virtualAccountId: JsonField? = null private var originatingAccountNumber: JsonField = JsonMissing.of() + private var originatingPartyAddress: JsonField
= JsonMissing.of() + private var originatingPartyName: JsonField = JsonMissing.of() + private var originatingPartyVendorIdentifier: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -686,6 +762,10 @@ private constructor( virtualAccount = incomingPaymentDetail.virtualAccount virtualAccountId = incomingPaymentDetail.virtualAccountId originatingAccountNumber = incomingPaymentDetail.originatingAccountNumber + originatingPartyAddress = incomingPaymentDetail.originatingPartyAddress + originatingPartyName = incomingPaymentDetail.originatingPartyName + originatingPartyVendorIdentifier = + incomingPaymentDetail.originatingPartyVendorIdentifier additionalProperties = incomingPaymentDetail.additionalProperties.toMutableMap() } @@ -1110,6 +1190,76 @@ private constructor( this.originatingAccountNumber = originatingAccountNumber } + /** The address of the originating party for the incoming payment detail, or `null`. */ + fun originatingPartyAddress(originatingPartyAddress: Address?) = + originatingPartyAddress(JsonField.ofNullable(originatingPartyAddress)) + + /** + * Alias for calling [Builder.originatingPartyAddress] with + * `originatingPartyAddress.orElse(null)`. + */ + fun originatingPartyAddress(originatingPartyAddress: Optional
) = + originatingPartyAddress(originatingPartyAddress.getOrNull()) + + /** + * Sets [Builder.originatingPartyAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyAddress] with a well-typed [Address] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun originatingPartyAddress(originatingPartyAddress: JsonField
) = apply { + this.originatingPartyAddress = originatingPartyAddress + } + + /** The name of the originating party for the incoming payment detail. */ + fun originatingPartyName(originatingPartyName: String?) = + originatingPartyName(JsonField.ofNullable(originatingPartyName)) + + /** + * Alias for calling [Builder.originatingPartyName] with + * `originatingPartyName.orElse(null)`. + */ + fun originatingPartyName(originatingPartyName: Optional) = + originatingPartyName(originatingPartyName.getOrNull()) + + /** + * Sets [Builder.originatingPartyName] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun originatingPartyName(originatingPartyName: JsonField) = apply { + this.originatingPartyName = originatingPartyName + } + + /** + * The vendor-assigned identifier for the originating party of the incoming payment detail, + * or `null`. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: String?) = + originatingPartyVendorIdentifier(JsonField.ofNullable(originatingPartyVendorIdentifier)) + + /** + * Alias for calling [Builder.originatingPartyVendorIdentifier] with + * `originatingPartyVendorIdentifier.orElse(null)`. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: Optional) = + originatingPartyVendorIdentifier(originatingPartyVendorIdentifier.getOrNull()) + + /** + * Sets [Builder.originatingPartyVendorIdentifier] to an arbitrary JSON value. + * + * You should usually call [Builder.originatingPartyVendorIdentifier] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun originatingPartyVendorIdentifier(originatingPartyVendorIdentifier: JsonField) = + apply { + this.originatingPartyVendorIdentifier = originatingPartyVendorIdentifier + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1193,6 +1343,9 @@ private constructor( checkRequired("virtualAccount", virtualAccount), checkRequired("virtualAccountId", virtualAccountId), originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, additionalProperties.toMutableMap(), ) } @@ -1230,6 +1383,9 @@ private constructor( virtualAccount().ifPresent { it.validate() } virtualAccountId() originatingAccountNumber() + originatingPartyAddress().ifPresent { it.validate() } + originatingPartyName() + originatingPartyVendorIdentifier() validated = true } @@ -1273,7 +1429,10 @@ private constructor( (if (vendorId.asKnown().isPresent) 1 else 0) + (virtualAccount.asKnown().getOrNull()?.validity() ?: 0) + (if (virtualAccountId.asKnown().isPresent) 1 else 0) + - (if (originatingAccountNumber.asKnown().isPresent) 1 else 0) + (if (originatingAccountNumber.asKnown().isPresent) 1 else 0) + + (originatingPartyAddress.asKnown().getOrNull()?.validity() ?: 0) + + (if (originatingPartyName.asKnown().isPresent) 1 else 0) + + (if (originatingPartyVendorIdentifier.asKnown().isPresent) 1 else 0) /** The raw data from the payment pre-notification file that we get from the bank. */ class Data @@ -1496,6 +1655,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1527,6 +1688,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1555,6 +1717,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1585,6 +1748,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1613,6 +1777,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 @@ -2477,6 +2642,9 @@ private constructor( virtualAccount == other.virtualAccount && virtualAccountId == other.virtualAccountId && originatingAccountNumber == other.originatingAccountNumber && + originatingPartyAddress == other.originatingPartyAddress && + originatingPartyName == other.originatingPartyName && + originatingPartyVendorIdentifier == other.originatingPartyVendorIdentifier && additionalProperties == other.additionalProperties } @@ -2508,6 +2676,9 @@ private constructor( virtualAccount, virtualAccountId, originatingAccountNumber, + originatingPartyAddress, + originatingPartyName, + originatingPartyVendorIdentifier, additionalProperties, ) } @@ -2515,5 +2686,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IncomingPaymentDetail{id=$id, amount=$amount, asOfDate=$asOfDate, createdAt=$createdAt, currency=$currency, data=$data, direction=$direction, internalAccountId=$internalAccountId, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, object_=$object_, originatingAccountNumberSafe=$originatingAccountNumberSafe, originatingAccountNumberType=$originatingAccountNumberType, originatingRoutingNumber=$originatingRoutingNumber, originatingRoutingNumberType=$originatingRoutingNumberType, reconciliationStatus=$reconciliationStatus, status=$status, transactionId=$transactionId, transactionLineItemId=$transactionLineItemId, type=$type, updatedAt=$updatedAt, vendorId=$vendorId, virtualAccount=$virtualAccount, virtualAccountId=$virtualAccountId, originatingAccountNumber=$originatingAccountNumber, additionalProperties=$additionalProperties}" + "IncomingPaymentDetail{id=$id, amount=$amount, asOfDate=$asOfDate, createdAt=$createdAt, currency=$currency, data=$data, direction=$direction, internalAccountId=$internalAccountId, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, object_=$object_, originatingAccountNumberSafe=$originatingAccountNumberSafe, originatingAccountNumberType=$originatingAccountNumberType, originatingRoutingNumber=$originatingRoutingNumber, originatingRoutingNumberType=$originatingRoutingNumberType, reconciliationStatus=$reconciliationStatus, status=$status, transactionId=$transactionId, transactionLineItemId=$transactionLineItemId, type=$type, updatedAt=$updatedAt, vendorId=$vendorId, virtualAccount=$virtualAccount, virtualAccountId=$virtualAccountId, originatingAccountNumber=$originatingAccountNumber, originatingPartyAddress=$originatingPartyAddress, originatingPartyName=$originatingPartyName, originatingPartyVendorIdentifier=$originatingPartyVendorIdentifier, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt index e5effb496..d12db9028 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailCreateAsyncParams.kt @@ -55,6 +55,11 @@ private constructor( /** * An object passed through to the simulated IPD that could reflect what a vendor would pass. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = incomingPaymentDetailCreateAsyncParams.data().convert(MyClass.class); + * ``` */ fun _data(): JsonValue = body._data() @@ -544,6 +549,11 @@ private constructor( /** * An object passed through to the simulated IPD that could reflect what a vendor would * pass. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = incomingPaymentDetailCreateRequest.data().convert(MyClass.class); + * ``` */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt index 307e5d3e9..aac5fdd7f 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/JournalReportUpdateParams.kt @@ -30,6 +30,12 @@ private constructor( fun id(): Optional = Optional.ofNullable(id) + /** + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = journalReportUpdateParams.metadata().convert(MyClass.class); + * ``` + */ fun _metadata(): JsonValue = body._metadata() /** @@ -265,6 +271,12 @@ private constructor( @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), ) : this(metadata, status, mutableMapOf()) + /** + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = body.metadata().convert(MyClass.class); + * ``` + */ @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonValue = metadata /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt index 776fe5045..8ed27e5df 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParams.kt @@ -78,6 +78,14 @@ private constructor( */ fun description(): Optional = body.description() + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalId(): Optional = body.externalId() + /** * The array of ledger account category ids that this ledger account category should be a child * of. @@ -138,6 +146,13 @@ private constructor( */ fun _description(): JsonField = body._description() + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _externalId(): JsonField = body._externalId() + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -302,6 +317,21 @@ private constructor( */ fun description(description: JsonField) = apply { body.description(description) } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = apply { body.externalId(externalId) } + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun externalId(externalId: JsonField) = apply { body.externalId(externalId) } + /** * The array of ledger account category ids that this ledger account category should be a * child of. @@ -499,6 +529,7 @@ private constructor( private val normalBalance: JsonField, private val currencyExponent: JsonField, private val description: JsonField, + private val externalId: JsonField, private val ledgerAccountCategoryIds: JsonField>, private val metadata: JsonField, private val additionalProperties: MutableMap, @@ -522,6 +553,9 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), @JsonProperty("ledger_account_category_ids") @ExcludeMissing ledgerAccountCategoryIds: JsonField> = JsonMissing.of(), @@ -535,6 +569,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, metadata, mutableMapOf(), @@ -588,6 +623,14 @@ private constructor( */ fun description(): Optional = description.getOptional("description") + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + /** * The array of ledger account category ids that this ledger account category should be a * child of. @@ -656,6 +699,15 @@ private constructor( @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("external_id") + @ExcludeMissing + fun _externalId(): JsonField = externalId + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -711,6 +763,7 @@ private constructor( private var normalBalance: JsonField? = null private var currencyExponent: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var ledgerAccountCategoryIds: JsonField>? = null private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -725,6 +778,7 @@ private constructor( normalBalance = ledgerAccountCategoryCreateRequest.normalBalance currencyExponent = ledgerAccountCategoryCreateRequest.currencyExponent description = ledgerAccountCategoryCreateRequest.description + externalId = ledgerAccountCategoryCreateRequest.externalId ledgerAccountCategoryIds = ledgerAccountCategoryCreateRequest.ledgerAccountCategoryIds.map { it.toMutableList() @@ -831,6 +885,21 @@ private constructor( this.description = description } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + /** * The array of ledger account category ids that this ledger account category should be * a child of. @@ -920,6 +989,7 @@ private constructor( checkRequired("normalBalance", normalBalance), currencyExponent, description, + externalId, (ledgerAccountCategoryIds ?: JsonMissing.of()).map { it.toImmutable() }, metadata, additionalProperties.toMutableMap(), @@ -939,6 +1009,7 @@ private constructor( normalBalance().validate() currencyExponent() description() + externalId() ledgerAccountCategoryIds() metadata().ifPresent { it.validate() } validated = true @@ -966,6 +1037,7 @@ private constructor( (normalBalance.asKnown().getOrNull()?.validity() ?: 0) + (if (currencyExponent.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + (ledgerAccountCategoryIds.asKnown().getOrNull()?.size ?: 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) @@ -981,6 +1053,7 @@ private constructor( normalBalance == other.normalBalance && currencyExponent == other.currencyExponent && description == other.description && + externalId == other.externalId && ledgerAccountCategoryIds == other.ledgerAccountCategoryIds && metadata == other.metadata && additionalProperties == other.additionalProperties @@ -994,6 +1067,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, metadata, additionalProperties, @@ -1003,7 +1077,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LedgerAccountCategoryCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, metadata=$metadata, additionalProperties=$additionalProperties}" + "LedgerAccountCategoryCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, externalId=$externalId, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, metadata=$metadata, additionalProperties=$additionalProperties}" } /** Additional data represented as key-value pairs. Both the key and value must be strings. */ diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt index b0326bc8b..5466db7b8 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParams.kt @@ -23,7 +23,7 @@ private constructor( private val ledgerAccountId: String?, private val ledgerId: String?, private val metadata: Metadata?, - private val name: List?, + private val name: String?, private val parentLedgerAccountCategoryId: String?, private val perPage: Long?, private val additionalHeaders: Headers, @@ -61,11 +61,7 @@ private constructor( */ fun metadata(): Optional = Optional.ofNullable(metadata) - /** - * If you have specific names to retrieve in bulk, you can pass them as query parameters - * delimited with `name[]=`, for example `?name[]=123&name[]=abc`. - */ - fun name(): Optional> = Optional.ofNullable(name) + fun name(): Optional = Optional.ofNullable(name) /** Query categories that are nested underneath a parent category */ fun parentLedgerAccountCategoryId(): Optional = @@ -103,7 +99,7 @@ private constructor( private var ledgerAccountId: String? = null private var ledgerId: String? = null private var metadata: Metadata? = null - private var name: MutableList? = null + private var name: String? = null private var parentLedgerAccountCategoryId: String? = null private var perPage: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -120,7 +116,7 @@ private constructor( ledgerAccountId = ledgerAccountCategoryListParams.ledgerAccountId ledgerId = ledgerAccountCategoryListParams.ledgerId metadata = ledgerAccountCategoryListParams.metadata - name = ledgerAccountCategoryListParams.name?.toMutableList() + name = ledgerAccountCategoryListParams.name parentLedgerAccountCategoryId = ledgerAccountCategoryListParams.parentLedgerAccountCategoryId perPage = ledgerAccountCategoryListParams.perPage @@ -194,23 +190,10 @@ private constructor( /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) - /** - * If you have specific names to retrieve in bulk, you can pass them as query parameters - * delimited with `name[]=`, for example `?name[]=123&name[]=abc`. - */ - fun name(name: List?) = apply { this.name = name?.toMutableList() } + fun name(name: String?) = apply { this.name = name } /** Alias for calling [Builder.name] with `name.orElse(null)`. */ - fun name(name: Optional>) = name(name.getOrNull()) - - /** - * Adds a single [String] to [Builder.name]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addName(name: String) = apply { - this.name = (this.name ?: mutableListOf()).apply { add(name) } - } + fun name(name: Optional) = name(name.getOrNull()) /** Query categories that are nested underneath a parent category */ fun parentLedgerAccountCategoryId(parentLedgerAccountCategoryId: String?) = apply { @@ -349,7 +332,7 @@ private constructor( ledgerAccountId, ledgerId, metadata, - name?.toImmutable(), + name, parentLedgerAccountCategoryId, perPage, additionalHeaders.build(), @@ -388,7 +371,7 @@ private constructor( } } } - name?.forEach { put("name[]", it) } + name?.let { put("name", it) } parentLedgerAccountCategoryId?.let { put("parent_ledger_account_category_id", it) } perPage?.let { put("per_page", it.toString()) } putAll(additionalQueryParams) diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt index 317fe02e4..683ce25ed 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequest.kt @@ -29,6 +29,7 @@ private constructor( private val normalBalance: JsonField, private val currencyExponent: JsonField, private val description: JsonField, + private val externalId: JsonField, private val ledgerAccountCategoryIds: JsonField>, private val ledgerableId: JsonField, private val ledgerableType: JsonField, @@ -50,6 +51,9 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + externalId: JsonField = JsonMissing.of(), @JsonProperty("ledger_account_category_ids") @ExcludeMissing ledgerAccountCategoryIds: JsonField> = JsonMissing.of(), @@ -67,6 +71,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, ledgerableId, ledgerableType, @@ -122,6 +127,14 @@ private constructor( */ fun description(): Optional = description.getOptional("description") + /** + * An optional user-defined 180 character unique identifier. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalId(): Optional = externalId.getOptional("external_id") + /** * The array of ledger account category ids that this ledger account should be a child of. * @@ -204,6 +217,13 @@ private constructor( */ @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [externalId]. + * + * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId(): JsonField = externalId + /** * Returns the raw JSON value of [ledgerAccountCategoryIds]. * @@ -276,6 +296,7 @@ private constructor( private var normalBalance: JsonField? = null private var currencyExponent: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var ledgerAccountCategoryIds: JsonField>? = null private var ledgerableId: JsonField = JsonMissing.of() private var ledgerableType: JsonField = JsonMissing.of() @@ -290,6 +311,7 @@ private constructor( normalBalance = ledgerAccountCreateRequest.normalBalance currencyExponent = ledgerAccountCreateRequest.currencyExponent description = ledgerAccountCreateRequest.description + externalId = ledgerAccountCreateRequest.externalId ledgerAccountCategoryIds = ledgerAccountCreateRequest.ledgerAccountCategoryIds.map { it.toMutableList() } ledgerableId = ledgerAccountCreateRequest.ledgerableId @@ -387,6 +409,21 @@ private constructor( */ fun description(description: JsonField) = apply { this.description = description } + /** An optional user-defined 180 character unique identifier. */ + fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) + + /** Alias for calling [Builder.externalId] with `externalId.orElse(null)`. */ + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) + + /** + * Sets [Builder.externalId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + /** * The array of ledger account category ids that this ledger account should be a child of. */ @@ -507,6 +544,7 @@ private constructor( checkRequired("normalBalance", normalBalance), currencyExponent, description, + externalId, (ledgerAccountCategoryIds ?: JsonMissing.of()).map { it.toImmutable() }, ledgerableId, ledgerableType, @@ -528,6 +566,7 @@ private constructor( normalBalance().validate() currencyExponent() description() + externalId() ledgerAccountCategoryIds() ledgerableId() ledgerableType().ifPresent { it.validate() } @@ -556,6 +595,7 @@ private constructor( (normalBalance.asKnown().getOrNull()?.validity() ?: 0) + (if (currencyExponent.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (externalId.asKnown().isPresent) 1 else 0) + (ledgerAccountCategoryIds.asKnown().getOrNull()?.size ?: 0) + (if (ledgerableId.asKnown().isPresent) 1 else 0) + (ledgerableType.asKnown().getOrNull()?.validity() ?: 0) + @@ -820,6 +860,7 @@ private constructor( normalBalance == other.normalBalance && currencyExponent == other.currencyExponent && description == other.description && + externalId == other.externalId && ledgerAccountCategoryIds == other.ledgerAccountCategoryIds && ledgerableId == other.ledgerableId && ledgerableType == other.ledgerableType && @@ -835,6 +876,7 @@ private constructor( normalBalance, currencyExponent, description, + externalId, ledgerAccountCategoryIds, ledgerableId, ledgerableType, @@ -846,5 +888,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LedgerAccountCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, ledgerableId=$ledgerableId, ledgerableType=$ledgerableType, metadata=$metadata, additionalProperties=$additionalProperties}" + "LedgerAccountCreateRequest{currency=$currency, ledgerId=$ledgerId, name=$name, normalBalance=$normalBalance, currencyExponent=$currencyExponent, description=$description, externalId=$externalId, ledgerAccountCategoryIds=$ledgerAccountCategoryIds, ledgerableId=$ledgerableId, ledgerableType=$ledgerableType, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt index 8a0f95198..1555030b4 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LedgerEntryListParams.kt @@ -36,7 +36,7 @@ private constructor( private val perPage: Long?, private val showBalances: Boolean?, private val showDeleted: Boolean?, - private val status: List?, + private val status: Status?, private val updatedAt: UpdatedAt?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -131,7 +131,7 @@ private constructor( * Get all ledger entries that match the status specified. One of `pending`, `posted`, or * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. */ - fun status(): Optional> = Optional.ofNullable(status) + fun status(): Optional = Optional.ofNullable(status) /** * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the posted at @@ -178,7 +178,7 @@ private constructor( private var perPage: Long? = null private var showBalances: Boolean? = null private var showDeleted: Boolean? = null - private var status: MutableList? = null + private var status: Status? = null private var updatedAt: UpdatedAt? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -204,7 +204,7 @@ private constructor( perPage = ledgerEntryListParams.perPage showBalances = ledgerEntryListParams.showBalances showDeleted = ledgerEntryListParams.showDeleted - status = ledgerEntryListParams.status?.toMutableList() + status = ledgerEntryListParams.status updatedAt = ledgerEntryListParams.updatedAt additionalHeaders = ledgerEntryListParams.additionalHeaders.toBuilder() additionalQueryParams = ledgerEntryListParams.additionalQueryParams.toBuilder() @@ -433,19 +433,10 @@ private constructor( * Get all ledger entries that match the status specified. One of `pending`, `posted`, or * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. */ - fun status(status: List?) = apply { this.status = status?.toMutableList() } + fun status(status: Status?) = apply { this.status = status } /** Alias for calling [Builder.status] with `status.orElse(null)`. */ - fun status(status: Optional>) = status(status.getOrNull()) - - /** - * Adds a single [Status] to [Builder.status]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addStatus(status: Status) = apply { - this.status = (this.status ?: mutableListOf()).apply { add(status) } - } + fun status(status: Optional) = status(status.getOrNull()) /** * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the posted at @@ -581,7 +572,7 @@ private constructor( perPage, showBalances, showDeleted, - status?.toImmutable(), + status, updatedAt, additionalHeaders.build(), additionalQueryParams.build(), @@ -655,7 +646,7 @@ private constructor( perPage?.let { put("per_page", it.toString()) } showBalances?.let { put("show_balances", it.toString()) } showDeleted?.let { put("show_deleted", it.toString()) } - status?.forEach { put("status[]", it.toString()) } + status?.let { put("status", it.toString()) } updatedAt?.let { it._additionalProperties().keys().forEach { key -> it._additionalProperties().values(key).forEach { value -> @@ -1655,6 +1646,10 @@ private constructor( "OrderBy{createdAt=$createdAt, effectiveAt=$effectiveAt, additionalProperties=$additionalProperties}" } + /** + * Get all ledger entries that match the status specified. One of `pending`, `posted`, or + * `archived`. For multiple statuses, use `status[]=pending&status[]=posted`. + */ class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt index a088d6668..3a7691ff0 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntity.kt @@ -31,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, @@ -47,6 +48,7 @@ private constructor( private val lastName: JsonField, private val legalEntityType: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val liveMode: JsonField, private val metadata: JsonField, private val middleName: JsonField, @@ -57,8 +59,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(), @@ -127,6 +136,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") @@ -149,10 +161,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, @@ -186,6 +209,7 @@ private constructor( lastName, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -196,8 +220,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 = legalEntity.complianceDetails().convert(MyClass.class); + * ``` */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") + @Deprecated("deprecated") + @JsonProperty("compliance_details") + @ExcludeMissing + fun _complianceDetails(): JsonValue = complianceDetails /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 @@ -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). @@ -377,6 +415,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. @@ -457,6 +503,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. * @@ -465,6 +519,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. * @@ -473,6 +535,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]. * @@ -701,6 +779,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]. * @@ -784,6 +871,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]. * @@ -793,6 +889,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]. * @@ -800,6 +903,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() @@ -879,6 +1002,7 @@ private constructor( * .lastName() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -889,8 +1013,12 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() + * .status() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -908,12 +1036,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 @@ -926,6 +1055,7 @@ private constructor( private var lastName: JsonField? = null private var legalEntityType: JsonField? = null private var legalStructure: JsonField? = null + private var listedExchange: JsonField? = null private var liveMode: JsonField? = null private var metadata: JsonField? = null private var middleName: JsonField? = null @@ -936,8 +1066,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 @@ -958,6 +1092,7 @@ private constructor( dateFormed = legalEntity.dateFormed dateOfBirth = legalEntity.dateOfBirth discardedAt = legalEntity.discardedAt + documents = legalEntity.documents.map { it.toMutableList() } doingBusinessAsNames = legalEntity.doingBusinessAsNames.map { it.toMutableList() } email = legalEntity.email expectedActivityVolume = legalEntity.expectedActivityVolume @@ -968,6 +1103,7 @@ private constructor( lastName = legalEntity.lastName legalEntityType = legalEntity.legalEntityType legalStructure = legalEntity.legalStructure + listedExchange = legalEntity.listedExchange liveMode = legalEntity.liveMode metadata = legalEntity.metadata middleName = legalEntity.middleName @@ -978,8 +1114,12 @@ private constructor( preferredName = legalEntity.preferredName prefix = legalEntity.prefix primarySocialMediaSites = legalEntity.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntity.regulators.map { it.toMutableList() } riskRating = legalEntity.riskRating + status = legalEntity.status suffix = legalEntity.suffix + thirdPartyVerification = legalEntity.thirdPartyVerification + tickerSymbol = legalEntity.tickerSymbol updatedAt = legalEntity.updatedAt wealthAndEmploymentDetails = legalEntity.wealthAndEmploymentDetails website = legalEntity.website @@ -1100,21 +1240,8 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { + @Deprecated("deprecated") + fun complianceDetails(complianceDetails: JsonValue) = apply { this.complianceDetails = complianceDetails } @@ -1204,6 +1331,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + fun doingBusinessAsNames(doingBusinessAsNames: List) = doingBusinessAsNames(JsonField.of(doingBusinessAsNames)) @@ -1244,7 +1396,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)) @@ -1410,6 +1562,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. @@ -1608,6 +1779,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)) @@ -1623,6 +1825,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)) @@ -1637,6 +1855,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)) /** @@ -1760,6 +2018,7 @@ private constructor( * .dateFormed() * .dateOfBirth() * .discardedAt() + * .documents() * .doingBusinessAsNames() * .email() * .expectedActivityVolume() @@ -1770,6 +2029,7 @@ private constructor( * .lastName() * .legalEntityType() * .legalStructure() + * .listedExchange() * .liveMode() * .metadata() * .middleName() @@ -1780,8 +2040,12 @@ private constructor( * .preferredName() * .prefix() * .primarySocialMediaSites() + * .regulators() * .riskRating() + * .status() * .suffix() + * .thirdPartyVerification() + * .tickerSymbol() * .updatedAt() * .wealthAndEmploymentDetails() * .website() @@ -1803,6 +2067,7 @@ private constructor( checkRequired("dateFormed", dateFormed), checkRequired("dateOfBirth", dateOfBirth), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("doingBusinessAsNames", doingBusinessAsNames).map { it.toImmutable() }, @@ -1817,6 +2082,7 @@ private constructor( checkRequired("lastName", lastName), checkRequired("legalEntityType", legalEntityType), checkRequired("legalStructure", legalStructure), + checkRequired("listedExchange", listedExchange), checkRequired("liveMode", liveMode), checkRequired("metadata", metadata), checkRequired("middleName", middleName), @@ -1831,8 +2097,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), @@ -1854,12 +2124,12 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } countryOfIncorporation() createdAt() dateFormed() dateOfBirth() discardedAt() + documents().forEach { it.validate() } doingBusinessAsNames() email() expectedActivityVolume() @@ -1870,6 +2140,7 @@ private constructor( lastName() legalEntityType().validate() legalStructure().ifPresent { it.validate() } + listedExchange() liveMode() metadata().validate() middleName() @@ -1880,8 +2151,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() @@ -1910,12 +2185,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) + @@ -1926,6 +2201,7 @@ private constructor( (if (lastName.asKnown().isPresent) 1 else 0) + (legalEntityType.asKnown().getOrNull()?.validity() ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (if (liveMode.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + @@ -1936,8 +2212,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) + @@ -3416,6 +3696,7 @@ private constructor( private val id: JsonField, private val createdAt: JsonField, private val discardedAt: JsonField, + private val documents: JsonField>, private val expirationDate: JsonField, private val idType: JsonField, private val issuingCountry: JsonField, @@ -3435,6 +3716,9 @@ private constructor( @JsonProperty("discarded_at") @ExcludeMissing discardedAt: JsonField = JsonMissing.of(), + @JsonProperty("documents") + @ExcludeMissing + documents: JsonField> = JsonMissing.of(), @JsonProperty("expiration_date") @ExcludeMissing expirationDate: JsonField = JsonMissing.of(), @@ -3456,6 +3740,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -3484,6 +3769,12 @@ private constructor( */ fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") + /** + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun documents(): List = documents.getRequired("documents") + /** * The date when the Identification is no longer considered valid by the issuing authority. * @@ -3562,6 +3853,15 @@ private constructor( @ExcludeMissing fun _discardedAt(): JsonField = discardedAt + /** + * Returns the raw JSON value of [documents]. + * + * Unlike [documents], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("documents") + @ExcludeMissing + fun _documents(): JsonField> = documents + /** * Returns the raw JSON value of [expirationDate]. * @@ -3644,6 +3944,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3662,6 +3963,7 @@ private constructor( private var id: JsonField? = null private var createdAt: JsonField? = null private var discardedAt: JsonField? = null + private var documents: JsonField>? = null private var expirationDate: JsonField? = null private var idType: JsonField? = null private var issuingCountry: JsonField? = null @@ -3676,6 +3978,7 @@ private constructor( id = identification.id createdAt = identification.createdAt discardedAt = identification.discardedAt + documents = identification.documents.map { it.toMutableList() } expirationDate = identification.expirationDate idType = identification.idType issuingCountry = identification.issuingCountry @@ -3728,6 +4031,31 @@ private constructor( this.discardedAt = discardedAt } + fun documents(documents: List) = documents(JsonField.of(documents)) + + /** + * Sets [Builder.documents] to an arbitrary JSON value. + * + * You should usually call [Builder.documents] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun documents(documents: JsonField>) = apply { + this.documents = documents.map { it.toMutableList() } + } + + /** + * Adds a single [Document] to [documents]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDocument(document: Document) = apply { + documents = + (documents ?: JsonField.of(mutableListOf())).also { + checkKnown("documents", it).add(document) + } + } + /** * The date when the Identification is no longer considered valid by the issuing * authority. @@ -3868,6 +4196,7 @@ private constructor( * .id() * .createdAt() * .discardedAt() + * .documents() * .expirationDate() * .idType() * .issuingCountry() @@ -3884,6 +4213,7 @@ private constructor( checkRequired("id", id), checkRequired("createdAt", createdAt), checkRequired("discardedAt", discardedAt), + checkRequired("documents", documents).map { it.toImmutable() }, checkRequired("expirationDate", expirationDate), checkRequired("idType", idType), checkRequired("issuingCountry", issuingCountry), @@ -3905,6 +4235,7 @@ private constructor( id() createdAt() discardedAt() + documents().forEach { it.validate() } expirationDate() idType().validate() issuingCountry() @@ -3934,6 +4265,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (discardedAt.asKnown().isPresent) 1 else 0) + + (documents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (if (expirationDate.asKnown().isPresent) 1 else 0) + (idType.asKnown().getOrNull()?.validity() ?: 0) + (if (issuingCountry.asKnown().isPresent) 1 else 0) + @@ -4201,6 +4533,7 @@ private constructor( id == other.id && createdAt == other.createdAt && discardedAt == other.discardedAt && + documents == other.documents && expirationDate == other.expirationDate && idType == other.idType && issuingCountry == other.issuingCountry && @@ -4216,6 +4549,7 @@ private constructor( id, createdAt, discardedAt, + documents, expirationDate, idType, issuingCountry, @@ -4230,7 +4564,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. */ @@ -4772,75 +5106,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 @@ -4908,6 +5498,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( @@ -5013,7 +6077,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -5408,7 +6472,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** @@ -7148,6 +8212,7 @@ private constructor( dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && discardedAt == other.discardedAt && + documents == other.documents && doingBusinessAsNames == other.doingBusinessAsNames && email == other.email && expectedActivityVolume == other.expectedActivityVolume && @@ -7158,6 +8223,7 @@ private constructor( lastName == other.lastName && legalEntityType == other.legalEntityType && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && liveMode == other.liveMode && metadata == other.metadata && middleName == other.middleName && @@ -7168,8 +8234,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 && @@ -7191,6 +8261,7 @@ private constructor( dateFormed, dateOfBirth, discardedAt, + documents, doingBusinessAsNames, email, expectedActivityVolume, @@ -7201,6 +8272,7 @@ private constructor( lastName, legalEntityType, legalStructure, + listedExchange, liveMode, metadata, middleName, @@ -7211,8 +8283,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, updatedAt, wealthAndEmploymentDetails, website, @@ -7224,5 +8300,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" + "LegalEntity{id=$id, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, createdAt=$createdAt, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, discardedAt=$discardedAt, documents=$documents, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityType=$legalEntityType, legalStructure=$legalStructure, listedExchange=$listedExchange, liveMode=$liveMode, metadata=$metadata, middleName=$middleName, object_=$object_, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, updatedAt=$updatedAt, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, legalEntityAssociations=$legalEntityAssociations, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt deleted file mode 100644 index 095bb5750..000000000 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetail.kt +++ /dev/null @@ -1,663 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.moderntreasury.api.models - -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import com.moderntreasury.api.core.ExcludeMissing -import com.moderntreasury.api.core.JsonField -import com.moderntreasury.api.core.JsonMissing -import com.moderntreasury.api.core.JsonValue -import com.moderntreasury.api.core.checkRequired -import com.moderntreasury.api.errors.ModernTreasuryInvalidDataException -import java.time.OffsetDateTime -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -class LegalEntityComplianceDetail -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val id: JsonField, - private val createdAt: JsonField, - private val discardedAt: JsonField, - private val issuer: JsonField, - private val liveMode: JsonField, - private val object_: JsonField, - private val tokenExpiresAt: JsonField, - private val tokenIssuedAt: JsonField, - private val tokenUrl: JsonField, - private val updatedAt: JsonField, - private val entityValidated: JsonField, - private val validatedAt: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("discarded_at") - @ExcludeMissing - discardedAt: JsonField = JsonMissing.of(), - @JsonProperty("issuer") @ExcludeMissing issuer: JsonField = JsonMissing.of(), - @JsonProperty("live_mode") @ExcludeMissing liveMode: JsonField = JsonMissing.of(), - @JsonProperty("object") @ExcludeMissing object_: JsonField = JsonMissing.of(), - @JsonProperty("token_expires_at") - @ExcludeMissing - tokenExpiresAt: JsonField = JsonMissing.of(), - @JsonProperty("token_issued_at") - @ExcludeMissing - tokenIssuedAt: JsonField = JsonMissing.of(), - @JsonProperty("token_url") @ExcludeMissing tokenUrl: JsonField = JsonMissing.of(), - @JsonProperty("updated_at") - @ExcludeMissing - updatedAt: JsonField = JsonMissing.of(), - @JsonProperty("validated") - @ExcludeMissing - entityValidated: JsonField = JsonMissing.of(), - @JsonProperty("validated_at") - @ExcludeMissing - validatedAt: JsonField = JsonMissing.of(), - ) : this( - id, - createdAt, - discardedAt, - issuer, - liveMode, - object_, - tokenExpiresAt, - tokenIssuedAt, - tokenUrl, - updatedAt, - entityValidated, - validatedAt, - mutableMapOf(), - ) - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun id(): String = id.getRequired("id") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun discardedAt(): Optional = discardedAt.getOptional("discarded_at") - - /** - * The issuer of the compliance token. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun issuer(): String = issuer.getRequired("issuer") - - /** - * This field will be true if this object exists in the live environment or false if it exists - * in the test environment. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun liveMode(): Boolean = liveMode.getRequired("live_mode") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun object_(): String = object_.getRequired("object") - - /** - * The timestamp when the compliance token expires. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenExpiresAt(): Optional = tokenExpiresAt.getOptional("token_expires_at") - - /** - * The timestamp when the compliance token was issued. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenIssuedAt(): Optional = tokenIssuedAt.getOptional("token_issued_at") - - /** - * The URL to the compliance token. (ex. provider portal URL) - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tokenUrl(): Optional = tokenUrl.getOptional("token_url") - - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") - - /** - * Whether entity corresponding to the compliance token has been validated. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun entityValidated(): Boolean = entityValidated.getRequired("validated") - - /** - * The timestamp when the entity was validated. - * - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun validatedAt(): Optional = validatedAt.getOptional("validated_at") - - /** - * Returns the raw JSON value of [id]. - * - * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [discardedAt]. - * - * Unlike [discardedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("discarded_at") - @ExcludeMissing - fun _discardedAt(): JsonField = discardedAt - - /** - * Returns the raw JSON value of [issuer]. - * - * Unlike [issuer], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("issuer") @ExcludeMissing fun _issuer(): JsonField = issuer - - /** - * Returns the raw JSON value of [liveMode]. - * - * Unlike [liveMode], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("live_mode") @ExcludeMissing fun _liveMode(): JsonField = liveMode - - /** - * Returns the raw JSON value of [object_]. - * - * Unlike [object_], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("object") @ExcludeMissing fun _object_(): JsonField = object_ - - /** - * Returns the raw JSON value of [tokenExpiresAt]. - * - * Unlike [tokenExpiresAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_expires_at") - @ExcludeMissing - fun _tokenExpiresAt(): JsonField = tokenExpiresAt - - /** - * Returns the raw JSON value of [tokenIssuedAt]. - * - * Unlike [tokenIssuedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_issued_at") - @ExcludeMissing - fun _tokenIssuedAt(): JsonField = tokenIssuedAt - - /** - * Returns the raw JSON value of [tokenUrl]. - * - * Unlike [tokenUrl], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("token_url") @ExcludeMissing fun _tokenUrl(): JsonField = tokenUrl - - /** - * Returns the raw JSON value of [updatedAt]. - * - * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("updated_at") - @ExcludeMissing - fun _updatedAt(): JsonField = updatedAt - - /** - * Returns the raw JSON value of [entityValidated]. - * - * Unlike [entityValidated], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("validated") - @ExcludeMissing - fun _entityValidated(): JsonField = entityValidated - - /** - * Returns the raw JSON value of [validatedAt]. - * - * Unlike [validatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("validated_at") - @ExcludeMissing - fun _validatedAt(): JsonField = validatedAt - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [LegalEntityComplianceDetail]. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .discardedAt() - * .issuer() - * .liveMode() - * .object_() - * .tokenExpiresAt() - * .tokenIssuedAt() - * .tokenUrl() - * .updatedAt() - * .entityValidated() - * .validatedAt() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [LegalEntityComplianceDetail]. */ - class Builder internal constructor() { - - private var id: JsonField? = null - private var createdAt: JsonField? = null - private var discardedAt: JsonField? = null - private var issuer: JsonField? = null - private var liveMode: JsonField? = null - private var object_: JsonField? = null - private var tokenExpiresAt: JsonField? = null - private var tokenIssuedAt: JsonField? = null - private var tokenUrl: JsonField? = null - private var updatedAt: JsonField? = null - private var entityValidated: JsonField? = null - private var validatedAt: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(legalEntityComplianceDetail: LegalEntityComplianceDetail) = apply { - id = legalEntityComplianceDetail.id - createdAt = legalEntityComplianceDetail.createdAt - discardedAt = legalEntityComplianceDetail.discardedAt - issuer = legalEntityComplianceDetail.issuer - liveMode = legalEntityComplianceDetail.liveMode - object_ = legalEntityComplianceDetail.object_ - tokenExpiresAt = legalEntityComplianceDetail.tokenExpiresAt - tokenIssuedAt = legalEntityComplianceDetail.tokenIssuedAt - tokenUrl = legalEntityComplianceDetail.tokenUrl - updatedAt = legalEntityComplianceDetail.updatedAt - entityValidated = legalEntityComplianceDetail.entityValidated - validatedAt = legalEntityComplianceDetail.validatedAt - additionalProperties = legalEntityComplianceDetail.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - /** - * Sets [Builder.id] to an arbitrary JSON value. - * - * You should usually call [Builder.id] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun id(id: JsonField) = apply { this.id = id } - - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - - fun discardedAt(discardedAt: OffsetDateTime?) = - discardedAt(JsonField.ofNullable(discardedAt)) - - /** Alias for calling [Builder.discardedAt] with `discardedAt.orElse(null)`. */ - fun discardedAt(discardedAt: Optional) = - discardedAt(discardedAt.getOrNull()) - - /** - * Sets [Builder.discardedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.discardedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun discardedAt(discardedAt: JsonField) = apply { - this.discardedAt = discardedAt - } - - /** The issuer of the compliance token. */ - fun issuer(issuer: String) = issuer(JsonField.of(issuer)) - - /** - * Sets [Builder.issuer] to an arbitrary JSON value. - * - * You should usually call [Builder.issuer] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun issuer(issuer: JsonField) = apply { this.issuer = issuer } - - /** - * This field will be true if this object exists in the live environment or false if it - * exists in the test environment. - */ - fun liveMode(liveMode: Boolean) = liveMode(JsonField.of(liveMode)) - - /** - * Sets [Builder.liveMode] to an arbitrary JSON value. - * - * You should usually call [Builder.liveMode] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun liveMode(liveMode: JsonField) = apply { this.liveMode = liveMode } - - fun object_(object_: String) = object_(JsonField.of(object_)) - - /** - * Sets [Builder.object_] to an arbitrary JSON value. - * - * You should usually call [Builder.object_] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun object_(object_: JsonField) = apply { this.object_ = object_ } - - /** The timestamp when the compliance token expires. */ - fun tokenExpiresAt(tokenExpiresAt: OffsetDateTime?) = - tokenExpiresAt(JsonField.ofNullable(tokenExpiresAt)) - - /** Alias for calling [Builder.tokenExpiresAt] with `tokenExpiresAt.orElse(null)`. */ - fun tokenExpiresAt(tokenExpiresAt: Optional) = - tokenExpiresAt(tokenExpiresAt.getOrNull()) - - /** - * Sets [Builder.tokenExpiresAt] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenExpiresAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tokenExpiresAt(tokenExpiresAt: JsonField) = apply { - this.tokenExpiresAt = tokenExpiresAt - } - - /** The timestamp when the compliance token was issued. */ - fun tokenIssuedAt(tokenIssuedAt: OffsetDateTime?) = - tokenIssuedAt(JsonField.ofNullable(tokenIssuedAt)) - - /** Alias for calling [Builder.tokenIssuedAt] with `tokenIssuedAt.orElse(null)`. */ - fun tokenIssuedAt(tokenIssuedAt: Optional) = - tokenIssuedAt(tokenIssuedAt.getOrNull()) - - /** - * Sets [Builder.tokenIssuedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenIssuedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tokenIssuedAt(tokenIssuedAt: JsonField) = apply { - this.tokenIssuedAt = tokenIssuedAt - } - - /** The URL to the compliance token. (ex. provider portal URL) */ - fun tokenUrl(tokenUrl: String?) = tokenUrl(JsonField.ofNullable(tokenUrl)) - - /** Alias for calling [Builder.tokenUrl] with `tokenUrl.orElse(null)`. */ - fun tokenUrl(tokenUrl: Optional) = tokenUrl(tokenUrl.getOrNull()) - - /** - * Sets [Builder.tokenUrl] to an arbitrary JSON value. - * - * You should usually call [Builder.tokenUrl] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun tokenUrl(tokenUrl: JsonField) = apply { this.tokenUrl = tokenUrl } - - fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) - - /** - * Sets [Builder.updatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } - - /** Whether entity corresponding to the compliance token has been validated. */ - fun entityValidated(entityValidated: Boolean) = - entityValidated(JsonField.of(entityValidated)) - - /** - * Sets [Builder.entityValidated] to an arbitrary JSON value. - * - * You should usually call [Builder.entityValidated] with a well-typed [Boolean] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun entityValidated(entityValidated: JsonField) = apply { - this.entityValidated = entityValidated - } - - /** The timestamp when the entity was validated. */ - fun validatedAt(validatedAt: OffsetDateTime?) = - validatedAt(JsonField.ofNullable(validatedAt)) - - /** Alias for calling [Builder.validatedAt] with `validatedAt.orElse(null)`. */ - fun validatedAt(validatedAt: Optional) = - validatedAt(validatedAt.getOrNull()) - - /** - * Sets [Builder.validatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.validatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun validatedAt(validatedAt: JsonField) = apply { - this.validatedAt = validatedAt - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [LegalEntityComplianceDetail]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .discardedAt() - * .issuer() - * .liveMode() - * .object_() - * .tokenExpiresAt() - * .tokenIssuedAt() - * .tokenUrl() - * .updatedAt() - * .entityValidated() - * .validatedAt() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): LegalEntityComplianceDetail = - LegalEntityComplianceDetail( - checkRequired("id", id), - checkRequired("createdAt", createdAt), - checkRequired("discardedAt", discardedAt), - checkRequired("issuer", issuer), - checkRequired("liveMode", liveMode), - checkRequired("object_", object_), - checkRequired("tokenExpiresAt", tokenExpiresAt), - checkRequired("tokenIssuedAt", tokenIssuedAt), - checkRequired("tokenUrl", tokenUrl), - checkRequired("updatedAt", updatedAt), - checkRequired("entityValidated", entityValidated), - checkRequired("validatedAt", validatedAt), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): LegalEntityComplianceDetail = apply { - if (validated) { - return@apply - } - - id() - createdAt() - discardedAt() - issuer() - liveMode() - object_() - tokenExpiresAt() - tokenIssuedAt() - tokenUrl() - updatedAt() - entityValidated() - validatedAt() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: ModernTreasuryInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (id.asKnown().isPresent) 1 else 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (discardedAt.asKnown().isPresent) 1 else 0) + - (if (issuer.asKnown().isPresent) 1 else 0) + - (if (liveMode.asKnown().isPresent) 1 else 0) + - (if (object_.asKnown().isPresent) 1 else 0) + - (if (tokenExpiresAt.asKnown().isPresent) 1 else 0) + - (if (tokenIssuedAt.asKnown().isPresent) 1 else 0) + - (if (tokenUrl.asKnown().isPresent) 1 else 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + - (if (entityValidated.asKnown().isPresent) 1 else 0) + - (if (validatedAt.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is LegalEntityComplianceDetail && - id == other.id && - createdAt == other.createdAt && - discardedAt == other.discardedAt && - issuer == other.issuer && - liveMode == other.liveMode && - object_ == other.object_ && - tokenExpiresAt == other.tokenExpiresAt && - tokenIssuedAt == other.tokenIssuedAt && - tokenUrl == other.tokenUrl && - updatedAt == other.updatedAt && - entityValidated == other.entityValidated && - validatedAt == other.validatedAt && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - id, - createdAt, - discardedAt, - issuer, - liveMode, - object_, - tokenExpiresAt, - tokenIssuedAt, - tokenUrl, - updatedAt, - entityValidated, - validatedAt, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "LegalEntityComplianceDetail{id=$id, createdAt=$createdAt, discardedAt=$discardedAt, issuer=$issuer, liveMode=$liveMode, object_=$object_, tokenExpiresAt=$tokenExpiresAt, tokenIssuedAt=$tokenIssuedAt, tokenUrl=$tokenUrl, updatedAt=$updatedAt, entityValidated=$entityValidated, validatedAt=$validatedAt, additionalProperties=$additionalProperties}" -} diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt index 4eaa88094..60b3a04ab 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityCreateParams.kt @@ -80,10 +80,15 @@ private constructor( fun citizenshipCountry(): Optional = body.citizenshipCountry() /** + * 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 = body.complianceDetails() + fun connectionId(): Optional = body.connectionId() /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 @@ -125,7 +130,7 @@ private constructor( fun email(): Optional = body.email() /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -190,6 +195,14 @@ private constructor( */ fun legalStructure(): Optional = body.legalStructure() + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = body.listedExchange() + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -252,6 +265,14 @@ private constructor( */ fun primarySocialMediaSites(): Optional> = body.primarySocialMediaSites() + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = body.regulators() + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -260,6 +281,14 @@ private constructor( */ fun riskRating(): Optional = body.riskRating() + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = body.status() + /** * An individual's suffix. * @@ -268,6 +297,22 @@ private constructor( */ fun suffix(): Optional = body.suffix() + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = body.thirdPartyVerification() + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = body.tickerSymbol() + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -328,12 +373,11 @@ private constructor( fun _citizenshipCountry(): JsonField = body._citizenshipCountry() /** - * Returns the raw JSON value of [complianceDetails]. + * Returns the raw JSON value of [connectionId]. * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected type. */ - fun _complianceDetails(): JsonField = body._complianceDetails() + fun _connectionId(): JsonField = body._connectionId() /** * Returns the raw JSON value of [countryOfIncorporation]. @@ -433,6 +477,13 @@ private constructor( */ fun _legalStructure(): JsonField = body._legalStructure() + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _listedExchange(): JsonField = body._listedExchange() + /** * Returns the raw JSON value of [metadata]. * @@ -492,6 +543,13 @@ private constructor( */ fun _primarySocialMediaSites(): JsonField> = body._primarySocialMediaSites() + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _regulators(): JsonField> = body._regulators() + /** * Returns the raw JSON value of [riskRating]. * @@ -499,6 +557,13 @@ private constructor( */ fun _riskRating(): JsonField = body._riskRating() + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + /** * Returns the raw JSON value of [suffix]. * @@ -506,6 +571,22 @@ private constructor( */ fun _suffix(): JsonField = body._suffix() + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _thirdPartyVerification(): JsonField = + body._thirdPartyVerification() + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _tickerSymbol(): JsonField = body._tickerSymbol() + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -694,23 +775,26 @@ private constructor( body.citizenshipCountry(citizenshipCountry) } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = apply { - body.complianceDetails(complianceDetails) - } + /** + * The connection ID for the connection the legal entity is associated with. Defaults to the + * id of the connection designated with an is_default value of true or the id of an existing + * operational connection if only one is available. Pass in a value of null to prevent the + * connection from being associated with the legal entity. + */ + fun connectionId(connectionId: String?) = apply { body.connectionId(connectionId) } - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = connectionId(connectionId.getOrNull()) /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. + * Sets [Builder.connectionId] 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. + * You should usually call [Builder.connectionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun complianceDetails(complianceDetails: JsonField) = apply { - body.complianceDetails(complianceDetails) + fun connectionId(connectionId: JsonField) = apply { + body.connectionId(connectionId) } /** @@ -807,7 +891,7 @@ private constructor( */ fun email(email: JsonField) = apply { body.email(email) } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = apply { body.expectedActivityVolume(expectedActivityVolume) } @@ -987,6 +1071,24 @@ private constructor( body.legalStructure(legalStructure) } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = apply { body.listedExchange(listedExchange) } + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + body.listedExchange(listedExchange) + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1153,6 +1255,33 @@ private constructor( body.addPrimarySocialMediaSite(primarySocialMediaSite) } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = apply { + body.regulators(regulators) + } + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + body.regulators(regulators) + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { body.addRegulator(regulator) } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = apply { body.riskRating(riskRating) } @@ -1168,6 +1297,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { body.riskRating(riskRating) } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = apply { body.status(status) } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { body.status(status) } + /** An individual's suffix. */ fun suffix(suffix: String?) = apply { body.suffix(suffix) } @@ -1182,6 +1327,47 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { body.suffix(suffix) } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = apply { body.tickerSymbol(tickerSymbol) } + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + body.tickerSymbol(tickerSymbol) + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = apply { body.wealthAndEmploymentDetails(wealthAndEmploymentDetails) } @@ -1371,7 +1557,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, @@ -1385,6 +1571,7 @@ private constructor( private val lastName: JsonField, private val legalEntityAssociations: JsonField>, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -1393,8 +1580,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, @@ -1420,9 +1611,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(), @@ -1462,6 +1653,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(), @@ -1484,10 +1678,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 = @@ -1500,7 +1704,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1514,6 +1718,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -1522,8 +1727,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -1580,11 +1789,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 @@ -1628,7 +1841,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). @@ -1696,6 +1909,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -1761,6 +1982,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -1769,6 +1999,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. * @@ -1777,6 +2015,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1852,14 +2107,14 @@ private constructor( fun _citizenshipCountry(): JsonField = citizenshipCountry /** - * Returns the raw JSON value of [complianceDetails]. + * Returns the raw JSON value of [connectionId]. * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected + * Unlike [connectionId], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("compliance_details") + @JsonProperty("connection_id") @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails + fun _connectionId(): JsonField = connectionId /** * Returns the raw JSON value of [countryOfIncorporation]. @@ -1981,6 +2236,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -2054,6 +2319,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]. * @@ -2063,6 +2337,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]. * @@ -2070,6 +2351,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -2122,7 +2423,7 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() + private var connectionId: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -2140,6 +2441,7 @@ private constructor( JsonField>? = null private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -2148,8 +2450,12 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -2163,7 +2469,7 @@ private constructor( businessDescription = legalEntityCreateRequest.businessDescription businessName = legalEntityCreateRequest.businessName citizenshipCountry = legalEntityCreateRequest.citizenshipCountry - complianceDetails = legalEntityCreateRequest.complianceDetails + connectionId = legalEntityCreateRequest.connectionId countryOfIncorporation = legalEntityCreateRequest.countryOfIncorporation dateFormed = legalEntityCreateRequest.dateFormed dateOfBirth = legalEntityCreateRequest.dateOfBirth @@ -2181,6 +2487,7 @@ private constructor( legalEntityAssociations = legalEntityCreateRequest.legalEntityAssociations.map { it.toMutableList() } legalStructure = legalEntityCreateRequest.legalStructure + listedExchange = legalEntityCreateRequest.listedExchange metadata = legalEntityCreateRequest.metadata middleName = legalEntityCreateRequest.middleName operatingJurisdictions = @@ -2191,8 +2498,12 @@ private constructor( prefix = legalEntityCreateRequest.prefix primarySocialMediaSites = legalEntityCreateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityCreateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityCreateRequest.riskRating + status = legalEntityCreateRequest.status suffix = legalEntityCreateRequest.suffix + thirdPartyVerification = legalEntityCreateRequest.thirdPartyVerification + tickerSymbol = legalEntityCreateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityCreateRequest.wealthAndEmploymentDetails website = legalEntityCreateRequest.website additionalProperties = legalEntityCreateRequest.additionalProperties.toMutableMap() @@ -2321,26 +2632,29 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. + * The connection ID for the connection the legal entity is associated with. Defaults to + * the id of the connection designated with an is_default value of true or the id of an + * existing operational connection if only one is available. Pass in a value of null to + * prevent the connection from being associated with the legal entity. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) + fun connectionId(connectionId: String?) = + connectionId(JsonField.ofNullable(connectionId)) + + /** Alias for calling [Builder.connectionId] with `connectionId.orElse(null)`. */ + fun connectionId(connectionId: Optional) = + connectionId(connectionId.getOrNull()) /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. + * Sets [Builder.connectionId] 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. + * You should usually call [Builder.connectionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } + fun connectionId(connectionId: JsonField) = apply { + this.connectionId = connectionId + } /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or @@ -2443,7 +2757,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)) @@ -2639,6 +2953,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2816,6 +3149,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)) @@ -2833,6 +3197,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2848,6 +3230,48 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) @@ -2925,7 +3349,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2939,6 +3363,7 @@ private constructor( lastName, (legalEntityAssociations ?: JsonMissing.of()).map { it.toImmutable() }, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -2947,8 +3372,12 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -2968,7 +3397,7 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } + connectionId() countryOfIncorporation() dateFormed() dateOfBirth() @@ -2982,6 +3411,7 @@ private constructor( lastName() legalEntityAssociations().ifPresent { it.forEach { it.validate() } } legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -2990,8 +3420,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() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -3019,7 +3453,7 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + + (if (connectionId.asKnown().isPresent) 1 else 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -3035,6 +3469,7 @@ private constructor( (legalEntityAssociations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -3043,8 +3478,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) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -3060,7 +3499,7 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && + connectionId == other.connectionId && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -3074,6 +3513,7 @@ private constructor( lastName == other.lastName && legalEntityAssociations == other.legalEntityAssociations && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -3082,8 +3522,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 && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -3097,7 +3541,7 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, + connectionId, countryOfIncorporation, dateFormed, dateOfBirth, @@ -3111,6 +3555,7 @@ private constructor( lastName, legalEntityAssociations, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -3119,8 +3564,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -3130,7 +3579,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityCreateRequest{legalEntityType=$legalEntityType, addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, connectionId=$connectionId, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalEntityAssociations=$legalEntityAssociations, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } /** The type of legal entity. */ @@ -4295,20 +4744,276 @@ 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 { + fun jurisdiction(): String = jurisdiction.getRequired("jurisdiction") + + /** + * 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") + + /** + * 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") + + /** + * Returns the raw JSON value of [jurisdiction]. + * + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. + * + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + + /** The risk rating of the legal entity. One of low, medium, high. */ + class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { @JvmField val LOW = of("low") @@ -4431,6 +5136,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( @@ -4536,7 +5715,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4931,7 +6110,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt index 350c3cc0e..57c33d004 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityListParams.kt @@ -21,6 +21,7 @@ private constructor( private val metadata: Metadata?, private val perPage: Long?, private val showDeleted: String?, + private val status: Status?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -39,6 +40,8 @@ private constructor( fun showDeleted(): Optional = Optional.ofNullable(showDeleted) + fun status(): Optional = Optional.ofNullable(status) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -63,6 +66,7 @@ private constructor( private var metadata: Metadata? = null private var perPage: Long? = null private var showDeleted: String? = null + private var status: Status? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -73,6 +77,7 @@ private constructor( metadata = legalEntityListParams.metadata perPage = legalEntityListParams.perPage showDeleted = legalEntityListParams.showDeleted + status = legalEntityListParams.status additionalHeaders = legalEntityListParams.additionalHeaders.toBuilder() additionalQueryParams = legalEntityListParams.additionalQueryParams.toBuilder() } @@ -116,6 +121,11 @@ private constructor( /** Alias for calling [Builder.showDeleted] with `showDeleted.orElse(null)`. */ fun showDeleted(showDeleted: Optional) = showDeleted(showDeleted.getOrNull()) + fun status(status: Status?) = apply { this.status = status } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -226,6 +236,7 @@ private constructor( metadata, perPage, showDeleted, + status, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -247,6 +258,7 @@ private constructor( } perPage?.let { put("per_page", it.toString()) } showDeleted?.let { put("show_deleted", it) } + status?.let { put("status", it.toString()) } putAll(additionalQueryParams) } .build() @@ -481,6 +493,145 @@ private constructor( override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PENDING = of("pending") + + @JvmField val ACTIVE = of("active") + + @JvmField val SUSPENDED = of("suspended") + + @JvmField val CLOSED = of("closed") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + PENDING, + ACTIVE, + SUSPENDED, + CLOSED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PENDING, + ACTIVE, + SUSPENDED, + CLOSED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING -> Value.PENDING + ACTIVE -> Value.ACTIVE + SUSPENDED -> Value.SUSPENDED + CLOSED -> Value.CLOSED + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PENDING -> Known.PENDING + ACTIVE -> Known.ACTIVE + SUSPENDED -> Known.SUSPENDED + CLOSED -> Known.CLOSED + else -> throw ModernTreasuryInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws ModernTreasuryInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + ModernTreasuryInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -492,6 +643,7 @@ private constructor( metadata == other.metadata && perPage == other.perPage && showDeleted == other.showDeleted && + status == other.status && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -503,10 +655,11 @@ private constructor( metadata, perPage, showDeleted, + status, additionalHeaders, additionalQueryParams, ) override fun toString() = - "LegalEntityListParams{afterCursor=$afterCursor, legalEntityType=$legalEntityType, metadata=$metadata, perPage=$perPage, showDeleted=$showDeleted, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "LegalEntityListParams{afterCursor=$afterCursor, legalEntityType=$legalEntityType, metadata=$metadata, perPage=$perPage, showDeleted=$showDeleted, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt index 2450096f4..4a13a0a2d 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParams.kt @@ -74,12 +74,6 @@ private constructor( */ fun citizenshipCountry(): Optional = body.citizenshipCountry() - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = body.complianceDetails() - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -120,7 +114,7 @@ private constructor( fun email(): Optional = body.email() /** - * Monthly expected transaction volume in entity's local currency. + * Monthly expected transaction volume in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -176,6 +170,14 @@ private constructor( */ fun legalStructure(): Optional = body.legalStructure() + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun listedExchange(): Optional = body.listedExchange() + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -238,6 +240,14 @@ private constructor( */ fun primarySocialMediaSites(): Optional> = body.primarySocialMediaSites() + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun regulators(): Optional> = body.regulators() + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -246,6 +256,14 @@ private constructor( */ fun riskRating(): Optional = body.riskRating() + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = body.status() + /** * An individual's suffix. * @@ -254,6 +272,22 @@ private constructor( */ fun suffix(): Optional = body.suffix() + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = body.thirdPartyVerification() + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = body.tickerSymbol() + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -306,14 +340,6 @@ private constructor( */ fun _citizenshipCountry(): JsonField = body._citizenshipCountry() - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - fun _complianceDetails(): JsonField = body._complianceDetails() - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -403,6 +429,13 @@ private constructor( */ fun _legalStructure(): JsonField = body._legalStructure() + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _listedExchange(): JsonField = body._listedExchange() + /** * Returns the raw JSON value of [metadata]. * @@ -462,6 +495,13 @@ private constructor( */ fun _primarySocialMediaSites(): JsonField> = body._primarySocialMediaSites() + /** + * Returns the raw JSON value of [regulators]. + * + * Unlike [regulators], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _regulators(): JsonField> = body._regulators() + /** * Returns the raw JSON value of [riskRating]. * @@ -469,6 +509,13 @@ private constructor( */ fun _riskRating(): JsonField = body._riskRating() + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _status(): JsonField = body._status() + /** * Returns the raw JSON value of [suffix]. * @@ -476,6 +523,22 @@ private constructor( */ fun _suffix(): JsonField = body._suffix() + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _thirdPartyVerification(): JsonField = + body._thirdPartyVerification() + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _tickerSymbol(): JsonField = body._tickerSymbol() + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -650,25 +713,6 @@ private constructor( body.citizenshipCountry(citizenshipCountry) } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = apply { - body.complianceDetails(complianceDetails) - } - - /** Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = apply { - body.complianceDetails(complianceDetails) - } - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -763,7 +807,7 @@ private constructor( */ fun email(email: JsonField) = apply { body.email(email) } - /** Monthly expected transaction volume in entity's local currency. */ + /** Monthly expected transaction volume in USD. */ fun expectedActivityVolume(expectedActivityVolume: Long?) = apply { body.expectedActivityVolume(expectedActivityVolume) } @@ -909,6 +953,24 @@ private constructor( body.legalStructure(legalStructure) } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = apply { body.listedExchange(listedExchange) } + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + body.listedExchange(listedExchange) + } + /** * Additional data represented as key-value pairs. Both the key and value must be strings. */ @@ -1075,6 +1137,33 @@ private constructor( body.addPrimarySocialMediaSite(primarySocialMediaSite) } + /** Array of regulatory bodies overseeing this institution. */ + fun regulators(regulators: List?) = apply { + body.regulators(regulators) + } + + /** Alias for calling [Builder.regulators] with `regulators.orElse(null)`. */ + fun regulators(regulators: Optional>) = + regulators(regulators.getOrNull()) + + /** + * Sets [Builder.regulators] to an arbitrary JSON value. + * + * You should usually call [Builder.regulators] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun regulators(regulators: JsonField>) = apply { + body.regulators(regulators) + } + + /** + * Adds a single [LegalEntityRegulator] to [regulators]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addRegulator(regulator: LegalEntityRegulator) = apply { body.addRegulator(regulator) } + /** The risk rating of the legal entity. One of low, medium, high. */ fun riskRating(riskRating: RiskRating?) = apply { body.riskRating(riskRating) } @@ -1090,6 +1179,22 @@ private constructor( */ fun riskRating(riskRating: JsonField) = apply { body.riskRating(riskRating) } + /** + * The activation status of the legal entity. One of pending, active, suspended, or closed. + */ + fun status(status: Status?) = apply { body.status(status) } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { body.status(status) } + /** An individual's suffix. */ fun suffix(suffix: String?) = apply { body.suffix(suffix) } @@ -1104,6 +1209,47 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { body.suffix(suffix) } + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. + */ + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) + + /** + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. + * + * You should usually call [Builder.thirdPartyVerification] with a well-typed + * [ThirdPartyVerification] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + body.thirdPartyVerification(thirdPartyVerification) + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = apply { body.tickerSymbol(tickerSymbol) } + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + body.tickerSymbol(tickerSymbol) + } + fun wealthAndEmploymentDetails( wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? ) = apply { body.wealthAndEmploymentDetails(wealthAndEmploymentDetails) } @@ -1292,7 +1438,6 @@ private constructor( private val businessDescription: JsonField, private val businessName: JsonField, private val citizenshipCountry: JsonField, - private val complianceDetails: JsonField, private val countryOfIncorporation: JsonField, private val dateFormed: JsonField, private val dateOfBirth: JsonField, @@ -1305,6 +1450,7 @@ private constructor( private val intendedUse: JsonField, private val lastName: JsonField, private val legalStructure: JsonField, + private val listedExchange: JsonField, private val metadata: JsonField, private val middleName: JsonField, private val operatingJurisdictions: JsonField>, @@ -1313,8 +1459,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, @@ -1337,9 +1487,6 @@ private constructor( @JsonProperty("citizenship_country") @ExcludeMissing citizenshipCountry: JsonField = JsonMissing.of(), - @JsonProperty("compliance_details") - @ExcludeMissing - complianceDetails: JsonField = JsonMissing.of(), @JsonProperty("country_of_incorporation") @ExcludeMissing countryOfIncorporation: JsonField = JsonMissing.of(), @@ -1375,6 +1522,9 @@ private constructor( @JsonProperty("legal_structure") @ExcludeMissing legalStructure: JsonField = JsonMissing.of(), + @JsonProperty("listed_exchange") + @ExcludeMissing + listedExchange: JsonField = JsonMissing.of(), @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), @@ -1397,10 +1547,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 = @@ -1412,7 +1572,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -1425,6 +1584,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -1433,8 +1593,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, mutableMapOf(), @@ -1482,13 +1646,6 @@ private constructor( fun citizenshipCountry(): Optional = citizenshipCountry.getOptional("citizenship_country") - /** - * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun complianceDetails(): Optional = - complianceDetails.getOptional("compliance_details") - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 * formats. @@ -1531,7 +1688,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). @@ -1590,6 +1747,14 @@ private constructor( fun legalStructure(): Optional = legalStructure.getOptional("legal_structure") + /** + * ISO 10383 market identifier code. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun listedExchange(): Optional = listedExchange.getOptional("listed_exchange") + /** * Additional data represented as key-value pairs. Both the key and value must be strings. * @@ -1655,6 +1820,15 @@ private constructor( fun primarySocialMediaSites(): Optional> = primarySocialMediaSites.getOptional("primary_social_media_sites") + /** + * Array of regulatory bodies overseeing this institution. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun regulators(): Optional> = + regulators.getOptional("regulators") + /** * The risk rating of the legal entity. One of low, medium, high. * @@ -1663,6 +1837,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. * @@ -1671,6 +1853,23 @@ private constructor( */ fun suffix(): Optional = suffix.getOptional("suffix") + /** + * Information describing a third-party verification run by an external vendor. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun thirdPartyVerification(): Optional = + thirdPartyVerification.getOptional("third_party_verification") + + /** + * Stock ticker symbol for publicly traded companies. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun tickerSymbol(): Optional = tickerSymbol.getOptional("ticker_symbol") + /** * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -1735,16 +1934,6 @@ private constructor( @ExcludeMissing fun _citizenshipCountry(): JsonField = citizenshipCountry - /** - * Returns the raw JSON value of [complianceDetails]. - * - * Unlike [complianceDetails], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("compliance_details") - @ExcludeMissing - fun _complianceDetails(): JsonField = complianceDetails - /** * Returns the raw JSON value of [countryOfIncorporation]. * @@ -1854,6 +2043,16 @@ private constructor( @ExcludeMissing fun _legalStructure(): JsonField = legalStructure + /** + * Returns the raw JSON value of [listedExchange]. + * + * Unlike [listedExchange], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("listed_exchange") + @ExcludeMissing + fun _listedExchange(): JsonField = listedExchange + /** * Returns the raw JSON value of [metadata]. * @@ -1927,6 +2126,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]. * @@ -1936,6 +2144,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]. * @@ -1943,6 +2158,26 @@ private constructor( */ @JsonProperty("suffix") @ExcludeMissing fun _suffix(): JsonField = suffix + /** + * Returns the raw JSON value of [thirdPartyVerification]. + * + * Unlike [thirdPartyVerification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("third_party_verification") + @ExcludeMissing + fun _thirdPartyVerification(): JsonField = thirdPartyVerification + + /** + * Returns the raw JSON value of [tickerSymbol]. + * + * Unlike [tickerSymbol], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("ticker_symbol") + @ExcludeMissing + fun _tickerSymbol(): JsonField = tickerSymbol + /** * Returns the raw JSON value of [wealthAndEmploymentDetails]. * @@ -1989,7 +2224,6 @@ private constructor( private var businessDescription: JsonField = JsonMissing.of() private var businessName: JsonField = JsonMissing.of() private var citizenshipCountry: JsonField = JsonMissing.of() - private var complianceDetails: JsonField = JsonMissing.of() private var countryOfIncorporation: JsonField = JsonMissing.of() private var dateFormed: JsonField = JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() @@ -2004,6 +2238,7 @@ private constructor( private var intendedUse: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var legalStructure: JsonField = JsonMissing.of() + private var listedExchange: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var middleName: JsonField = JsonMissing.of() private var operatingJurisdictions: JsonField>? = null @@ -2012,8 +2247,12 @@ private constructor( private var preferredName: JsonField = JsonMissing.of() private var prefix: JsonField = JsonMissing.of() private var primarySocialMediaSites: JsonField>? = null + private var regulators: JsonField>? = null private var riskRating: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() private var suffix: JsonField = JsonMissing.of() + private var thirdPartyVerification: JsonField = JsonMissing.of() + private var tickerSymbol: JsonField = JsonMissing.of() private var wealthAndEmploymentDetails: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() @@ -2026,7 +2265,6 @@ private constructor( businessDescription = legalEntityUpdateRequest.businessDescription businessName = legalEntityUpdateRequest.businessName citizenshipCountry = legalEntityUpdateRequest.citizenshipCountry - complianceDetails = legalEntityUpdateRequest.complianceDetails countryOfIncorporation = legalEntityUpdateRequest.countryOfIncorporation dateFormed = legalEntityUpdateRequest.dateFormed dateOfBirth = legalEntityUpdateRequest.dateOfBirth @@ -2042,6 +2280,7 @@ private constructor( intendedUse = legalEntityUpdateRequest.intendedUse lastName = legalEntityUpdateRequest.lastName legalStructure = legalEntityUpdateRequest.legalStructure + listedExchange = legalEntityUpdateRequest.listedExchange metadata = legalEntityUpdateRequest.metadata middleName = legalEntityUpdateRequest.middleName operatingJurisdictions = @@ -2052,8 +2291,12 @@ private constructor( prefix = legalEntityUpdateRequest.prefix primarySocialMediaSites = legalEntityUpdateRequest.primarySocialMediaSites.map { it.toMutableList() } + regulators = legalEntityUpdateRequest.regulators.map { it.toMutableList() } riskRating = legalEntityUpdateRequest.riskRating + status = legalEntityUpdateRequest.status suffix = legalEntityUpdateRequest.suffix + thirdPartyVerification = legalEntityUpdateRequest.thirdPartyVerification + tickerSymbol = legalEntityUpdateRequest.tickerSymbol wealthAndEmploymentDetails = legalEntityUpdateRequest.wealthAndEmploymentDetails website = legalEntityUpdateRequest.website additionalProperties = legalEntityUpdateRequest.additionalProperties.toMutableMap() @@ -2167,27 +2410,6 @@ private constructor( this.citizenshipCountry = citizenshipCountry } - fun complianceDetails(complianceDetails: LegalEntityComplianceDetail?) = - complianceDetails(JsonField.ofNullable(complianceDetails)) - - /** - * Alias for calling [Builder.complianceDetails] with `complianceDetails.orElse(null)`. - */ - fun complianceDetails(complianceDetails: Optional) = - complianceDetails(complianceDetails.getOrNull()) - - /** - * Sets [Builder.complianceDetails] to an arbitrary JSON value. - * - * You should usually call [Builder.complianceDetails] with a well-typed - * [LegalEntityComplianceDetail] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun complianceDetails(complianceDetails: JsonField) = - apply { - this.complianceDetails = complianceDetails - } - /** * The country code where the business is incorporated in the ISO 3166-1 alpha-2 or * alpha-3 formats. @@ -2289,7 +2511,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)) @@ -2445,6 +2667,25 @@ private constructor( this.legalStructure = legalStructure } + /** ISO 10383 market identifier code. */ + fun listedExchange(listedExchange: String?) = + listedExchange(JsonField.ofNullable(listedExchange)) + + /** Alias for calling [Builder.listedExchange] with `listedExchange.orElse(null)`. */ + fun listedExchange(listedExchange: Optional) = + listedExchange(listedExchange.getOrNull()) + + /** + * Sets [Builder.listedExchange] to an arbitrary JSON value. + * + * You should usually call [Builder.listedExchange] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun listedExchange(listedExchange: JsonField) = apply { + this.listedExchange = listedExchange + } + /** * Additional data represented as key-value pairs. Both the key and value must be * strings. @@ -2622,6 +2863,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)) @@ -2639,6 +2911,24 @@ private constructor( this.riskRating = riskRating } + /** + * The activation status of the legal entity. One of pending, active, suspended, or + * closed. + */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + /** An individual's suffix. */ fun suffix(suffix: String?) = suffix(JsonField.ofNullable(suffix)) @@ -2654,28 +2944,70 @@ private constructor( */ fun suffix(suffix: JsonField) = apply { this.suffix = suffix } - fun wealthAndEmploymentDetails( - wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? - ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) + /** Information describing a third-party verification run by an external vendor. */ + fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification?) = + thirdPartyVerification(JsonField.ofNullable(thirdPartyVerification)) /** - * Alias for calling [Builder.wealthAndEmploymentDetails] with - * `wealthAndEmploymentDetails.orElse(null)`. + * Alias for calling [Builder.thirdPartyVerification] with + * `thirdPartyVerification.orElse(null)`. */ - fun wealthAndEmploymentDetails( - wealthAndEmploymentDetails: Optional - ) = wealthAndEmploymentDetails(wealthAndEmploymentDetails.getOrNull()) + fun thirdPartyVerification(thirdPartyVerification: Optional) = + thirdPartyVerification(thirdPartyVerification.getOrNull()) /** - * Sets [Builder.wealthAndEmploymentDetails] to an arbitrary JSON value. + * Sets [Builder.thirdPartyVerification] to an arbitrary JSON value. * - * You should usually call [Builder.wealthAndEmploymentDetails] with a well-typed - * [LegalEntityWealthEmploymentDetail] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported 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 wealthAndEmploymentDetails( - wealthAndEmploymentDetails: JsonField - ) = apply { this.wealthAndEmploymentDetails = wealthAndEmploymentDetails } + fun thirdPartyVerification(thirdPartyVerification: JsonField) = + apply { + this.thirdPartyVerification = thirdPartyVerification + } + + /** Stock ticker symbol for publicly traded companies. */ + fun tickerSymbol(tickerSymbol: String?) = + tickerSymbol(JsonField.ofNullable(tickerSymbol)) + + /** Alias for calling [Builder.tickerSymbol] with `tickerSymbol.orElse(null)`. */ + fun tickerSymbol(tickerSymbol: Optional) = + tickerSymbol(tickerSymbol.getOrNull()) + + /** + * Sets [Builder.tickerSymbol] to an arbitrary JSON value. + * + * You should usually call [Builder.tickerSymbol] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun tickerSymbol(tickerSymbol: JsonField) = apply { + this.tickerSymbol = tickerSymbol + } + + fun wealthAndEmploymentDetails( + wealthAndEmploymentDetails: LegalEntityWealthEmploymentDetail? + ) = wealthAndEmploymentDetails(JsonField.ofNullable(wealthAndEmploymentDetails)) + + /** + * Alias for calling [Builder.wealthAndEmploymentDetails] with + * `wealthAndEmploymentDetails.orElse(null)`. + */ + fun wealthAndEmploymentDetails( + wealthAndEmploymentDetails: Optional + ) = wealthAndEmploymentDetails(wealthAndEmploymentDetails.getOrNull()) + + /** + * Sets [Builder.wealthAndEmploymentDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.wealthAndEmploymentDetails] with a well-typed + * [LegalEntityWealthEmploymentDetail] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun wealthAndEmploymentDetails( + wealthAndEmploymentDetails: JsonField + ) = apply { this.wealthAndEmploymentDetails = wealthAndEmploymentDetails } /** The entity's primary website URL. */ fun website(website: String?) = website(JsonField.ofNullable(website)) @@ -2723,7 +3055,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2736,6 +3067,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, (operatingJurisdictions ?: JsonMissing.of()).map { it.toImmutable() }, @@ -2744,8 +3076,12 @@ private constructor( preferredName, prefix, (primarySocialMediaSites ?: JsonMissing.of()).map { it.toImmutable() }, + (regulators ?: JsonMissing.of()).map { it.toImmutable() }, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties.toMutableMap(), @@ -2764,7 +3100,6 @@ private constructor( businessDescription() businessName() citizenshipCountry() - complianceDetails().ifPresent { it.validate() } countryOfIncorporation() dateFormed() dateOfBirth() @@ -2777,6 +3112,7 @@ private constructor( intendedUse() lastName() legalStructure().ifPresent { it.validate() } + listedExchange() metadata().ifPresent { it.validate() } middleName() operatingJurisdictions() @@ -2785,8 +3121,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() wealthAndEmploymentDetails().ifPresent { it.validate() } website() validated = true @@ -2813,7 +3153,6 @@ private constructor( (if (businessDescription.asKnown().isPresent) 1 else 0) + (if (businessName.asKnown().isPresent) 1 else 0) + (if (citizenshipCountry.asKnown().isPresent) 1 else 0) + - (complianceDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (countryOfIncorporation.asKnown().isPresent) 1 else 0) + (if (dateFormed.asKnown().isPresent) 1 else 0) + (if (dateOfBirth.asKnown().isPresent) 1 else 0) + @@ -2827,6 +3166,7 @@ private constructor( (if (intendedUse.asKnown().isPresent) 1 else 0) + (if (lastName.asKnown().isPresent) 1 else 0) + (legalStructure.asKnown().getOrNull()?.validity() ?: 0) + + (if (listedExchange.asKnown().isPresent) 1 else 0) + (metadata.asKnown().getOrNull()?.validity() ?: 0) + (if (middleName.asKnown().isPresent) 1 else 0) + (operatingJurisdictions.asKnown().getOrNull()?.size ?: 0) + @@ -2835,8 +3175,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) + (wealthAndEmploymentDetails.asKnown().getOrNull()?.validity() ?: 0) + (if (website.asKnown().isPresent) 1 else 0) @@ -2851,7 +3195,6 @@ private constructor( businessDescription == other.businessDescription && businessName == other.businessName && citizenshipCountry == other.citizenshipCountry && - complianceDetails == other.complianceDetails && countryOfIncorporation == other.countryOfIncorporation && dateFormed == other.dateFormed && dateOfBirth == other.dateOfBirth && @@ -2864,6 +3207,7 @@ private constructor( intendedUse == other.intendedUse && lastName == other.lastName && legalStructure == other.legalStructure && + listedExchange == other.listedExchange && metadata == other.metadata && middleName == other.middleName && operatingJurisdictions == other.operatingJurisdictions && @@ -2872,8 +3216,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 && wealthAndEmploymentDetails == other.wealthAndEmploymentDetails && website == other.website && additionalProperties == other.additionalProperties @@ -2886,7 +3234,6 @@ private constructor( businessDescription, businessName, citizenshipCountry, - complianceDetails, countryOfIncorporation, dateFormed, dateOfBirth, @@ -2899,6 +3246,7 @@ private constructor( intendedUse, lastName, legalStructure, + listedExchange, metadata, middleName, operatingJurisdictions, @@ -2907,8 +3255,12 @@ private constructor( preferredName, prefix, primarySocialMediaSites, + regulators, riskRating, + status, suffix, + thirdPartyVerification, + tickerSymbol, wealthAndEmploymentDetails, website, additionalProperties, @@ -2918,7 +3270,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, complianceDetails=$complianceDetails, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, riskRating=$riskRating, suffix=$suffix, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" + "LegalEntityUpdateRequest{addresses=$addresses, bankSettings=$bankSettings, businessDescription=$businessDescription, businessName=$businessName, citizenshipCountry=$citizenshipCountry, countryOfIncorporation=$countryOfIncorporation, dateFormed=$dateFormed, dateOfBirth=$dateOfBirth, doingBusinessAsNames=$doingBusinessAsNames, email=$email, expectedActivityVolume=$expectedActivityVolume, firstName=$firstName, identifications=$identifications, industryClassifications=$industryClassifications, intendedUse=$intendedUse, lastName=$lastName, legalStructure=$legalStructure, listedExchange=$listedExchange, metadata=$metadata, middleName=$middleName, operatingJurisdictions=$operatingJurisdictions, phoneNumbers=$phoneNumbers, politicallyExposedPerson=$politicallyExposedPerson, preferredName=$preferredName, prefix=$prefix, primarySocialMediaSites=$primarySocialMediaSites, regulators=$regulators, riskRating=$riskRating, status=$status, suffix=$suffix, thirdPartyVerification=$thirdPartyVerification, tickerSymbol=$tickerSymbol, wealthAndEmploymentDetails=$wealthAndEmploymentDetails, website=$website, additionalProperties=$additionalProperties}" } class LegalEntityBankSetting @@ -3951,6 +4303,262 @@ private constructor( "PhoneNumber{phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } + 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()) + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + * + * @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 jurisdiction(): String = jurisdiction.getRequired("jurisdiction") + + /** + * 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") + + /** + * 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") + + /** + * Returns the raw JSON value of [jurisdiction]. + * + * Unlike [jurisdiction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("jurisdiction") + @ExcludeMissing + fun _jurisdiction(): JsonField = jurisdiction + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [registrationNumber]. + * + * Unlike [registrationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("registration_number") + @ExcludeMissing + fun _registrationNumber(): JsonField = registrationNumber + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LegalEntityRegulator]. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LegalEntityRegulator]. */ + class Builder internal constructor() { + + private var jurisdiction: JsonField? = null + private var name: JsonField? = null + private var registrationNumber: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(legalEntityRegulator: LegalEntityRegulator) = apply { + jurisdiction = legalEntityRegulator.jurisdiction + name = legalEntityRegulator.name + registrationNumber = legalEntityRegulator.registrationNumber + additionalProperties = legalEntityRegulator.additionalProperties.toMutableMap() + } + + /** + * The country code where the regulator operates in the ISO 3166-1 alpha-2 format (e.g., + * "US", "CA", "GB"). + */ + fun jurisdiction(jurisdiction: String) = jurisdiction(JsonField.of(jurisdiction)) + + /** + * Sets [Builder.jurisdiction] to an arbitrary JSON value. + * + * You should usually call [Builder.jurisdiction] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun jurisdiction(jurisdiction: JsonField) = apply { + this.jurisdiction = jurisdiction + } + + /** Full name of the regulatory body. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** Registration or identification number with the regulator. */ + fun registrationNumber(registrationNumber: String) = + registrationNumber(JsonField.of(registrationNumber)) + + /** + * Sets [Builder.registrationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.registrationNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun registrationNumber(registrationNumber: JsonField) = apply { + this.registrationNumber = registrationNumber + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [LegalEntityRegulator]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .jurisdiction() + * .name() + * .registrationNumber() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LegalEntityRegulator = + LegalEntityRegulator( + checkRequired("jurisdiction", jurisdiction), + checkRequired("name", name), + checkRequired("registrationNumber", registrationNumber), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): LegalEntityRegulator = apply { + if (validated) { + return@apply + } + + jurisdiction() + name() + registrationNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: ModernTreasuryInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (jurisdiction.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (registrationNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LegalEntityRegulator && + jurisdiction == other.jurisdiction && + name == other.name && + registrationNumber == other.registrationNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(jurisdiction, name, registrationNumber, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "LegalEntityRegulator{jurisdiction=$jurisdiction, name=$name, registrationNumber=$registrationNumber, additionalProperties=$additionalProperties}" + } + /** The risk rating of the legal entity. One of low, medium, high. */ class RiskRating @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -4087,6 +4695,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( @@ -4192,7 +5274,7 @@ private constructor( fun id(): String = id.getRequired("id") /** - * The annual income of the individual. + * The annual income of the individual in USD. * * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -4587,7 +5669,7 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** The annual income of the individual. */ + /** The annual income of the individual in USD. */ fun annualIncome(annualIncome: Long?) = annualIncome(JsonField.ofNullable(annualIncome)) /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt index b51281cb5..f1938942a 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateParams.kt @@ -52,7 +52,14 @@ private constructor( */ fun actionableType(): Optional = body.actionableType() - /** Optional. The specifc details of the payment action based on type. */ + /** + * Optional. The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateParams.details().convert(MyClass.class); + * ``` + */ fun _details(): JsonValue = body._details() /** @@ -402,7 +409,14 @@ private constructor( */ fun actionableType(): Optional = actionableType.getOptional("actionable_type") - /** Optional. The specifc details of the payment action based on type. */ + /** + * Optional. The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateRequest.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt index 88b9b45aa..3146ac214 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionCreateResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionCreateResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt index 9848071c4..e5203ca43 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionListResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionListResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt index fd059eebe..079b6498b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionRetrieveResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionRetrieveResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt index 5a2519958..7eb66d50c 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentActionUpdateResponse.kt @@ -101,7 +101,14 @@ private constructor( */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** The specifc details of the payment action based on type. */ + /** + * The specifc details of the payment action based on type. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentActionUpdateResponse.details().convert(MyClass.class); + * ``` + */ @JsonProperty("details") @ExcludeMissing fun _details(): JsonValue = details /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt index 13dfdd94b..f3742d7be 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrder.kt @@ -41,6 +41,7 @@ private constructor( private val accountingCategoryId: JsonField, private val accountingLedgerClassId: JsonField, private val amount: JsonField, + private val batchId: JsonField, private val chargeBearer: JsonField, private val counterpartyId: JsonField, private val createdAt: JsonField, @@ -102,6 +103,7 @@ private constructor( @ExcludeMissing accountingLedgerClassId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("batch_id") @ExcludeMissing batchId: JsonField = JsonMissing.of(), @JsonProperty("charge_bearer") @ExcludeMissing chargeBearer: JsonField = JsonMissing.of(), @@ -228,6 +230,7 @@ private constructor( accountingCategoryId, accountingLedgerClassId, amount, + batchId, chargeBearer, counterpartyId, createdAt, @@ -319,6 +322,15 @@ private constructor( */ fun amount(): Long = amount.getRequired("amount") + /** + * The ID of the batch in which the payment order is included. Only populated after the payment + * order begins processing. + * + * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun batchId(): Optional = batchId.getOptional("batch_id") + /** * The party that will pay the fees for the payment order. See * https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the differences @@ -704,6 +716,11 @@ private constructor( /** * Additional vendor specific fields for this payment. Data must be represented as key-value * pairs. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = paymentOrder.vendorAttributes().convert(MyClass.class); + * ``` */ @JsonProperty("vendor_attributes") @ExcludeMissing @@ -765,6 +782,13 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** + * Returns the raw JSON value of [batchId]. + * + * Unlike [batchId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("batch_id") @ExcludeMissing fun _batchId(): JsonField = batchId + /** * Returns the raw JSON value of [chargeBearer]. * @@ -1185,6 +1209,7 @@ private constructor( * .accountingCategoryId() * .accountingLedgerClassId() * .amount() + * .batchId() * .chargeBearer() * .counterpartyId() * .createdAt() @@ -1243,6 +1268,7 @@ private constructor( private var accountingCategoryId: JsonField? = null private var accountingLedgerClassId: JsonField? = null private var amount: JsonField? = null + private var batchId: JsonField? = null private var chargeBearer: JsonField? = null private var counterpartyId: JsonField? = null private var createdAt: JsonField? = null @@ -1298,6 +1324,7 @@ private constructor( accountingCategoryId = paymentOrder.accountingCategoryId accountingLedgerClassId = paymentOrder.accountingLedgerClassId amount = paymentOrder.amount + batchId = paymentOrder.batchId chargeBearer = paymentOrder.chargeBearer counterpartyId = paymentOrder.counterpartyId createdAt = paymentOrder.createdAt @@ -1439,6 +1466,23 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** + * The ID of the batch in which the payment order is included. Only populated after the + * payment order begins processing. + */ + fun batchId(batchId: String?) = batchId(JsonField.ofNullable(batchId)) + + /** Alias for calling [Builder.batchId] with `batchId.orElse(null)`. */ + fun batchId(batchId: Optional) = batchId(batchId.getOrNull()) + + /** + * Sets [Builder.batchId] to an arbitrary JSON value. + * + * You should usually call [Builder.batchId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun batchId(batchId: JsonField) = apply { this.batchId = batchId } + /** * The party that will pay the fees for the payment order. See * https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the differences @@ -2358,6 +2402,7 @@ private constructor( * .accountingCategoryId() * .accountingLedgerClassId() * .amount() + * .batchId() * .chargeBearer() * .counterpartyId() * .createdAt() @@ -2414,6 +2459,7 @@ private constructor( checkRequired("accountingCategoryId", accountingCategoryId), checkRequired("accountingLedgerClassId", accountingLedgerClassId), checkRequired("amount", amount), + checkRequired("batchId", batchId), checkRequired("chargeBearer", chargeBearer), checkRequired("counterpartyId", counterpartyId), checkRequired("createdAt", createdAt), @@ -2478,6 +2524,7 @@ private constructor( accountingCategoryId() accountingLedgerClassId() amount() + batchId() chargeBearer().ifPresent { it.validate() } counterpartyId() createdAt() @@ -2545,6 +2592,7 @@ private constructor( (if (accountingCategoryId.asKnown().isPresent) 1 else 0) + (if (accountingLedgerClassId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + + (if (batchId.asKnown().isPresent) 1 else 0) + (chargeBearer.asKnown().getOrNull()?.validity() ?: 0) + (if (counterpartyId.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + @@ -5406,14 +5454,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -5527,8 +5567,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -5631,8 +5669,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -5739,10 +5775,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -5849,10 +5881,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -6495,6 +6523,7 @@ private constructor( accountingCategoryId == other.accountingCategoryId && accountingLedgerClassId == other.accountingLedgerClassId && amount == other.amount && + batchId == other.batchId && chargeBearer == other.chargeBearer && counterpartyId == other.counterpartyId && createdAt == other.createdAt && @@ -6550,6 +6579,7 @@ private constructor( accountingCategoryId, accountingLedgerClassId, amount, + batchId, chargeBearer, counterpartyId, createdAt, @@ -6602,5 +6632,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PaymentOrder{id=$id, accounting=$accounting, accountingCategoryId=$accountingCategoryId, accountingLedgerClassId=$accountingLedgerClassId, amount=$amount, chargeBearer=$chargeBearer, counterpartyId=$counterpartyId, createdAt=$createdAt, currency=$currency, currentHold=$currentHold, currentReturn=$currentReturn, description=$description, direction=$direction, effectiveDate=$effectiveDate, expiresAt=$expiresAt, externalId=$externalId, foreignExchangeContract=$foreignExchangeContract, foreignExchangeIndicator=$foreignExchangeIndicator, foreignExchangeRate=$foreignExchangeRate, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, nsfProtected=$nsfProtected, object_=$object_, originatingAccountId=$originatingAccountId, originatingPartyName=$originatingPartyName, priority=$priority, processAfter=$processAfter, purpose=$purpose, receivingAccountId=$receivingAccountId, receivingAccountType=$receivingAccountType, reconciliationStatus=$reconciliationStatus, referenceNumbers=$referenceNumbers, remittanceInformation=$remittanceInformation, sendRemittanceAdvice=$sendRemittanceAdvice, statementDescriptor=$statementDescriptor, status=$status, subtype=$subtype, transactionIds=$transactionIds, type=$type, ultimateOriginatingAccount=$ultimateOriginatingAccount, ultimateOriginatingAccountId=$ultimateOriginatingAccountId, ultimateOriginatingAccountType=$ultimateOriginatingAccountType, ultimateOriginatingPartyIdentifier=$ultimateOriginatingPartyIdentifier, ultimateOriginatingPartyName=$ultimateOriginatingPartyName, ultimateReceivingPartyIdentifier=$ultimateReceivingPartyIdentifier, ultimateReceivingPartyName=$ultimateReceivingPartyName, updatedAt=$updatedAt, vendorAttributes=$vendorAttributes, vendorFailureReason=$vendorFailureReason, additionalProperties=$additionalProperties}" + "PaymentOrder{id=$id, accounting=$accounting, accountingCategoryId=$accountingCategoryId, accountingLedgerClassId=$accountingLedgerClassId, amount=$amount, batchId=$batchId, chargeBearer=$chargeBearer, counterpartyId=$counterpartyId, createdAt=$createdAt, currency=$currency, currentHold=$currentHold, currentReturn=$currentReturn, description=$description, direction=$direction, effectiveDate=$effectiveDate, expiresAt=$expiresAt, externalId=$externalId, foreignExchangeContract=$foreignExchangeContract, foreignExchangeIndicator=$foreignExchangeIndicator, foreignExchangeRate=$foreignExchangeRate, ledgerTransactionId=$ledgerTransactionId, liveMode=$liveMode, metadata=$metadata, nsfProtected=$nsfProtected, object_=$object_, originatingAccountId=$originatingAccountId, originatingPartyName=$originatingPartyName, priority=$priority, processAfter=$processAfter, purpose=$purpose, receivingAccountId=$receivingAccountId, receivingAccountType=$receivingAccountType, reconciliationStatus=$reconciliationStatus, referenceNumbers=$referenceNumbers, remittanceInformation=$remittanceInformation, sendRemittanceAdvice=$sendRemittanceAdvice, statementDescriptor=$statementDescriptor, status=$status, subtype=$subtype, transactionIds=$transactionIds, type=$type, ultimateOriginatingAccount=$ultimateOriginatingAccount, ultimateOriginatingAccountId=$ultimateOriginatingAccountId, ultimateOriginatingAccountType=$ultimateOriginatingAccountType, ultimateOriginatingPartyIdentifier=$ultimateOriginatingPartyIdentifier, ultimateOriginatingPartyName=$ultimateOriginatingPartyName, ultimateReceivingPartyIdentifier=$ultimateReceivingPartyIdentifier, ultimateReceivingPartyName=$ultimateReceivingPartyName, updatedAt=$updatedAt, vendorAttributes=$vendorAttributes, vendorFailureReason=$vendorFailureReason, additionalProperties=$additionalProperties}" } diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt index 2454237e0..0e5b844a9 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParams.kt @@ -329,6 +329,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = body.transactionMonitoringEnabled() /** @@ -605,6 +606,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") fun _transactionMonitoringEnabled(): JsonField = body._transactionMonitoringEnabled() /** @@ -1329,6 +1331,7 @@ private constructor( /** * A flag that determines whether a payment order should go through transaction monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -1340,6 +1343,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: JsonField) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -2087,6 +2091,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = transactionMonitoringEnabled.getOptional("transaction_monitoring_enabled") @@ -2422,6 +2427,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the JSON field has an * unexpected type. */ + @Deprecated("deprecated") @JsonProperty("transaction_monitoring_enabled") @ExcludeMissing fun _transactionMonitoringEnabled(): JsonField = transactionMonitoringEnabled @@ -3228,6 +3234,7 @@ private constructor( * A flag that determines whether a payment order should go through transaction * monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = transactionMonitoringEnabled(JsonField.of(transactionMonitoringEnabled)) @@ -3238,6 +3245,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: JsonField) = apply { this.transactionMonitoringEnabled = transactionMonitoringEnabled @@ -5907,6 +5915,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -5938,6 +5948,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5966,6 +5977,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5996,6 +6008,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -6024,6 +6037,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt index 1f6c91f1d..a2e1e267b 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParams.kt @@ -342,6 +342,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = body.transactionMonitoringEnabled() /** @@ -632,6 +633,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the multipart field has * an unexpected type. */ + @Deprecated("deprecated") fun _transactionMonitoringEnabled(): MultipartField = body._transactionMonitoringEnabled() @@ -1387,6 +1389,7 @@ private constructor( /** * A flag that determines whether a payment order should go through transaction monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) } @@ -1398,6 +1401,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: MultipartField) = apply { body.transactionMonitoringEnabled(transactionMonitoringEnabled) @@ -2051,6 +2055,7 @@ private constructor( * @throws ModernTreasuryInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(): Optional = transactionMonitoringEnabled.value.getOptional("transaction_monitoring_enabled") @@ -2416,6 +2421,7 @@ private constructor( * Unlike [transactionMonitoringEnabled], this method doesn't throw if the multipart field * has an unexpected type. */ + @Deprecated("deprecated") @JsonProperty("transaction_monitoring_enabled") @ExcludeMissing fun _transactionMonitoringEnabled(): MultipartField = transactionMonitoringEnabled @@ -3269,6 +3275,7 @@ private constructor( * A flag that determines whether a payment order should go through transaction * monitoring. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled(transactionMonitoringEnabled: Boolean) = transactionMonitoringEnabled(MultipartField.of(transactionMonitoringEnabled)) @@ -3279,6 +3286,7 @@ private constructor( * [Boolean] value instead. This method is primarily for setting the field to an * undocumented or not yet supported value. */ + @Deprecated("deprecated") fun transactionMonitoringEnabled( transactionMonitoringEnabled: MultipartField ) = apply { this.transactionMonitoringEnabled = transactionMonitoringEnabled } @@ -6219,6 +6227,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -6250,6 +6260,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6278,6 +6289,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -6308,6 +6320,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -6336,6 +6349,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt index 2bd0708fb..9a9246767 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParams.kt @@ -5815,6 +5815,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -5846,6 +5848,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5874,6 +5877,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -5904,6 +5908,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -5932,6 +5937,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt index 7567b250e..8a27ad3f2 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/PaymentReference.kt @@ -667,14 +667,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -787,8 +779,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -889,8 +879,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -997,10 +985,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -1107,10 +1091,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt index 8078e5d3b..86b611a13 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnCreateParams.kt @@ -73,7 +73,14 @@ private constructor( */ fun corrections(): Optional = body.corrections() - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnCreateParams.data().convert(MyClass.class); + * ``` + */ fun _data(): JsonValue = body._data() /** @@ -600,7 +607,14 @@ private constructor( */ fun corrections(): Optional = corrections.getOptional("corrections") - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnCreateRequest.data().convert(MyClass.class); + * ``` + */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data /** diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt index 89764cd93..476006891 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/ReturnObject.kt @@ -358,7 +358,14 @@ private constructor( fun additionalInformation(): Optional = additionalInformation.getOptional("additional_information") - /** The raw data from the return file that we get from the bank. */ + /** + * The raw data from the return file that we get from the bank. + * + * This arbitrary value can be deserialized into a custom type using the `convert` method: + * ```java + * MyClass myObject = returnObject.data().convert(MyClass.class); + * ``` + */ @JsonProperty("data") @ExcludeMissing fun _data(): JsonValue = data /** @@ -3115,14 +3122,6 @@ private constructor( @JvmField val SVB_PAYMENT_ID = of("svb_payment_id") - @JvmField - val SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW = - of("svb_transaction_cleared_for_sanctions_review") - - @JvmField - val SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW = - of("svb_transaction_held_for_sanctions_review") - @JvmField val SWIFT_MIR = of("swift_mir") @JvmField val SWIFT_UETR = of("swift_uetr") @@ -3236,8 +3235,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -3340,8 +3337,6 @@ private constructor( SILVERGATE_PAYMENT_ID, SVB_END_TO_END_ID, SVB_PAYMENT_ID, - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW, - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW, SWIFT_MIR, SWIFT_UETR, UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER, @@ -3448,10 +3443,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Value.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Value.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Value.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Value.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Value.SWIFT_MIR SWIFT_UETR -> Value.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Value.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER @@ -3558,10 +3549,6 @@ private constructor( SILVERGATE_PAYMENT_ID -> Known.SILVERGATE_PAYMENT_ID SVB_END_TO_END_ID -> Known.SVB_END_TO_END_ID SVB_PAYMENT_ID -> Known.SVB_PAYMENT_ID - SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_CLEARED_FOR_SANCTIONS_REVIEW - SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW -> - Known.SVB_TRANSACTION_HELD_FOR_SANCTIONS_REVIEW SWIFT_MIR -> Known.SWIFT_MIR SWIFT_UETR -> Known.SWIFT_UETR UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER -> Known.UMB_PRODUCT_PARTNER_ACCOUNT_NUMBER diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt index e45b45cf5..b25fba7d5 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/Transaction.kt @@ -1784,7 +1784,7 @@ private constructor( @JvmField val JPMC = of("jpmc") - @JvmField val MT_FLOW = of("mt_flow") + @JvmField val MODERN_TREASURY = of("modern_treasury") @JvmField val MX = of("mx") @@ -1828,7 +1828,7 @@ private constructor( HIFI, ISO20022, JPMC, - MT_FLOW, + MODERN_TREASURY, MX, PAXOS, PAYPAL, @@ -1868,7 +1868,7 @@ private constructor( HIFI, ISO20022, JPMC, - MT_FLOW, + MODERN_TREASURY, MX, PAXOS, PAYPAL, @@ -1912,7 +1912,7 @@ private constructor( HIFI -> Value.HIFI ISO20022 -> Value.ISO20022 JPMC -> Value.JPMC - MT_FLOW -> Value.MT_FLOW + MODERN_TREASURY -> Value.MODERN_TREASURY MX -> Value.MX PAXOS -> Value.PAXOS PAYPAL -> Value.PAYPAL @@ -1954,7 +1954,7 @@ private constructor( HIFI -> Known.HIFI ISO20022 -> Known.ISO20022 JPMC -> Known.JPMC - MT_FLOW -> Known.MT_FLOW + MODERN_TREASURY -> Known.MODERN_TREASURY MX -> Known.MX PAXOS -> Known.PAXOS PAYPAL -> Known.PAYPAL diff --git a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt index 5bdb4231e..dea21cf78 100644 --- a/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt +++ b/modern-treasury-java-core/src/main/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParams.kt @@ -1405,6 +1405,8 @@ private constructor( @JvmField val BASE_ADDRESS = of("base_address") + @JvmField val CARD_TOKEN = of("card_token") + @JvmField val CLABE = of("clabe") @JvmField val ETHEREUM_ADDRESS = of("ethereum_address") @@ -1436,6 +1438,7 @@ private constructor( enum class Known { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1463,6 +1466,7 @@ private constructor( enum class Value { AU_NUMBER, BASE_ADDRESS, + CARD_TOKEN, CLABE, ETHEREUM_ADDRESS, HK_NUMBER, @@ -1493,6 +1497,7 @@ private constructor( when (this) { AU_NUMBER -> Value.AU_NUMBER BASE_ADDRESS -> Value.BASE_ADDRESS + CARD_TOKEN -> Value.CARD_TOKEN CLABE -> Value.CLABE ETHEREUM_ADDRESS -> Value.ETHEREUM_ADDRESS HK_NUMBER -> Value.HK_NUMBER @@ -1521,6 +1526,7 @@ private constructor( when (this) { AU_NUMBER -> Known.AU_NUMBER BASE_ADDRESS -> Known.BASE_ADDRESS + CARD_TOKEN -> Known.CARD_TOKEN CLABE -> Known.CLABE ETHEREUM_ADDRESS -> Known.ETHEREUM_ADDRESS HK_NUMBER -> Known.HK_NUMBER diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt index 81297c872..2831c0da0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/core/ObjectMappersTest.kt @@ -3,12 +3,14 @@ package com.moderntreasury.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.readValue -import java.time.LocalDateTime +import java.time.LocalDate +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.ZoneOffset import kotlin.reflect.KClass import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.catchThrowable import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.EnumSource import org.junitpioneer.jupiter.cartesian.CartesianTest @@ -46,11 +48,7 @@ internal class ObjectMappersTest { val VALID_CONVERSIONS = listOf( FLOAT to DOUBLE, - FLOAT to INTEGER, - FLOAT to LONG, DOUBLE to FLOAT, - DOUBLE to INTEGER, - DOUBLE to LONG, INTEGER to FLOAT, INTEGER to DOUBLE, INTEGER to LONG, @@ -58,14 +56,6 @@ internal class ObjectMappersTest { LONG to DOUBLE, LONG to INTEGER, CLASS to MAP, - // These aren't actually valid, but coercion configs don't work for String until - // v2.14.0: https://github.com/FasterXML/jackson-databind/issues/3240 - // We currently test on v2.13.4. - BOOLEAN to STRING, - FLOAT to STRING, - DOUBLE to STRING, - INTEGER to STRING, - LONG to STRING, ) } } @@ -84,19 +74,44 @@ internal class ObjectMappersTest { } } - enum class LenientLocalDateTimeTestCase(val string: String) { - DATE("1998-04-21"), - DATE_TIME("1998-04-21T04:00:00"), - ZONED_DATE_TIME_1("1998-04-21T04:00:00+03:00"), - ZONED_DATE_TIME_2("1998-04-21T04:00:00Z"), + enum class LenientOffsetDateTimeTestCase( + val string: String, + val expectedOffsetDateTime: OffsetDateTime, + ) { + DATE( + "1998-04-21", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(0, 0), ZoneOffset.UTC), + ), + DATE_TIME( + "1998-04-21T04:00:00", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), + ZONED_DATE_TIME_1( + "1998-04-21T04:00:00+03:00", + expectedOffsetDateTime = + OffsetDateTime.of( + LocalDate.of(1998, 4, 21), + LocalTime.of(4, 0), + ZoneOffset.ofHours(3), + ), + ), + ZONED_DATE_TIME_2( + "1998-04-21T04:00:00Z", + expectedOffsetDateTime = + OffsetDateTime.of(LocalDate.of(1998, 4, 21), LocalTime.of(4, 0), ZoneOffset.UTC), + ), } @ParameterizedTest @EnumSource - fun readLocalDateTime_lenient(testCase: LenientLocalDateTimeTestCase) { + fun readOffsetDateTime_lenient(testCase: LenientOffsetDateTimeTestCase) { val jsonMapper = jsonMapper() val json = jsonMapper.writeValueAsString(testCase.string) - assertDoesNotThrow { jsonMapper().readValue(json) } + val offsetDateTime = jsonMapper().readValue(json) + + assertThat(offsetDateTime).isEqualTo(testCase.expectedOffsetDateTime) } } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt index 6a7f239c4..a5e8b0c22 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BalanceReportRetrieveParamsTest.kt @@ -11,7 +11,7 @@ internal class BalanceReportRetrieveParamsTest { fun create() { BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() } @@ -20,11 +20,11 @@ internal class BalanceReportRetrieveParamsTest { val params = BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() assertThat(params._pathParam(0)).isEqualTo("internal_account_id") - assertThat(params._pathParam(1)).isEqualTo("string") + assertThat(params._pathParam(1)).isEqualTo("latest") // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt index a33c60f84..0e4c84476 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkRequestCreateParamsTest.kt @@ -180,6 +180,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -463,6 +464,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -749,6 +751,7 @@ internal class BulkRequestCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt index ee5ca6012..fb0faf516 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/BulkResultTest.kt @@ -30,6 +30,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -292,6 +293,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -559,6 +561,7 @@ internal class BulkResultTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt index a5dd1e9bd..4bcc60dae 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityCreateTest.kt @@ -45,22 +45,7 @@ internal class ChildLegalEntityCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -105,6 +90,7 @@ internal class ChildLegalEntityCreateTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -121,8 +107,23 @@ internal class ChildLegalEntityCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -197,23 +198,7 @@ internal class ChildLegalEntityCreateTest { assertThat(childLegalEntityCreate.businessDescription()).contains("business_description") assertThat(childLegalEntityCreate.businessName()).contains("business_name") assertThat(childLegalEntityCreate.citizenshipCountry()).contains("citizenship_country") - assertThat(childLegalEntityCreate.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + assertThat(childLegalEntityCreate.connectionId()).contains("connection_id") assertThat(childLegalEntityCreate.countryOfIncorporation()) .contains("country_of_incorporation") assertThat(childLegalEntityCreate.dateFormed()).contains(LocalDate.parse("2019-12-27")) @@ -263,6 +248,7 @@ internal class ChildLegalEntityCreateTest { .contains(ChildLegalEntityCreate.LegalEntityType.BUSINESS) assertThat(childLegalEntityCreate.legalStructure()) .contains(ChildLegalEntityCreate.LegalStructure.CORPORATION) + assertThat(childLegalEntityCreate.listedExchange()).contains("listed_exchange") assertThat(childLegalEntityCreate.metadata()) .contains( ChildLegalEntityCreate.Metadata.builder() @@ -283,9 +269,26 @@ internal class ChildLegalEntityCreateTest { assertThat(childLegalEntityCreate.prefix()).contains("prefix") assertThat(childLegalEntityCreate.primarySocialMediaSites().getOrNull()) .containsExactly("string") + assertThat(childLegalEntityCreate.regulators().getOrNull()) + .containsExactly( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(childLegalEntityCreate.riskRating()) .contains(ChildLegalEntityCreate.RiskRating.LOW) + assertThat(childLegalEntityCreate.status()).contains(ChildLegalEntityCreate.Status.ACTIVE) assertThat(childLegalEntityCreate.suffix()).contains("suffix") + assertThat(childLegalEntityCreate.thirdPartyVerification()) + .contains( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(childLegalEntityCreate.tickerSymbol()).contains("ticker_symbol") assertThat(childLegalEntityCreate.wealthAndEmploymentDetails()) .contains( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() @@ -362,22 +365,7 @@ internal class ChildLegalEntityCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -422,6 +410,7 @@ internal class ChildLegalEntityCreateTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -438,8 +427,23 @@ internal class ChildLegalEntityCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt index a8ce10324..dd8ef7040 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ChildLegalEntityTest.kt @@ -52,27 +52,45 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -82,6 +100,41 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -153,35 +206,53 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() ) - .tokenUrl("token_url") + .liveMode(true) + .object_("object") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -193,6 +264,63 @@ internal class ChildLegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -224,6 +352,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -244,8 +373,25 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -313,6 +459,7 @@ internal class ChildLegalEntityTest { ) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -331,8 +478,23 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -411,30 +573,49 @@ internal class ChildLegalEntityTest { assertThat(childLegalEntity.businessDescription()).contains("business_description") assertThat(childLegalEntity.businessName()).contains("business_name") assertThat(childLegalEntity.citizenshipCountry()).contains("citizenship_country") - assertThat(childLegalEntity.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() + assertThat(childLegalEntity._complianceDetails()) + .isEqualTo(JsonValue.from(mapOf())) + assertThat(childLegalEntity.countryOfIncorporation()).contains("country_of_incorporation") + assertThat(childLegalEntity.createdAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(childLegalEntity.dateFormed()).contains(LocalDate.parse("2019-12-27")) + assertThat(childLegalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) + assertThat(childLegalEntity.discardedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(childLegalEntity.documents()) + .containsExactly( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - assertThat(childLegalEntity.countryOfIncorporation()).contains("country_of_incorporation") - assertThat(childLegalEntity.createdAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(childLegalEntity.dateFormed()).contains(LocalDate.parse("2019-12-27")) - assertThat(childLegalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) - assertThat(childLegalEntity.discardedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(childLegalEntity.doingBusinessAsNames()).containsExactly("string") assertThat(childLegalEntity.email()).contains("email") assertThat(childLegalEntity.expectedActivityVolume()).contains(0L) @@ -445,6 +626,39 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -512,29 +726,51 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -544,6 +780,59 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -572,6 +861,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -592,8 +882,23 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -658,6 +963,7 @@ internal class ChildLegalEntityTest { .isEqualTo(ChildLegalEntity.LegalEntityType.BUSINESS) assertThat(childLegalEntity.legalStructure()) .contains(ChildLegalEntity.LegalStructure.CORPORATION) + assertThat(childLegalEntity.listedExchange()).contains("listed_exchange") assertThat(childLegalEntity.liveMode()).isEqualTo(true) assertThat(childLegalEntity.metadata()) .isEqualTo( @@ -678,8 +984,25 @@ internal class ChildLegalEntityTest { assertThat(childLegalEntity.preferredName()).contains("preferred_name") assertThat(childLegalEntity.prefix()).contains("prefix") assertThat(childLegalEntity.primarySocialMediaSites()).containsExactly("string") + assertThat(childLegalEntity.regulators().getOrNull()) + .containsExactly( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(childLegalEntity.riskRating()).contains(ChildLegalEntity.RiskRating.LOW) + assertThat(childLegalEntity.status()).contains(ChildLegalEntity.Status.ACTIVE) assertThat(childLegalEntity.suffix()).contains("suffix") + assertThat(childLegalEntity.thirdPartyVerification()) + .contains( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(childLegalEntity.tickerSymbol()).contains("ticker_symbol") assertThat(childLegalEntity.updatedAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(childLegalEntity.wealthAndEmploymentDetails()) @@ -762,27 +1085,45 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -792,6 +1133,41 @@ internal class ChildLegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -863,35 +1239,53 @@ internal class ChildLegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() ) - .tokenUrl("token_url") + .liveMode(true) + .object_("object") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -903,6 +1297,63 @@ internal class ChildLegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -934,6 +1385,7 @@ internal class ChildLegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -954,8 +1406,25 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -1023,6 +1492,7 @@ internal class ChildLegalEntityTest { ) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -1041,8 +1511,23 @@ internal class ChildLegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt index 1441c2362..0ef49ede0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ConnectionLegalEntityCreateParamsTest.kt @@ -45,22 +45,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -137,34 +122,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -211,6 +169,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -232,8 +191,26 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -307,6 +284,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -325,8 +303,28 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail @@ -426,22 +424,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -519,34 +502,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -594,6 +550,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -618,8 +575,27 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -693,6 +669,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -711,8 +688,30 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail @@ -808,22 +807,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -900,34 +884,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -974,6 +931,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -995,8 +953,26 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -1070,6 +1046,7 @@ internal class ConnectionLegalEntityCreateParamsTest { .legalStructure( ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1088,8 +1065,28 @@ internal class ConnectionLegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt index 04b1203d9..4c93190b3 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/CounterpartyCreateParamsTest.kt @@ -49,6 +49,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -133,22 +134,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -225,34 +211,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -299,6 +258,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -320,8 +280,26 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -392,6 +370,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -410,8 +389,30 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail @@ -522,6 +523,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -612,22 +614,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -705,34 +692,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -780,6 +740,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -804,8 +765,27 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -877,6 +857,7 @@ internal class CounterpartyCreateParamsTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -895,10 +876,32 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail @@ -1008,6 +1011,7 @@ internal class CounterpartyCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -1093,22 +1097,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -1185,34 +1174,7 @@ internal class CounterpartyCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -1259,6 +1221,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1280,8 +1243,26 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -1352,6 +1333,7 @@ internal class CounterpartyCreateParamsTest { .legalStructure( CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -1370,8 +1352,30 @@ internal class CounterpartyCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt index 8bfe2757b..8f27c6155 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/ExternalAccountCreateParamsTest.kt @@ -37,6 +37,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -114,6 +115,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -189,6 +191,7 @@ internal class ExternalAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt index 5ae2460a8..2d2ec2747 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/IncomingPaymentDetailTest.kt @@ -121,6 +121,23 @@ internal class IncomingPaymentDetailTest { ) .virtualAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .originatingAccountNumber("originating_account_number") + .originatingPartyAddress( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .originatingPartyName("originating_party_name") + .originatingPartyVendorIdentifier("originating_party_vendor_identifier") .build() assertThat(incomingPaymentDetail.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -241,6 +258,25 @@ internal class IncomingPaymentDetailTest { .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(incomingPaymentDetail.originatingAccountNumber()) .contains("originating_account_number") + assertThat(incomingPaymentDetail.originatingPartyAddress()) + .contains( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + assertThat(incomingPaymentDetail.originatingPartyName()).contains("originating_party_name") + assertThat(incomingPaymentDetail.originatingPartyVendorIdentifier()) + .contains("originating_party_vendor_identifier") } @Test @@ -353,6 +389,23 @@ internal class IncomingPaymentDetailTest { ) .virtualAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .originatingAccountNumber("originating_account_number") + .originatingPartyAddress( + Address.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .country("country") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .line1("line1") + .line2("line2") + .liveMode(true) + .locality("locality") + .object_("object") + .postalCode("postal_code") + .region("region") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .originatingPartyName("originating_party_name") + .originatingPartyVendorIdentifier("originating_party_vendor_identifier") .build() val roundtrippedIncomingPaymentDetail = diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt index ff245009a..a5b6ae1c9 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/InvoiceTest.kt @@ -158,6 +158,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -548,6 +549,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -930,6 +932,7 @@ internal class InvoiceTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt index 6b7f5e2de..a0a93d5de 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryCreateParamsTest.kt @@ -18,6 +18,7 @@ internal class LedgerAccountCategoryCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() @@ -39,6 +40,7 @@ internal class LedgerAccountCategoryCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() @@ -57,6 +59,7 @@ internal class LedgerAccountCategoryCreateParamsTest { assertThat(body.normalBalance()).isEqualTo(TransactionDirection.CREDIT) assertThat(body.currencyExponent()).contains(0L) assertThat(body.description()).contains("description") + assertThat(body.externalId()).contains("external_id") assertThat(body.ledgerAccountCategoryIds().getOrNull()) .containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.metadata()) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt index 334159f64..5200c81f4 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCategoryListParamsTest.kt @@ -28,7 +28,7 @@ internal class LedgerAccountCategoryListParamsTest { .putAdditionalProperty("foo", "string") .build() ) - .addName("string") + .name("name") .parentLedgerAccountCategoryId("parent_ledger_account_category_id") .perPage(0L) .build() @@ -54,7 +54,7 @@ internal class LedgerAccountCategoryListParamsTest { .putAdditionalProperty("foo", "string") .build() ) - .addName("string") + .name("name") .parentLedgerAccountCategoryId("parent_ledger_account_category_id") .perPage(0L) .build() @@ -72,7 +72,7 @@ internal class LedgerAccountCategoryListParamsTest { .put("ledger_account_id", "ledger_account_id") .put("ledger_id", "ledger_id") .put("metadata[foo]", "string") - .put("name[]", "string") + .put("name", "name") .put("parent_ledger_account_category_id", "parent_ledger_account_category_id") .put("per_page", "0") .build() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt index 7a7de1404..d71ace6ed 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateParamsTest.kt @@ -19,6 +19,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -46,6 +47,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -71,6 +73,7 @@ internal class LedgerAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt index 9df869bc2..0139f096d 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerAccountCreateRequestTest.kt @@ -21,6 +21,7 @@ internal class LedgerAccountCreateRequestTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -41,6 +42,7 @@ internal class LedgerAccountCreateRequestTest { .isEqualTo(TransactionDirection.CREDIT) assertThat(ledgerAccountCreateRequest.currencyExponent()).contains(0L) assertThat(ledgerAccountCreateRequest.description()).contains("description") + assertThat(ledgerAccountCreateRequest.externalId()).contains("external_id") assertThat(ledgerAccountCreateRequest.ledgerAccountCategoryIds().getOrNull()) .containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(ledgerAccountCreateRequest.ledgerableId()) @@ -68,6 +70,7 @@ internal class LedgerAccountCreateRequestTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt index fd6bead83..afecac266 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LedgerEntryListParamsTest.kt @@ -53,7 +53,7 @@ internal class LedgerEntryListParamsTest { .perPage(0L) .showBalances(true) .showDeleted(true) - .addStatus(LedgerEntryListParams.Status.PENDING) + .status(LedgerEntryListParams.Status.PENDING) .updatedAt( LedgerEntryListParams.UpdatedAt.builder() .putAdditionalProperty("foo", "2019-12-27T18:11:19.117Z") @@ -114,7 +114,7 @@ internal class LedgerEntryListParamsTest { .perPage(0L) .showBalances(true) .showDeleted(true) - .addStatus(LedgerEntryListParams.Status.PENDING) + .status(LedgerEntryListParams.Status.PENDING) .updatedAt( LedgerEntryListParams.UpdatedAt.builder() .putAdditionalProperty("foo", "2019-12-27T18:11:19.117Z") @@ -151,7 +151,7 @@ internal class LedgerEntryListParamsTest { .put("per_page", "0") .put("show_balances", "true") .put("show_deleted", "true") - .put("status[]", "pending") + .put("status", "pending") .put("updated_at[foo]", "2019-12-27T18:11:19.117Z") .build() ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt index 84a80efbd..dadf5b123 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationCreateParamsTest.kt @@ -47,22 +47,7 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -108,6 +93,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -126,8 +112,23 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -221,22 +222,7 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -282,6 +268,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -300,8 +287,25 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -392,22 +396,7 @@ internal class LegalEntityAssociationCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -453,6 +442,7 @@ internal class LegalEntityAssociationCreateParamsTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -471,8 +461,23 @@ internal class LegalEntityAssociationCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt index cf120291b..660076b5f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationInlineCreateTest.kt @@ -51,22 +51,7 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -102,6 +87,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -120,8 +106,25 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -209,22 +212,7 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -260,6 +248,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -278,8 +267,23 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor(ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -373,22 +377,7 @@ internal class LegalEntityAssociationInlineCreateTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -424,6 +413,7 @@ internal class LegalEntityAssociationInlineCreateTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -442,8 +432,25 @@ internal class LegalEntityAssociationInlineCreateTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt index 6ec39fd0c..eb655435d 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityAssociationTest.kt @@ -56,27 +56,47 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -86,6 +106,47 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -114,6 +175,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -134,8 +196,23 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -233,27 +310,45 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -263,6 +358,45 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -291,6 +425,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -309,8 +444,23 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -415,27 +565,47 @@ internal class LegalEntityAssociationTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -445,6 +615,47 @@ internal class LegalEntityAssociationTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -473,6 +684,7 @@ internal class LegalEntityAssociationTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -493,8 +705,23 @@ internal class LegalEntityAssociationTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt deleted file mode 100644 index 60b46bf17..000000000 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityComplianceDetailTest.kt +++ /dev/null @@ -1,79 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.moderntreasury.api.models - -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.moderntreasury.api.core.jsonMapper -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class LegalEntityComplianceDetailTest { - - @Test - fun create() { - val legalEntityComplianceDetail = - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - assertThat(legalEntityComplianceDetail.id()) - .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(legalEntityComplianceDetail.createdAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.discardedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.issuer()).isEqualTo("issuer") - assertThat(legalEntityComplianceDetail.liveMode()).isEqualTo(true) - assertThat(legalEntityComplianceDetail.object_()).isEqualTo("object") - assertThat(legalEntityComplianceDetail.tokenExpiresAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.tokenIssuedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.tokenUrl()).contains("token_url") - assertThat(legalEntityComplianceDetail.updatedAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntityComplianceDetail.entityValidated()).isEqualTo(true) - assertThat(legalEntityComplianceDetail.validatedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val legalEntityComplianceDetail = - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - - val roundtrippedLegalEntityComplianceDetail = - jsonMapper.readValue( - jsonMapper.writeValueAsString(legalEntityComplianceDetail), - jacksonTypeRef(), - ) - - assertThat(roundtrippedLegalEntityComplianceDetail).isEqualTo(legalEntityComplianceDetail) - } -} diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt index c4a9c31df..d05dd1297 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityCreateParamsTest.kt @@ -43,22 +43,7 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -126,24 +111,7 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -179,6 +147,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -197,8 +166,25 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -254,6 +240,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -270,8 +257,23 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -349,22 +351,7 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -436,30 +423,7 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -498,6 +462,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -516,8 +481,26 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -576,6 +559,7 @@ internal class LegalEntityCreateParamsTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -594,8 +578,23 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -674,23 +673,7 @@ internal class LegalEntityCreateParamsTest { assertThat(body.businessDescription()).contains("business_description") assertThat(body.businessName()).contains("business_name") assertThat(body.citizenshipCountry()).contains("citizenship_country") - assertThat(body.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + assertThat(body.connectionId()).contains("connection_id") assertThat(body.countryOfIncorporation()).contains("country_of_incorporation") assertThat(body.dateFormed()).contains(LocalDate.parse("2019-12-27")) assertThat(body.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) @@ -761,24 +744,7 @@ internal class LegalEntityCreateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -814,6 +780,7 @@ internal class LegalEntityCreateParamsTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -832,8 +799,25 @@ internal class LegalEntityCreateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -890,6 +874,7 @@ internal class LegalEntityCreateParamsTest { ) assertThat(body.legalStructure()) .contains(LegalEntityCreateParams.LegalStructure.CORPORATION) + assertThat(body.listedExchange()).contains("listed_exchange") assertThat(body.metadata()) .contains( LegalEntityCreateParams.Metadata.builder() @@ -908,8 +893,25 @@ internal class LegalEntityCreateParamsTest { assertThat(body.preferredName()).contains("preferred_name") assertThat(body.prefix()).contains("prefix") assertThat(body.primarySocialMediaSites().getOrNull()).containsExactly("string") + assertThat(body.regulators().getOrNull()) + .containsExactly( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(body.riskRating()).contains(LegalEntityCreateParams.RiskRating.LOW) + assertThat(body.status()).contains(LegalEntityCreateParams.Status.ACTIVE) assertThat(body.suffix()).contains("suffix") + assertThat(body.thirdPartyVerification()) + .contains( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(body.tickerSymbol()).contains("ticker_symbol") assertThat(body.wealthAndEmploymentDetails()) .contains( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt index 09b644751..84e7aac69 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityListParamsTest.kt @@ -20,6 +20,7 @@ internal class LegalEntityListParamsTest { ) .perPage(0L) .showDeleted("show_deleted") + .status(LegalEntityListParams.Status.PENDING) .build() } @@ -36,6 +37,7 @@ internal class LegalEntityListParamsTest { ) .perPage(0L) .showDeleted("show_deleted") + .status(LegalEntityListParams.Status.PENDING) .build() val queryParams = params._queryParams() @@ -48,6 +50,7 @@ internal class LegalEntityListParamsTest { .put("metadata[foo]", "string") .put("per_page", "0") .put("show_deleted", "show_deleted") + .put("status", "pending") .build() ) } diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt index 8ad3d0bd2..bd9ea83f2 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityTest.kt @@ -52,27 +52,45 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -82,6 +100,41 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -109,6 +162,7 @@ internal class LegalEntityTest { .lastName("last_name") .legalEntityType(LegalEntity.LegalEntityType.BUSINESS) .legalStructure(LegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( LegalEntity.Metadata.builder() @@ -127,8 +181,23 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntity.RiskRating.LOW) + .status(LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( LegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -210,35 +279,53 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() ) - .tokenUrl("token_url") + .liveMode(true) + .object_("object") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -250,6 +337,63 @@ internal class LegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -281,6 +425,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -301,8 +446,25 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -407,30 +569,48 @@ internal class LegalEntityTest { assertThat(legalEntity.businessDescription()).contains("business_description") assertThat(legalEntity.businessName()).contains("business_name") assertThat(legalEntity.citizenshipCountry()).contains("citizenship_country") - assertThat(legalEntity.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() + assertThat(legalEntity._complianceDetails()).isEqualTo(JsonValue.from(mapOf())) + assertThat(legalEntity.countryOfIncorporation()).contains("country_of_incorporation") + assertThat(legalEntity.createdAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(legalEntity.dateFormed()).contains(LocalDate.parse("2019-12-27")) + assertThat(legalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) + assertThat(legalEntity.discardedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(legalEntity.documents()) + .containsExactly( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - assertThat(legalEntity.countryOfIncorporation()).contains("country_of_incorporation") - assertThat(legalEntity.createdAt()) - .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(legalEntity.dateFormed()).contains(LocalDate.parse("2019-12-27")) - assertThat(legalEntity.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) - assertThat(legalEntity.discardedAt()) - .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(legalEntity.doingBusinessAsNames()).containsExactly("string") assertThat(legalEntity.email()).contains("email") assertThat(legalEntity.expectedActivityVolume()).contains(0L) @@ -441,6 +621,39 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -467,6 +680,7 @@ internal class LegalEntityTest { assertThat(legalEntity.lastName()).contains("last_name") assertThat(legalEntity.legalEntityType()).isEqualTo(LegalEntity.LegalEntityType.BUSINESS) assertThat(legalEntity.legalStructure()).contains(LegalEntity.LegalStructure.CORPORATION) + assertThat(legalEntity.listedExchange()).contains("listed_exchange") assertThat(legalEntity.liveMode()).isEqualTo(true) assertThat(legalEntity.metadata()) .isEqualTo( @@ -485,8 +699,25 @@ internal class LegalEntityTest { assertThat(legalEntity.preferredName()).contains("preferred_name") assertThat(legalEntity.prefix()).contains("prefix") assertThat(legalEntity.primarySocialMediaSites()).containsExactly("string") + assertThat(legalEntity.regulators().getOrNull()) + .containsExactly( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(legalEntity.riskRating()).contains(LegalEntity.RiskRating.LOW) + assertThat(legalEntity.status()).contains(LegalEntity.Status.ACTIVE) assertThat(legalEntity.suffix()).contains("suffix") + assertThat(legalEntity.thirdPartyVerification()) + .contains( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(legalEntity.tickerSymbol()).contains("ticker_symbol") assertThat(legalEntity.updatedAt()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(legalEntity.wealthAndEmploymentDetails()) @@ -564,29 +795,51 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -596,6 +849,59 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -624,6 +930,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -644,8 +951,23 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor(ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -748,27 +1070,45 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) .liveMode(true) .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -778,6 +1118,41 @@ internal class LegalEntityTest { .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(LegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -805,6 +1180,7 @@ internal class LegalEntityTest { .lastName("last_name") .legalEntityType(LegalEntity.LegalEntityType.BUSINESS) .legalStructure(LegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( LegalEntity.Metadata.builder() @@ -823,8 +1199,23 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntity.RiskRating.LOW) + .status(LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntity.ThirdPartyVerification.builder() + .vendor(LegalEntity.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( LegalEntity.LegalEntityWealthEmploymentDetail.builder() @@ -906,35 +1297,53 @@ internal class LegalEntityTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() + .complianceDetails(JsonValue.from(mapOf())) + .countryOfIncorporation("country_of_incorporation") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateFormed(LocalDate.parse("2019-12-27")) + .dateOfBirth(LocalDate.parse("2019-12-27")) + .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .addDocument( + Document.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .documentIdentifier("document_identifier") + .documentIdentifierType("document_identifier_type") + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + .documentType("document_type") + .documentableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentableType(Document.DocumentableType.CONNECTION) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() ) - .tokenUrl("token_url") + .liveMode(true) + .object_("object") + .source("source") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) .build() ) - .countryOfIncorporation("country_of_incorporation") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .dateFormed(LocalDate.parse("2019-12-27")) - .dateOfBirth(LocalDate.parse("2019-12-27")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .addDoingBusinessAsName("string") .email("email") .expectedActivityVolume(0L) @@ -946,6 +1355,63 @@ internal class LegalEntityTest { .discardedAt( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") ) + .addDocument( + Document.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .discardedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .addDocumentDetail( + Document.DocumentDetail.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .discardedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .documentIdentifier("document_identifier") + .documentIdentifierType( + "document_identifier_type" + ) + .liveMode(true) + .object_("object") + .updatedAt( + OffsetDateTime.parse( + "2019-12-27T18:11:19.117Z" + ) + ) + .build() + ) + .documentType("document_type") + .documentableId( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + .documentableType( + Document.DocumentableType.CONNECTION + ) + .file( + Document.File.builder() + .contentType("content_type") + .filename("filename") + .size(0L) + .build() + ) + .liveMode(true) + .object_("object") + .source("source") + .updatedAt( + OffsetDateTime.parse("2019-12-27T18:11:19.117Z") + ) + .build() + ) .expirationDate(LocalDate.parse("2019-12-27")) .idType(ChildLegalEntity.Identification.IdType.AR_CUIL) .issuingCountry("issuing_country") @@ -977,6 +1443,7 @@ internal class LegalEntityTest { .legalEntityAssociations(listOf()) .legalEntityType(ChildLegalEntity.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntity.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .liveMode(true) .metadata( ChildLegalEntity.Metadata.builder() @@ -997,8 +1464,25 @@ internal class LegalEntityTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntity.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntity.RiskRating.LOW) + .status(ChildLegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntity.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntity.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .wealthAndEmploymentDetails( ChildLegalEntity.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt index 668d3f6c4..2ca72e6a0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/LegalEntityUpdateParamsTest.kt @@ -43,22 +43,6 @@ internal class LegalEntityUpdateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -90,6 +74,7 @@ internal class LegalEntityUpdateParamsTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -106,8 +91,23 @@ internal class LegalEntityUpdateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -194,22 +194,6 @@ internal class LegalEntityUpdateParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -243,6 +227,7 @@ internal class LegalEntityUpdateParamsTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -261,8 +246,23 @@ internal class LegalEntityUpdateParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -339,23 +339,6 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.businessDescription()).contains("business_description") assertThat(body.businessName()).contains("business_name") assertThat(body.citizenshipCountry()).contains("citizenship_country") - assertThat(body.complianceDetails()) - .contains( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) assertThat(body.countryOfIncorporation()).contains("country_of_incorporation") assertThat(body.dateFormed()).contains(LocalDate.parse("2019-12-27")) assertThat(body.dateOfBirth()).contains(LocalDate.parse("2019-12-27")) @@ -390,6 +373,7 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.lastName()).contains("last_name") assertThat(body.legalStructure()) .contains(LegalEntityUpdateParams.LegalStructure.CORPORATION) + assertThat(body.listedExchange()).contains("listed_exchange") assertThat(body.metadata()) .contains( LegalEntityUpdateParams.Metadata.builder() @@ -408,8 +392,25 @@ internal class LegalEntityUpdateParamsTest { assertThat(body.preferredName()).contains("preferred_name") assertThat(body.prefix()).contains("prefix") assertThat(body.primarySocialMediaSites().getOrNull()).containsExactly("string") + assertThat(body.regulators().getOrNull()) + .containsExactly( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) assertThat(body.riskRating()).contains(LegalEntityUpdateParams.RiskRating.LOW) + assertThat(body.status()).contains(LegalEntityUpdateParams.Status.ACTIVE) assertThat(body.suffix()).contains("suffix") + assertThat(body.thirdPartyVerification()) + .contains( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + assertThat(body.tickerSymbol()).contains("ticker_symbol") assertThat(body.wealthAndEmploymentDetails()) .contains( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt index 5ecf66672..25fefe1c0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateAsyncParamsTest.kt @@ -143,6 +143,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -343,6 +344,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -548,6 +550,7 @@ internal class PaymentOrderCreateAsyncParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt index a74cda64b..9455deae6 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderCreateParamsTest.kt @@ -154,6 +154,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -364,6 +365,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -638,6 +640,7 @@ internal class PaymentOrderCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt index 56eae445c..d4e139f8f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderTest.kt @@ -26,6 +26,7 @@ internal class PaymentOrderTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -253,6 +254,7 @@ internal class PaymentOrderTest { assertThat(paymentOrder.accountingLedgerClassId()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.amount()).isEqualTo(0L) + assertThat(paymentOrder.batchId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.chargeBearer()).contains(PaymentOrder.ChargeBearer.SHARED) assertThat(paymentOrder.counterpartyId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentOrder.createdAt()) @@ -504,6 +506,7 @@ internal class PaymentOrderTest { .accountingCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .accountingLedgerClassId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(0L) + .batchId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .chargeBearer(PaymentOrder.ChargeBearer.SHARED) .counterpartyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt index a3c55e338..b4828d225 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/PaymentOrderUpdateParamsTest.kt @@ -93,6 +93,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -250,6 +251,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -400,6 +402,7 @@ internal class PaymentOrderUpdateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt index 24ec67f5d..7bb05ca23 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/models/VirtualAccountCreateParamsTest.kt @@ -35,6 +35,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -93,6 +94,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) @@ -151,6 +153,7 @@ internal class VirtualAccountCreateParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt index 5be4e301e..f300b72d3 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ErrorHandlingTest.kt @@ -106,6 +106,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -204,6 +205,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -302,6 +304,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -400,6 +403,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -498,6 +502,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -596,6 +601,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -694,6 +700,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -792,6 +799,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -890,6 +898,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -988,6 +997,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1086,6 +1096,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1184,6 +1195,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1282,6 +1294,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1380,6 +1393,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1478,6 +1492,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1576,6 +1591,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -1672,6 +1688,7 @@ internal class ErrorHandlingTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt index 71c65714e..8c6af7e4b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/ServiceParamsTest.kt @@ -24,7 +24,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -91,6 +90,7 @@ internal class ServiceParamsTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType( @@ -181,22 +181,7 @@ internal class ServiceParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -274,34 +259,7 @@ internal class ServiceParamsTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -349,6 +307,7 @@ internal class ServiceParamsTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -373,8 +332,27 @@ internal class ServiceParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -446,6 +424,7 @@ internal class ServiceParamsTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -464,10 +443,32 @@ internal class ServiceParamsTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest.ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt index 6571a9514..1c3e230d0 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/BulkRequestServiceAsyncTest.kt @@ -233,6 +233,7 @@ internal class BulkRequestServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt index ba423ca36..99e56b117 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ConnectionLegalEntityServiceAsyncTest.kt @@ -11,7 +11,6 @@ import com.moderntreasury.api.models.ConnectionLegalEntityUpdateParams import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -68,24 +67,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -170,46 +152,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -265,6 +208,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -292,8 +236,30 @@ internal class ConnectionLegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -376,6 +342,7 @@ internal class ConnectionLegalEntityServiceAsyncTest { ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -394,10 +361,32 @@ internal class ConnectionLegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt index 209e3548a..e2f5f1080 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/CounterpartyServiceAsyncTest.kt @@ -16,7 +16,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -76,6 +75,7 @@ internal class CounterpartyServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -174,24 +174,7 @@ internal class CounterpartyServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -276,46 +259,7 @@ internal class CounterpartyServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -371,6 +315,7 @@ internal class CounterpartyServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -398,8 +343,30 @@ internal class CounterpartyServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -478,6 +445,7 @@ internal class CounterpartyServiceAsyncTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -497,10 +465,34 @@ internal class CounterpartyServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest + .LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt index 949670685..a267c8c09 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/ExternalAccountServiceAsyncTest.kt @@ -62,6 +62,7 @@ internal class ExternalAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt index 42ff35cdd..927307eb7 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountCategoryServiceAsyncTest.kt @@ -40,6 +40,7 @@ internal class LedgerAccountCategoryServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt index fc31ea0f9..ac7e8573b 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LedgerAccountServiceAsyncTest.kt @@ -36,6 +36,7 @@ internal class LedgerAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt index bb8de2d42..0cc88fc91 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityAssociationServiceAsyncTest.kt @@ -10,7 +10,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationCreateParams import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -71,24 +70,7 @@ internal class LegalEntityAssociationServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -134,6 +116,7 @@ internal class LegalEntityAssociationServiceAsyncTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -152,8 +135,25 @@ internal class LegalEntityAssociationServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt index acad9a703..6339cb4a7 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/LegalEntityServiceAsyncTest.kt @@ -9,7 +9,6 @@ import com.moderntreasury.api.models.ChildLegalEntityCreate import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityCreateParams import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.LegalEntityUpdateParams @@ -65,22 +64,7 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -157,34 +141,7 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -231,6 +188,7 @@ internal class LegalEntityServiceAsyncTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -252,8 +210,26 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -322,6 +298,7 @@ internal class LegalEntityServiceAsyncTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -340,8 +317,23 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -452,22 +444,6 @@ internal class LegalEntityServiceAsyncTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -501,6 +477,7 @@ internal class LegalEntityServiceAsyncTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -519,8 +496,23 @@ internal class LegalEntityServiceAsyncTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt index eba7e3068..48f60fc93 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/PaymentOrderServiceAsyncTest.kt @@ -184,6 +184,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -370,6 +371,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -613,6 +615,7 @@ internal class PaymentOrderServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt index 0c7bf453f..4388d5724 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/VirtualAccountServiceAsyncTest.kt @@ -52,6 +52,7 @@ internal class VirtualAccountServiceAsyncTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt index 9ff74ef6c..44b7e4ec1 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/async/internalAccounts/BalanceReportServiceAsyncTest.kt @@ -63,7 +63,7 @@ internal class BalanceReportServiceAsyncTest { balanceReportServiceAsync.retrieve( BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt index ca9fc331d..237327f4c 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/BulkRequestServiceTest.kt @@ -233,6 +233,7 @@ internal class BulkRequestServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt index 43cea92d7..961a212ab 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ConnectionLegalEntityServiceTest.kt @@ -11,7 +11,6 @@ import com.moderntreasury.api.models.ConnectionLegalEntityUpdateParams import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -68,24 +67,7 @@ internal class ConnectionLegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -170,46 +152,7 @@ internal class ConnectionLegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -265,6 +208,7 @@ internal class ConnectionLegalEntityServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -292,8 +236,30 @@ internal class ConnectionLegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -376,6 +342,7 @@ internal class ConnectionLegalEntityServiceTest { ConnectionLegalEntityCreateParams.LegalEntity.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( ConnectionLegalEntityCreateParams.LegalEntity.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -394,10 +361,32 @@ internal class ConnectionLegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ConnectionLegalEntityCreateParams.LegalEntity.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( ConnectionLegalEntityCreateParams.LegalEntity.RiskRating.LOW ) + .status(ConnectionLegalEntityCreateParams.LegalEntity.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ConnectionLegalEntityCreateParams.LegalEntity.ThirdPartyVerification + .builder() + .vendor( + ConnectionLegalEntityCreateParams.LegalEntity + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ConnectionLegalEntityCreateParams.LegalEntity .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt index 387230113..61b546706 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/CounterpartyServiceTest.kt @@ -16,7 +16,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LedgerAccountCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.TransactionDirection import java.time.LocalDate @@ -76,6 +75,7 @@ internal class CounterpartyServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -174,24 +174,7 @@ internal class CounterpartyServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -276,46 +259,7 @@ internal class CounterpartyServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .discardedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenIssuedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse( - "2019-12-27T18:11:19.117Z" - ) - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -371,6 +315,7 @@ internal class CounterpartyServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty( @@ -398,8 +343,30 @@ internal class CounterpartyServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification + .builder() + .vendor( + ChildLegalEntityCreate + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate .LegalEntityWealthEmploymentDetail @@ -478,6 +445,7 @@ internal class CounterpartyServiceTest { CounterpartyCreateParams.LegalEntityCreateRequest.LegalStructure .CORPORATION ) + .listedExchange("listed_exchange") .metadata( CounterpartyCreateParams.LegalEntityCreateRequest.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -497,10 +465,34 @@ internal class CounterpartyServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + CounterpartyCreateParams.LegalEntityCreateRequest + .LegalEntityRegulator + .builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating( CounterpartyCreateParams.LegalEntityCreateRequest.RiskRating.LOW ) + .status(CounterpartyCreateParams.LegalEntityCreateRequest.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .builder() + .vendor( + CounterpartyCreateParams.LegalEntityCreateRequest + .ThirdPartyVerification + .Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( CounterpartyCreateParams.LegalEntityCreateRequest .LegalEntityWealthEmploymentDetail diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt index 7a9a5991b..e067bc779 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/ExternalAccountServiceTest.kt @@ -62,6 +62,7 @@ internal class ExternalAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt index 5ebd74f4f..b8091e716 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountCategoryServiceTest.kt @@ -40,6 +40,7 @@ internal class LedgerAccountCategoryServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .metadata( LedgerAccountCategoryCreateParams.Metadata.builder() diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt index 19a5b4440..87c0f1623 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LedgerAccountServiceTest.kt @@ -36,6 +36,7 @@ internal class LedgerAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt index e61535dfa..71a35ed2f 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityAssociationServiceTest.kt @@ -10,7 +10,6 @@ import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationCreateParams import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityIndustryClassification import java.time.LocalDate import java.time.OffsetDateTime @@ -71,24 +70,7 @@ internal class LegalEntityAssociationServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -134,6 +116,7 @@ internal class LegalEntityAssociationServiceTest { ) .legalEntityType(ChildLegalEntityCreate.LegalEntityType.BUSINESS) .legalStructure(ChildLegalEntityCreate.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -152,8 +135,25 @@ internal class LegalEntityAssociationServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor.PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt index 9f8d9b9da..4894972b7 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/LegalEntityServiceTest.kt @@ -9,7 +9,6 @@ import com.moderntreasury.api.models.ChildLegalEntityCreate import com.moderntreasury.api.models.IdentificationCreateRequest import com.moderntreasury.api.models.LegalEntityAddressCreateRequest import com.moderntreasury.api.models.LegalEntityAssociationInlineCreate -import com.moderntreasury.api.models.LegalEntityComplianceDetail import com.moderntreasury.api.models.LegalEntityCreateParams import com.moderntreasury.api.models.LegalEntityIndustryClassification import com.moderntreasury.api.models.LegalEntityUpdateParams @@ -65,22 +64,7 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -157,34 +141,7 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .discardedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenIssuedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .tokenUrl("token_url") - .updatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .entityValidated(true) - .validatedAt( - OffsetDateTime.parse("2019-12-27T18:11:19.117Z") - ) - .build() - ) + .connectionId("connection_id") .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -231,6 +188,7 @@ internal class LegalEntityServiceTest { .legalStructure( ChildLegalEntityCreate.LegalStructure.CORPORATION ) + .listedExchange("listed_exchange") .metadata( ChildLegalEntityCreate.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -252,8 +210,26 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + ChildLegalEntityCreate.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(ChildLegalEntityCreate.RiskRating.LOW) + .status(ChildLegalEntityCreate.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + ChildLegalEntityCreate.ThirdPartyVerification.builder() + .vendor( + ChildLegalEntityCreate.ThirdPartyVerification.Vendor + .PERSONA + ) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( ChildLegalEntityCreate.LegalEntityWealthEmploymentDetail .builder() @@ -322,6 +298,7 @@ internal class LegalEntityServiceTest { .build() ) .legalStructure(LegalEntityCreateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityCreateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -340,8 +317,23 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityCreateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityCreateParams.RiskRating.LOW) + .status(LegalEntityCreateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityCreateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityCreateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityCreateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -450,22 +442,6 @@ internal class LegalEntityServiceTest { .businessDescription("business_description") .businessName("business_name") .citizenshipCountry("citizenship_country") - .complianceDetails( - LegalEntityComplianceDetail.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .discardedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .issuer("issuer") - .liveMode(true) - .object_("object") - .tokenExpiresAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenIssuedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .tokenUrl("token_url") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .entityValidated(true) - .validatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) .countryOfIncorporation("country_of_incorporation") .dateFormed(LocalDate.parse("2019-12-27")) .dateOfBirth(LocalDate.parse("2019-12-27")) @@ -499,6 +475,7 @@ internal class LegalEntityServiceTest { .intendedUse("intended_use") .lastName("last_name") .legalStructure(LegalEntityUpdateParams.LegalStructure.CORPORATION) + .listedExchange("listed_exchange") .metadata( LegalEntityUpdateParams.Metadata.builder() .putAdditionalProperty("key", JsonValue.from("value")) @@ -517,8 +494,23 @@ internal class LegalEntityServiceTest { .preferredName("preferred_name") .prefix("prefix") .addPrimarySocialMediaSite("string") + .addRegulator( + LegalEntityUpdateParams.LegalEntityRegulator.builder() + .jurisdiction("jurisdiction") + .name("name") + .registrationNumber("registration_number") + .build() + ) .riskRating(LegalEntityUpdateParams.RiskRating.LOW) + .status(LegalEntityUpdateParams.Status.ACTIVE) .suffix("suffix") + .thirdPartyVerification( + LegalEntityUpdateParams.ThirdPartyVerification.builder() + .vendor(LegalEntityUpdateParams.ThirdPartyVerification.Vendor.PERSONA) + .vendorVerificationId("vendor_verification_id") + .build() + ) + .tickerSymbol("ticker_symbol") .wealthAndEmploymentDetails( LegalEntityUpdateParams.LegalEntityWealthEmploymentDetail.builder() .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt index 66ecce34a..2cd99b5f1 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/PaymentOrderServiceTest.kt @@ -184,6 +184,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -368,6 +369,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) @@ -609,6 +611,7 @@ internal class PaymentOrderServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId( "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt index b7701d69b..6a27e5dfb 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/VirtualAccountServiceTest.kt @@ -52,6 +52,7 @@ internal class VirtualAccountServiceTest { .normalBalance(TransactionDirection.CREDIT) .currencyExponent(0L) .description("description") + .externalId("external_id") .addLedgerAccountCategoryId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .ledgerableType(LedgerAccountCreateRequest.LedgerableType.COUNTERPARTY) diff --git a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt index 043093aac..7ab1790ed 100644 --- a/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt +++ b/modern-treasury-java-core/src/test/kotlin/com/moderntreasury/api/services/blocking/internalAccounts/BalanceReportServiceTest.kt @@ -62,7 +62,7 @@ internal class BalanceReportServiceTest { balanceReportService.retrieve( BalanceReportRetrieveParams.builder() .internalAccountId("internal_account_id") - .id(BalanceReportRetrieveParams.Id.of("string")) + .id(BalanceReportRetrieveParams.Id.LATEST) .build() ) diff --git a/modern-treasury-java-proguard-test/build.gradle.kts b/modern-treasury-java-proguard-test/build.gradle.kts index 9ed5c9bcb..e410c9492 100644 --- a/modern-treasury-java-proguard-test/build.gradle.kts +++ b/modern-treasury-java-proguard-test/build.gradle.kts @@ -18,8 +18,8 @@ dependencies { testImplementation(project(":modern-treasury-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") - testImplementation("org.assertj:assertj-core:3.25.3") - testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4") + testImplementation("org.assertj:assertj-core:3.27.7") + testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } tasks.shadowJar { diff --git a/scripts/build b/scripts/build index f40634826..16a2b00db 100755 --- a/scripts/build +++ b/scripts/build @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Building classes" -./gradlew build testClasses -x test +./gradlew build testClasses "$@" -x test diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts index 729e6f222..10f3c7055 100755 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -7,6 +7,8 @@ GREEN='\033[32m' RED='\033[31m' NC='\033[0m' # No Color +MAVEN_REPO_PATH="./build/local-maven-repo" + log_error() { local msg="$1" local headers="$2" @@ -24,7 +26,7 @@ upload_file() { if [ -f "$file_name" ]; then echo -e "${GREEN}Processing file: $file_name${NC}" - pkg_file_name="mvn${file_name#./build/local-maven-repo}" + pkg_file_name="mvn${file_name#"${MAVEN_REPO_PATH}"}" # Get signed URL for uploading artifact file signed_url_response=$(curl -X POST -G "$URL" \ @@ -47,18 +49,20 @@ upload_file() { md5|sha1|sha256|sha512) content_type="text/plain" ;; module) content_type="application/json" ;; pom|xml) content_type="application/xml" ;; + html) content_type="text/html" ;; *) content_type="application/octet-stream" ;; esac # Upload file upload_response=$(curl -v -X PUT \ --retry 5 \ + --retry-all-errors \ -D "$tmp_headers" \ -H "Content-Type: $content_type" \ --data-binary "@${file_name}" "$signed_url" 2>&1) if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then - log_error "Failed upload artifact file" "$tmp_headers" "$upload_response" + log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response" fi # Insert small throttle to reduce rate limiting risk @@ -81,6 +85,99 @@ walk_tree() { done } +generate_instructions() { + cat << EOF > "$MAVEN_REPO_PATH/index.html" + + + + Maven Repo + + +

Stainless SDK Maven Repository

+

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

+ +

Project configuration

+ +

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

+ +

Maven

+ +

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

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

Gradle

+

Add the following to your build.gradle file:

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

Configuring authentication (if required)

+ +

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

+ +

Maven with authentication

+ +

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

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

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

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

Gradle with authentication

+

Add the following to your build.gradle file:

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

Using the repository

+

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

+ + +EOF + upload_file "${MAVEN_REPO_PATH}/index.html" + + echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'" + echo "For more details, see the directions in https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn/index.html" +} + cd "$(dirname "$0")/.." echo "::group::Creating local Maven content" @@ -88,9 +185,9 @@ echo "::group::Creating local Maven content" echo "::endgroup::" echo "::group::Uploading to pkg.stainless.com" -walk_tree "./build/local-maven-repo" +walk_tree "$MAVEN_REPO_PATH" echo "::endgroup::" echo "::group::Generating instructions" -echo "Configure maven or gradle to use the repo located at 'https://pkg.stainless.com/s/${PROJECT}/${SHA}/mvn'" +generate_instructions echo "::endgroup::"