diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a048c034..9ceea478 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -22,10 +22,10 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: |
@@ -34,7 +34,7 @@ jobs:
cache: gradle
- name: Set up Gradle
- uses: gradle/actions/setup-gradle@v4
+ uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
- name: Run lints
run: ./scripts/lint
@@ -49,10 +49,10 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: |
@@ -61,7 +61,7 @@ jobs:
cache: gradle
- name: Set up Gradle
- uses: gradle/actions/setup-gradle@v4
+ uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
- name: Build SDK
run: ./scripts/build
@@ -71,7 +71,7 @@ jobs:
github.repository == 'stainless-sdks/clear-street-java' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
- uses: actions/github-script@v8
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());
@@ -91,10 +91,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/clear-street-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: |
@@ -103,7 +103,7 @@ jobs:
cache: gradle
- name: Set up Gradle
- uses: gradle/gradle-build-action@v2
+ uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
- name: Run tests
run: ./scripts/test
diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index bd4535dd..97a31bec 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@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Java
- uses: actions/setup-java@v5
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: |
@@ -26,14 +26,14 @@ jobs:
cache: gradle
- name: Set up Gradle
- uses: gradle/gradle-build-action@v2
+ uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
- name: Publish to Sonatype
run: |-
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
- ./gradlew publish --no-configuration-cache
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
env:
SONATYPE_USERNAME: ${{ secrets.CLEAR_STREET_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.CLEAR_STREET_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index fe7e731e..0ec66cb6 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'clear-street/clear-street-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check release environment
run: |
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 10f30916..6b7b74c5 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.0"
+ ".": "0.3.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index d96dfeb4..0fe2bc6d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 55
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-922781ed11f31a2f675819e9e6a1066ebb141304b9289c08d8cdbb825ff68b73.yml
-openapi_spec_hash: fac86508e0dd013ab6de64209da5ed72
-config_hash: f2e1d4767745a6f044519331a7cbfd79
+configured_endpoints: 61
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/clear-street/clear-street-778aab5bcb35ad542557833d9198158fff69771421393843317778f90be2c9f6.yml
+openapi_spec_hash: b5584a424c4072680789ee9f9b09d531
+config_hash: 3823311a3577c4e3cd71a1ea4ace533d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7efc228f..fe873000 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,58 @@
# Changelog
+## 0.3.0 (2026-06-29)
+
+Full Changelog: [v0.2.0...v0.3.0](https://github.com/clear-street/clear-street-java/compare/v0.2.0...v0.3.0)
+
+### Features
+
+* **api:** api update ([692735b](https://github.com/clear-street/clear-street-java/commit/692735bf797743480bae0e8e8e8ffbd9a97d1919))
+* **api:** api update ([245f095](https://github.com/clear-street/clear-street-java/commit/245f095fbc541a0f12a75b75bf410f79ac0430e3))
+* **api:** api update ([ba66042](https://github.com/clear-street/clear-street-java/commit/ba66042f673d15e539d21dcec8ca59cd55f981e2))
+* **api:** api update ([0a6aff1](https://github.com/clear-street/clear-street-java/commit/0a6aff1439838a09031f758b2b39afaea2df7e47))
+* **api:** api update ([457c1d7](https://github.com/clear-street/clear-street-java/commit/457c1d74df20eca53640d45d68d02cf26be92ddd))
+* **api:** api update ([929c0f8](https://github.com/clear-street/clear-street-java/commit/929c0f84068d006f9b3ad816cc1e5590db6f8db9))
+* **api:** api update ([6356421](https://github.com/clear-street/clear-street-java/commit/63564214348bcbb950f6427d52cb11d1dc5736fc))
+* **api:** api update ([2f63393](https://github.com/clear-street/clear-street-java/commit/2f63393f8320709d8805c31ba73e8ee5d5419601))
+* **api:** api update ([99400db](https://github.com/clear-street/clear-street-java/commit/99400dbe8dd584f36b33b6d250662fa399c9d3b6))
+* **api:** api update ([3d6d5ab](https://github.com/clear-street/clear-street-java/commit/3d6d5ab6dd15f7c8bc1531bccb27a1a9793a9750))
+* **api:** api update ([e9755c9](https://github.com/clear-street/clear-street-java/commit/e9755c970417260e481f1e0f83552777fabc3ad4))
+* **api:** api update ([afbc4cc](https://github.com/clear-street/clear-street-java/commit/afbc4ccf603557090e34d9c8ce85d42008064c84))
+* **api:** api update ([4435f31](https://github.com/clear-street/clear-street-java/commit/4435f31bd53999dee1ba1470170bd8d39ab2ed75))
+* **api:** api update ([3cb8eec](https://github.com/clear-street/clear-street-java/commit/3cb8eecffa17d006a143666247e4e0965710adad))
+* **api:** api update ([fbf70df](https://github.com/clear-street/clear-street-java/commit/fbf70dfef19774d8e6af47c382d0866b786ea0b2))
+* **api:** api update ([0e09a07](https://github.com/clear-street/clear-street-java/commit/0e09a072ba6b2d4734169355929d8b91f6a270a9))
+* **api:** api update ([e2ddaff](https://github.com/clear-street/clear-street-java/commit/e2ddaff65fc8720fdb04385fea0fef5adf290bd2))
+* **api:** api update ([4e01927](https://github.com/clear-street/clear-street-java/commit/4e019271f0a92b4caf85799c0fe8a4039edec5f1))
+* **api:** api update ([9bc4c8b](https://github.com/clear-street/clear-street-java/commit/9bc4c8b546a3589526541f25f8e987ed83aa35b0))
+* **api:** api update ([b27be7e](https://github.com/clear-street/clear-street-java/commit/b27be7ed6619ad6758374049c03689f92cd304d0))
+* **api:** api update ([41e8452](https://github.com/clear-street/clear-street-java/commit/41e8452dfb42fbb923047fa29d03d01b213adee3))
+* **api:** api update ([9aa0a96](https://github.com/clear-street/clear-street-java/commit/9aa0a960e4dd0b18522dbe55080e11da8c098c08))
+* **api:** api update ([006fcf2](https://github.com/clear-street/clear-street-java/commit/006fcf2befbd77f7bfeb45f04a839afa63763e6c))
+* **api:** api update ([615197a](https://github.com/clear-street/clear-street-java/commit/615197a8c2eb2d1b7cf41a24b18d23900494c631))
+* **api:** api update ([fcef82d](https://github.com/clear-street/clear-street-java/commit/fcef82d039b5c6bb7b50f16f45e4022356a92238))
+* **api:** api update ([f8a8d67](https://github.com/clear-street/clear-street-java/commit/f8a8d67031fd0f332f7123300864f35aa1f9bd18))
+* **api:** api update ([b3524d4](https://github.com/clear-street/clear-street-java/commit/b3524d440072d92f11a660228d50224568fe63a5))
+* **api:** api update ([ad4fdee](https://github.com/clear-street/clear-street-java/commit/ad4fdeeab858de30694e70533c9df67581cd7772))
+* **api:** api update ([baaf3af](https://github.com/clear-street/clear-street-java/commit/baaf3af53e9cbf0b06b1b6e46d85e30f7396994a))
+* **api:** api update ([dab98b4](https://github.com/clear-street/clear-street-java/commit/dab98b491979d6adfeeae3e8c5d1d3988e9c79be))
+* **api:** api update ([9e7caf6](https://github.com/clear-street/clear-street-java/commit/9e7caf6f7b42f52681c27bd6075b310e200918b5))
+* **api:** api update ([b382185](https://github.com/clear-street/clear-street-java/commit/b382185f5e651b8933d9398d80a7c56a4b96b413))
+* **api:** api update ([8f45180](https://github.com/clear-street/clear-street-java/commit/8f4518082165cde883d69b2711426dbd719ad0de))
+* **api:** api update ([2e39797](https://github.com/clear-street/clear-street-java/commit/2e39797c7fe89f9d24c0003055b70d7a2b4ac56e))
+* **api:** api update ([58d0a01](https://github.com/clear-street/clear-street-java/commit/58d0a01a409dd26f9a37311379a62bcd2da18915))
+* **api:** api update ([7019336](https://github.com/clear-street/clear-street-java/commit/70193360b94654f4dc6fdc940332d3c111ab6c0f))
+* **api:** api update ([184c903](https://github.com/clear-street/clear-street-java/commit/184c903c1c3a99b3f953dfd891db1830b3e2f649))
+* **api:** api update ([3343acc](https://github.com/clear-street/clear-street-java/commit/3343acc55b8cd665f3a710728320141eb64a2674))
+* **api:** api update ([59fb6e1](https://github.com/clear-street/clear-street-java/commit/59fb6e1f85cdf39f51457aae50bcdf1f0c9721c6))
+* **api:** api update ([0806954](https://github.com/clear-street/clear-street-java/commit/0806954e5efa9b2dd41f764fe78b750e72ac6da9))
+* **api:** manual updates ([5446c8a](https://github.com/clear-street/clear-street-java/commit/5446c8aad3ba14922f13eca080d9fdb38758cb8e))
+
+
+### Chores
+
+* redact api-key headers in debug logs ([892ec8e](https://github.com/clear-street/clear-street-java/commit/892ec8e866a3b146366e8625a51eaec09b7a1bb1))
+
## 0.2.0 (2026-05-07)
Full Changelog: [v0.1.0...v0.2.0](https://github.com/clear-street/clear-street-java/compare/v0.1.0...v0.2.0)
diff --git a/README.md b/README.md
index a0ac307a..8d2fe49d 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.clear_street.api/clear-street-java/0.2.0)
-[](https://javadoc.io/doc/com.clear_street.api/clear-street-java/0.2.0)
+[](https://central.sonatype.com/artifact/com.clearstreet.api/clear-street-java/0.3.0)
+[](https://javadoc.io/doc/com.clearstreet.api/clear-street-java/0.3.0)
@@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.clear_street.api/clear-street-java/0.2.0).
+Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.clearstreet.api/clear-street-java/0.3.0).
@@ -24,16 +24,16 @@ Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.clear_street.a
### Gradle
```kotlin
-implementation("com.clear_street.api:clear-street-java:0.2.0")
+implementation("com.clearstreet.api:clear-street-java:0.3.0")
```
### Maven
```xml
- com.clear_street.api
+ com.clearstreet.api
clear-street-java
- 0.2.0
+ 0.3.0
```
@@ -46,10 +46,10 @@ This library requires Java 8 or later.
## Usage
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
// Configures using the `clearstreet.baseUrl` system property
@@ -66,8 +66,8 @@ AccountGetAccountsResponse response = client.v1().accounts().getAccounts();
Configure the client using system properties or environment variables:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
// Configures using the `clearstreet.baseUrl` system property
@@ -80,8 +80,8 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
Or manually:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.apiKey("My API Key")
@@ -91,8 +91,8 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
Or using a combination of the two approaches:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
// Configures using the `clearstreet.baseUrl` system property
@@ -119,7 +119,7 @@ System properties take precedence over environment variables.
To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:
```java
-import com.clear_street.api.client.ClearStreetClient;
+import com.clearstreet.api.client.ClearStreetClient;
ClearStreetClient clientWithOptions = client.withOptions(optionsBuilder -> {
optionsBuilder.baseUrl("https://example.com");
@@ -148,10 +148,10 @@ Because each class is immutable, builder modification will _never_ affect alread
The default client is synchronous. To switch to asynchronous execution, call the `async()` method:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
import java.util.concurrent.CompletableFuture;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
@@ -167,10 +167,10 @@ CompletableFuture response = client.async().v1().acc
Or create an asynchronous client from the beginning:
```java
-import com.clear_street.api.client.ClearStreetClientAsync;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClientAsync;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.client.ClearStreetClientAsync;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClientAsync;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
import java.util.concurrent.CompletableFuture;
ClearStreetClientAsync client = ClearStreetOkHttpClientAsync.builder()
@@ -192,10 +192,10 @@ The SDK defines methods that deserialize responses into instances of Java classe
To access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:
```java
-import com.clear_street.api.core.http.Headers;
-import com.clear_street.api.core.http.HttpResponseFor;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.core.http.Headers;
+import com.clearstreet.api.core.http.HttpResponseFor;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
HttpResponseFor response = client.v1().accounts().withRawResponse().getAccounts();
@@ -206,7 +206,7 @@ Headers headers = response.headers();
You can still deserialize the response into an instance of a Java class if needed:
```java
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
AccountGetAccountsResponse parsedResponse = response.parse();
```
@@ -215,26 +215,26 @@ AccountGetAccountsResponse parsedResponse = response.parse();
The SDK throws custom unchecked exception types:
-- [`ClearStreetServiceException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:
+- [`ClearStreetServiceException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:
- | Status | Exception |
- | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
- | 400 | [`BadRequestException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/BadRequestException.kt) |
- | 401 | [`UnauthorizedException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnauthorizedException.kt) |
- | 403 | [`PermissionDeniedException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/PermissionDeniedException.kt) |
- | 404 | [`NotFoundException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/NotFoundException.kt) |
- | 422 | [`UnprocessableEntityException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnprocessableEntityException.kt) |
- | 429 | [`RateLimitException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/RateLimitException.kt) |
- | 5xx | [`InternalServerException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/InternalServerException.kt) |
- | others | [`UnexpectedStatusCodeException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/UnexpectedStatusCodeException.kt) |
+ | Status | Exception |
+ | ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
+ | 400 | [`BadRequestException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/BadRequestException.kt) |
+ | 401 | [`UnauthorizedException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnauthorizedException.kt) |
+ | 403 | [`PermissionDeniedException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/PermissionDeniedException.kt) |
+ | 404 | [`NotFoundException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/NotFoundException.kt) |
+ | 422 | [`UnprocessableEntityException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnprocessableEntityException.kt) |
+ | 429 | [`RateLimitException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/RateLimitException.kt) |
+ | 5xx | [`InternalServerException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/InternalServerException.kt) |
+ | others | [`UnexpectedStatusCodeException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/UnexpectedStatusCodeException.kt) |
-- [`ClearStreetIoException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetIoException.kt): I/O networking errors.
+- [`ClearStreetIoException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetIoException.kt): I/O networking errors.
-- [`ClearStreetRetryableException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetRetryableException.kt): Generic error indicating a failure that could be retried by the client.
+- [`ClearStreetRetryableException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetRetryableException.kt): Generic error indicating a failure that could be retried by the client.
-- [`ClearStreetInvalidDataException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
+- [`ClearStreetInvalidDataException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
-- [`ClearStreetException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
+- [`ClearStreetException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
## Logging
@@ -253,9 +253,9 @@ export CLEAR_STREET_LOG=debug
Or configure the client manually using the `logLevel` method:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
-import com.clear_street.api.core.LogLevel;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.core.LogLevel;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
@@ -276,7 +276,7 @@ The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON seri
The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).
-If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt).
+If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt).
> [!CAUTION]
> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.
@@ -302,8 +302,8 @@ The API may also explicitly instruct the SDK to retry or not retry a request.
To set a custom number of retries, configure the client using the `maxRetries` method:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
@@ -319,7 +319,7 @@ Requests time out after 1 minute by default.
To set a custom timeout, configure the method call using the `timeout` method:
```java
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
AccountGetAccountsResponse response = client.v1().accounts().getAccounts(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
```
@@ -327,8 +327,8 @@ AccountGetAccountsResponse response = client.v1().accounts().getAccounts(Request
Or configure the default for all method calls at the client level:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import java.time.Duration;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
@@ -343,8 +343,8 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
To route requests through a proxy, configure the client using the `proxy` method:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import java.net.InetSocketAddress;
import java.net.Proxy;
@@ -362,9 +362,9 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
-import com.clear_street.api.core.http.ProxyAuthenticator;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.core.http.ProxyAuthenticator;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
@@ -380,8 +380,8 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import java.time.Duration;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
@@ -404,8 +404,8 @@ If both options are unset, OkHttp's default connection pool settings are used.
To configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
@@ -422,12 +422,12 @@ ClearStreetClient client = ClearStreetOkHttpClient.builder()
The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
- .staging()
+ .dev()
.apiKey("My API Key")
.build();
```
@@ -439,10 +439,10 @@ The SDK consists of three artifacts:
- `clear-street-java-core`
- Contains core SDK logic
- Does not depend on [OkHttp](https://square.github.io/okhttp)
- - Exposes [`ClearStreetClient`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClient.kt), [`ClearStreetClientAsync`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsync.kt), [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt), and [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt), all of which can work with any HTTP client
+ - Exposes [`ClearStreetClient`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClient.kt), [`ClearStreetClientAsync`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsync.kt), [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt), and [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt), all of which can work with any HTTP client
- `clear-street-java-client-okhttp`
- Depends on [OkHttp](https://square.github.io/okhttp)
- - Exposes [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt) and [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), which provide a way to construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt) and [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt), respectively, using OkHttp
+ - Exposes [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt) and [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), which provide a way to construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt) and [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt), respectively, using OkHttp
- `clear-street-java`
- Depends on and exposes the APIs of both `clear-street-java-core` and `clear-street-java-client-okhttp`
- Does not have its own logic
@@ -457,16 +457,16 @@ This structure allows replacing the SDK's default HTTP client without pulling in
To use a customized `OkHttpClient`:
1. Replace your [`clear-street-java` dependency](#installation) with `clear-street-java-core`
-2. Copy `clear-street-java-client-okhttp`'s [`OkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/OkHttpClient.kt) class into your code and customize it
-3. Construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt) or [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt), similarly to [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), using your customized client
+2. Copy `clear-street-java-client-okhttp`'s [`OkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/OkHttpClient.kt) class into your code and customize it
+3. Construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt) or [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt), similarly to [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), using your customized client
### Completely custom HTTP client
To use a completely custom HTTP client:
1. Replace your [`clear-street-java` dependency](#installation) with `clear-street-java-core`
-2. Write a class that implements the [`HttpClient`](clear-street-java-core/src/main/kotlin/com/clear_street/api/core/http/HttpClient.kt) interface
-3. Construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientImpl.kt) or [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clear_street/api/client/ClearStreetClientAsyncImpl.kt), similarly to [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), using your new client class
+2. Write a class that implements the [`HttpClient`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/http/HttpClient.kt) interface
+3. Construct [`ClearStreetClientImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientImpl.kt) or [`ClearStreetClientAsyncImpl`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/client/ClearStreetClientAsyncImpl.kt), similarly to [`ClearStreetOkHttpClient`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt) or [`ClearStreetOkHttpClientAsync`](clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt), using your new client class
## Undocumented API functionality
@@ -477,8 +477,8 @@ The SDK is typed for convenient usage of the documented API. However, it also su
To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:
```java
-import com.clear_street.api.core.JsonValue;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.core.JsonValue;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
AccountGetAccountsParams params = AccountGetAccountsParams.builder()
.putAdditionalHeader("Secret-Header", "42")
@@ -492,9 +492,9 @@ These can be accessed on the built object later using the `_additionalHeaders()`
To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class:
```java
-import com.clear_street.api.core.JsonValue;
-import com.clear_street.api.models.v1.accounts.AccountPatchAccountByIdParams;
-import com.clear_street.api.models.v1.accounts.RiskSettings;
+import com.clearstreet.api.core.JsonValue;
+import com.clearstreet.api.models.v1.accounts.AccountPatchAccountByIdParams;
+import com.clearstreet.api.models.v1.accounts.RiskSettings;
AccountPatchAccountByIdParams params = AccountPatchAccountByIdParams.builder()
.risk(RiskSettings.builder()
@@ -505,18 +505,18 @@ AccountPatchAccountByIdParams params = AccountPatchAccountByIdParams.builder()
These properties can be accessed on the nested built object later using the `_additionalProperties()` method.
-To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt) object to its setter:
+To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt) object to its setter:
```java
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
AccountGetAccountsParams params = AccountGetAccountsParams.builder().build();
```
-The most straightforward way to create a [`JsonValue`](clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt) is using its `from(...)` method:
+The most straightforward way to create a [`JsonValue`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt) is using its `from(...)` method:
```java
-import com.clear_street.api.core.JsonValue;
+import com.clearstreet.api.core.JsonValue;
import java.util.List;
import java.util.Map;
@@ -554,14 +554,14 @@ JsonValue complexValue = JsonValue.from(Map.of(
Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.
-To forcibly omit a required parameter or property, pass [`JsonMissing`](clear-street-java-core/src/main/kotlin/com/clear_street/api/core/Values.kt):
+To forcibly omit a required parameter or property, pass [`JsonMissing`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/core/Values.kt):
```java
-import com.clear_street.api.core.JsonMissing;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountByIdParams;
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsParams;
+import com.clearstreet.api.core.JsonMissing;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountBalancesParams;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsParams;
-AccountGetAccountsParams params = AccountGetAccountByIdParams.builder()
+AccountGetAccountsParams params = AccountGetAccountBalancesParams.builder()
.accountId(JsonMissing.of())
.build();
```
@@ -571,7 +571,7 @@ AccountGetAccountsParams params = AccountGetAccountByIdParams.builder()
To access undocumented response properties, call the `_additionalProperties()` method:
```java
-import com.clear_street.api.core.JsonValue;
+import com.clearstreet.api.core.JsonValue;
import java.util.Map;
Map additionalProperties = client.v1().accounts().getAccounts(params)._additionalProperties();
@@ -601,7 +601,7 @@ String result = secretPropertyValue.accept(new JsonValue.Visitor<>() {
To access a property's raw JSON value, which may be undocumented, call its `_` prefixed method:
```java
-import com.clear_street.api.core.JsonField;
+import com.clearstreet.api.core.JsonField;
import java.util.Optional;
JsonField field = client.v1().accounts().getAccounts(params)._field();
@@ -624,14 +624,14 @@ if (field.isMissing()) {
In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.
-By default, the SDK will not throw an exception in this case. It will throw [`ClearStreetInvalidDataException`](clear-street-java-core/src/main/kotlin/com/clear_street/api/errors/ClearStreetInvalidDataException.kt) only if you directly access the property.
+By default, the SDK will not throw an exception in this case. It will throw [`ClearStreetInvalidDataException`](clear-street-java-core/src/main/kotlin/com/clearstreet/api/errors/ClearStreetInvalidDataException.kt) only if you directly access the property.
Validating the response is _not_ forwards compatible with new types from the API for existing fields.
If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:
```java
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
AccountGetAccountsResponse response = client.v1().accounts().getAccounts(params).validate();
```
@@ -639,7 +639,7 @@ AccountGetAccountsResponse response = client.v1().accounts().getAccounts(params)
Or configure the method call to validate the response using the `responseValidation` method:
```java
-import com.clear_street.api.models.v1.accounts.AccountGetAccountsResponse;
+import com.clearstreet.api.models.v1.accounts.AccountGetAccountsResponse;
AccountGetAccountsResponse response = client.v1().accounts().getAccounts(RequestOptions.builder().responseValidation(true).build());
```
@@ -647,8 +647,8 @@ AccountGetAccountsResponse response = client.v1().accounts().getAccounts(Request
Or configure the default for all method calls at the client level:
```java
-import com.clear_street.api.client.ClearStreetClient;
-import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
+import com.clearstreet.api.client.ClearStreetClient;
+import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
diff --git a/build.gradle.kts b/build.gradle.kts
index c96a2d1b..ca6270b1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,5 +1,4 @@
plugins {
- id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "2.0.0"
}
@@ -8,8 +7,8 @@ repositories {
}
allprojects {
- group = "com.clear_street.api"
- version = "0.2.0" // x-release-please-version
+ group = "com.clearstreet.api"
+ version = "0.3.0" // x-release-please-version
}
subprojects {
@@ -34,15 +33,3 @@ tasks.named("dokkaJavadocCollector").configure {
.filter { it.project.name != "clear-street-java" && it.name == "dokkaJavadocJar" }
.forEach { mustRunAfter(it) }
}
-
-nexusPublishing {
- repositories {
- sonatype {
- nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
- snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
-
- username.set(System.getenv("SONATYPE_USERNAME"))
- password.set(System.getenv("SONATYPE_PASSWORD"))
- }
- }
-}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 0b141353..c6dc92ec 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -1,12 +1,15 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.9.20"
+ id("com.vanniktech.maven.publish") version "0.28.0"
}
repositories {
gradlePluginPortal()
+ mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
+ implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
diff --git a/buildSrc/src/main/kotlin/clear-street.java.gradle.kts b/buildSrc/src/main/kotlin/clear-street.java.gradle.kts
index a3cfe28e..8f4f902a 100644
--- a/buildSrc/src/main/kotlin/clear-street.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/clear-street.java.gradle.kts
@@ -8,11 +8,6 @@ repositories {
mavenCentral()
}
-configure {
- withJavadocJar()
- withSourcesJar()
-}
-
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
@@ -27,10 +22,6 @@ tasks.withType().configureEach {
options.release.set(8)
}
-tasks.named("javadocJar") {
- setZip64(true)
-}
-
tasks.named("jar") {
manifest {
attributes(mapOf(
diff --git a/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts b/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts
index b24038d5..f7df7b75 100644
--- a/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/clear-street.publish.gradle.kts
@@ -1,69 +1,72 @@
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.KotlinJvm
+import com.vanniktech.maven.publish.MavenPublishBaseExtension
+import com.vanniktech.maven.publish.SonatypeHost
+
plugins {
- `maven-publish`
- signing
+ id("com.vanniktech.maven.publish")
+}
+
+publishing {
+ repositories {
+ if (project.hasProperty("publishLocal")) {
+ maven {
+ name = "LocalFileSystem"
+ url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
+ }
+ }
+ }
}
-configure {
- publications {
- register("maven") {
- from(components["java"])
+repositories {
+ gradlePluginPortal()
+ mavenCentral()
+}
- pom {
- name.set("Clear Street Trading API")
- description.set("A unified, secure, and high-performance RESTful API for all client interactions\nwith the Active trading platform. This specification provides a single source of\ntruth for the API surface, abstracting the complexity of downstream services\nlike the Order and Execution Management System (OEMS).\n\n### Authentication\n\nAll endpoints require authentication via a JWT Bearer token provided in the\n`Authorization` header.\n\n### Response Structure\n\nAll responses, both for success and error, adhere to a standard envelope\nstructure:\n\n- `data`: Contains the response payload on success, or `null` on error.\n- `error`: Contains a structured error object on failure, or `null` on success.\n- `metadata`: Contains the `request_id` and pagination information.\n\n### WebSockets\n\nReal-time market data is available via WebSocket connections, which are not\nformally described in this OpenAPI specification. The following operations are\navailable:\n\n- `market-data-l1-subscribe`: To start receiving L1 market data updates for a\n set of symbols.\n- `market-data-l1-unsubscribe`: To stop receiving L1 market data updates.")
- url.set("https://www.github.com/clear-street/clear-street-java")
+extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
+extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
+extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
- licenses {
- license {
- name.set("Apache-2.0")
- }
- }
+configure {
+ if (!project.hasProperty("publishLocal")) {
+ signAllPublications()
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
+ }
- developers {
- developer {
- name.set("Clear Street")
- email.set("support@clearstreet.io")
- }
- }
+ coordinates(project.group.toString(), project.name, project.version.toString())
+ configure(
+ KotlinJvm(
+ javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
+ sourcesJar = true,
+ )
+ )
- scm {
- connection.set("scm:git:git://github.com/clear-street/clear-street-java.git")
- developerConnection.set("scm:git:git://github.com/clear-street/clear-street-java.git")
- url.set("https://github.com/clear-street/clear-street-java")
- }
+ pom {
+ name.set("Clear Street Trading API")
+ description.set("A unified, secure, and high-performance RESTful API for all client interactions\nwith the Active trading platform. This specification provides a single source of\ntruth for the API surface, covering order management, trade execution, market\ndata, and account services.\n\n### Authentication\n\nAll endpoints require authentication via a JWT Bearer token provided in the\n`Authorization` header.\n\n### Response Structure\n\nAll responses, both for success and error, adhere to a standard envelope\nstructure:\n\n- `data`: Contains the response payload on success, or `null` on error.\n- `error`: Contains a structured error object on failure, or `null` on success.\n- `metadata`: Contains the `request_id` and pagination information.\n\n### WebSockets\n\nReal-time market data is available via WebSocket connections, which are not\nformally described in this OpenAPI specification. The following operations are\navailable:\n\n- `market-data-l1-subscribe`: To start receiving L1 market data updates for a\n set of symbols.\n- `market-data-l1-unsubscribe`: To stop receiving L1 market data updates.")
+ url.set("https://www.github.com/clear-street/clear-street-java")
- versionMapping {
- allVariants {
- fromResolutionResult()
- }
- }
+ licenses {
+ license {
+ name.set("Apache-2.0")
}
}
- }
- repositories {
- if (project.hasProperty("publishLocal")) {
- maven {
- name = "LocalFileSystem"
- url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
+
+ developers {
+ developer {
+ name.set("Clear Street")
+ email.set("support@clearstreet.io")
}
}
- }
-}
-signing {
- val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
- val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
- val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
- if (signingKey != null && signingPassword != null) {
- useInMemoryPgpKeys(
- signingKeyId,
- signingKey,
- signingPassword,
- )
- sign(publishing.publications["maven"])
+ scm {
+ connection.set("scm:git:git://github.com/clear-street/clear-street-java.git")
+ developerConnection.set("scm:git:git://github.com/clear-street/clear-street-java.git")
+ url.set("https://github.com/clear-street/clear-street-java")
+ }
}
}
-tasks.named("publish") {
- dependsOn(":closeAndReleaseSonatypeStagingRepository")
+tasks.withType().configureEach {
+ isZip64 = true
}
diff --git a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt
similarity index 94%
rename from clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt
rename to clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt
index a9a07ffa..e5c5060d 100644
--- a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClient.kt
+++ b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClient.kt
@@ -1,18 +1,18 @@
// File generated from our OpenAPI spec by Stainless.
-package com.clear_street.api.client.okhttp
-
-import com.clear_street.api.client.ClearStreetClient
-import com.clear_street.api.client.ClearStreetClientImpl
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.LogLevel
-import com.clear_street.api.core.Sleeper
-import com.clear_street.api.core.Timeout
-import com.clear_street.api.core.http.Headers
-import com.clear_street.api.core.http.HttpClient
-import com.clear_street.api.core.http.ProxyAuthenticator
-import com.clear_street.api.core.http.QueryParams
-import com.clear_street.api.core.jsonMapper
+package com.clearstreet.api.client.okhttp
+
+import com.clearstreet.api.client.ClearStreetClient
+import com.clearstreet.api.client.ClearStreetClientImpl
+import com.clearstreet.api.core.ClientOptions
+import com.clearstreet.api.core.LogLevel
+import com.clearstreet.api.core.Sleeper
+import com.clearstreet.api.core.Timeout
+import com.clearstreet.api.core.http.Headers
+import com.clearstreet.api.core.http.HttpClient
+import com.clearstreet.api.core.http.ProxyAuthenticator
+import com.clearstreet.api.core.http.QueryParams
+import com.clearstreet.api.core.jsonMapper
import com.fasterxml.jackson.databind.json.JsonMapper
import java.net.Proxy
import java.time.Clock
@@ -196,7 +196,7 @@ class ClearStreetOkHttpClient private constructor() {
/**
* The Jackson JSON mapper to use for serializing and deserializing JSON.
*
- * Defaults to [com.clear_street.api.core.jsonMapper]. The default is usually sufficient and
+ * Defaults to [com.clearstreet.api.core.jsonMapper]. The default is usually sufficient and
* rarely needs to be overridden.
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
@@ -227,15 +227,15 @@ class ClearStreetOkHttpClient private constructor() {
* Defaults to the production environment: `https://api.clearstreet.com`.
*
* The following other environments, with dedicated builder methods, are available:
- * - staging: `https://oems-api-gw.dev-public.clst.co`
+ * - dev: `https://api-dev.clearstreet.com`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }
/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
- /** Sets [baseUrl] to `https://oems-api-gw.dev-public.clst.co`. */
- fun staging() = apply { clientOptions.staging() }
+ /** Sets [baseUrl] to `https://api-dev.clearstreet.com`. */
+ fun dev() = apply { clientOptions.dev() }
/**
* Whether to call `validate` on every response before returning it.
diff --git a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt
similarity index 94%
rename from clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt
rename to clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt
index 5ed081c5..8befda25 100644
--- a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/ClearStreetOkHttpClientAsync.kt
+++ b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/ClearStreetOkHttpClientAsync.kt
@@ -1,18 +1,18 @@
// File generated from our OpenAPI spec by Stainless.
-package com.clear_street.api.client.okhttp
-
-import com.clear_street.api.client.ClearStreetClientAsync
-import com.clear_street.api.client.ClearStreetClientAsyncImpl
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.LogLevel
-import com.clear_street.api.core.Sleeper
-import com.clear_street.api.core.Timeout
-import com.clear_street.api.core.http.Headers
-import com.clear_street.api.core.http.HttpClient
-import com.clear_street.api.core.http.ProxyAuthenticator
-import com.clear_street.api.core.http.QueryParams
-import com.clear_street.api.core.jsonMapper
+package com.clearstreet.api.client.okhttp
+
+import com.clearstreet.api.client.ClearStreetClientAsync
+import com.clearstreet.api.client.ClearStreetClientAsyncImpl
+import com.clearstreet.api.core.ClientOptions
+import com.clearstreet.api.core.LogLevel
+import com.clearstreet.api.core.Sleeper
+import com.clearstreet.api.core.Timeout
+import com.clearstreet.api.core.http.Headers
+import com.clearstreet.api.core.http.HttpClient
+import com.clearstreet.api.core.http.ProxyAuthenticator
+import com.clearstreet.api.core.http.QueryParams
+import com.clearstreet.api.core.jsonMapper
import com.fasterxml.jackson.databind.json.JsonMapper
import java.net.Proxy
import java.time.Clock
@@ -196,7 +196,7 @@ class ClearStreetOkHttpClientAsync private constructor() {
/**
* The Jackson JSON mapper to use for serializing and deserializing JSON.
*
- * Defaults to [com.clear_street.api.core.jsonMapper]. The default is usually sufficient and
+ * Defaults to [com.clearstreet.api.core.jsonMapper]. The default is usually sufficient and
* rarely needs to be overridden.
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
@@ -227,15 +227,15 @@ class ClearStreetOkHttpClientAsync private constructor() {
* Defaults to the production environment: `https://api.clearstreet.com`.
*
* The following other environments, with dedicated builder methods, are available:
- * - staging: `https://oems-api-gw.dev-public.clst.co`
+ * - dev: `https://api-dev.clearstreet.com`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }
/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
- /** Sets [baseUrl] to `https://oems-api-gw.dev-public.clst.co`. */
- fun staging() = apply { clientOptions.staging() }
+ /** Sets [baseUrl] to `https://api-dev.clearstreet.com`. */
+ fun dev() = apply { clientOptions.dev() }
/**
* Whether to call `validate` on every response before returning it.
diff --git a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/OkHttpClient.kt b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/OkHttpClient.kt
similarity index 95%
rename from clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/OkHttpClient.kt
rename to clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/OkHttpClient.kt
index 647578cd..c5405037 100644
--- a/clear-street-java-client-okhttp/src/main/kotlin/com/clear_street/api/client/okhttp/OkHttpClient.kt
+++ b/clear-street-java-client-okhttp/src/main/kotlin/com/clearstreet/api/client/okhttp/OkHttpClient.kt
@@ -1,15 +1,15 @@
-package com.clear_street.api.client.okhttp
-
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.Timeout
-import com.clear_street.api.core.http.Headers
-import com.clear_street.api.core.http.HttpClient
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpRequestBody
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.ProxyAuthenticator
-import com.clear_street.api.errors.ClearStreetIoException
+package com.clearstreet.api.client.okhttp
+
+import com.clearstreet.api.core.RequestOptions
+import com.clearstreet.api.core.Timeout
+import com.clearstreet.api.core.http.Headers
+import com.clearstreet.api.core.http.HttpClient
+import com.clearstreet.api.core.http.HttpMethod
+import com.clearstreet.api.core.http.HttpRequest
+import com.clearstreet.api.core.http.HttpRequestBody
+import com.clearstreet.api.core.http.HttpResponse
+import com.clearstreet.api.core.http.ProxyAuthenticator
+import com.clearstreet.api.errors.ClearStreetIoException
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
diff --git a/clear-street-java-client-okhttp/src/test/kotlin/com/clear_street/api/client/okhttp/OkHttpClientTest.kt b/clear-street-java-client-okhttp/src/test/kotlin/com/clearstreet/api/client/okhttp/OkHttpClientTest.kt
similarity index 90%
rename from clear-street-java-client-okhttp/src/test/kotlin/com/clear_street/api/client/okhttp/OkHttpClientTest.kt
rename to clear-street-java-client-okhttp/src/test/kotlin/com/clearstreet/api/client/okhttp/OkHttpClientTest.kt
index 8ac4d1f2..037b5fd7 100644
--- a/clear-street-java-client-okhttp/src/test/kotlin/com/clear_street/api/client/okhttp/OkHttpClientTest.kt
+++ b/clear-street-java-client-okhttp/src/test/kotlin/com/clearstreet/api/client/okhttp/OkHttpClientTest.kt
@@ -1,7 +1,7 @@
-package com.clear_street.api.client.okhttp
+package com.clearstreet.api.client.okhttp
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
+import com.clearstreet.api.core.http.HttpMethod
+import com.clearstreet.api.core.http.HttpRequest
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo
import com.github.tomakehurst.wiremock.junit5.WireMockTest
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponse.kt
deleted file mode 100644
index 2f822c1b..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/WatchlistDeleteWatchlistResponse.kt
+++ /dev/null
@@ -1,129 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.models.v1.watchlists
-
-import com.clear_street.api.core.ExcludeMissing
-import com.clear_street.api.core.JsonValue
-import com.clear_street.api.errors.ClearStreetInvalidDataException
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import java.util.Collections
-import java.util.Objects
-
-class WatchlistDeleteWatchlistResponse
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(private val additionalProperties: MutableMap) {
-
- @JsonCreator private constructor() : this(mutableMapOf())
-
- @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
- * [WatchlistDeleteWatchlistResponse].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [WatchlistDeleteWatchlistResponse]. */
- class Builder internal constructor() {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(watchlistDeleteWatchlistResponse: WatchlistDeleteWatchlistResponse) =
- apply {
- additionalProperties =
- watchlistDeleteWatchlistResponse.additionalProperties.toMutableMap()
- }
-
- 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 [WatchlistDeleteWatchlistResponse].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): WatchlistDeleteWatchlistResponse =
- WatchlistDeleteWatchlistResponse(additionalProperties.toMutableMap())
- }
-
- private var validated: Boolean = false
-
- /**
- * Validates that the types of all values in this object match their expected types recursively.
- *
- * This method is _not_ forwards compatible with new types from the API for existing fields.
- *
- * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): WatchlistDeleteWatchlistResponse = apply {
- if (validated) {
- return@apply
- }
-
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: ClearStreetInvalidDataException) {
- 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 = 0
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is WatchlistDeleteWatchlistResponse &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "WatchlistDeleteWatchlistResponse{additionalProperties=$additionalProperties}"
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponse.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponse.kt
deleted file mode 100644
index 5271b20f..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/models/v1/watchlists/items/ItemDeleteWatchlistItemResponse.kt
+++ /dev/null
@@ -1,129 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.models.v1.watchlists.items
-
-import com.clear_street.api.core.ExcludeMissing
-import com.clear_street.api.core.JsonValue
-import com.clear_street.api.errors.ClearStreetInvalidDataException
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import java.util.Collections
-import java.util.Objects
-
-class ItemDeleteWatchlistItemResponse
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(private val additionalProperties: MutableMap) {
-
- @JsonCreator private constructor() : this(mutableMapOf())
-
- @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
- * [ItemDeleteWatchlistItemResponse].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [ItemDeleteWatchlistItemResponse]. */
- class Builder internal constructor() {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(itemDeleteWatchlistItemResponse: ItemDeleteWatchlistItemResponse) =
- apply {
- additionalProperties =
- itemDeleteWatchlistItemResponse.additionalProperties.toMutableMap()
- }
-
- 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 [ItemDeleteWatchlistItemResponse].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): ItemDeleteWatchlistItemResponse =
- ItemDeleteWatchlistItemResponse(additionalProperties.toMutableMap())
- }
-
- private var validated: Boolean = false
-
- /**
- * Validates that the types of all values in this object match their expected types recursively.
- *
- * This method is _not_ forwards compatible with new types from the API for existing fields.
- *
- * @throws ClearStreetInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): ItemDeleteWatchlistItemResponse = apply {
- if (validated) {
- return@apply
- }
-
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: ClearStreetInvalidDataException) {
- 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 = 0
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is ItemDeleteWatchlistItemResponse &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "ItemDeleteWatchlistItemResponse{additionalProperties=$additionalProperties}"
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsync.kt
deleted file mode 100644
index 37453a2a..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsync.kt
+++ /dev/null
@@ -1,135 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.models.v1.V1WebsocketHandlerParams
-import com.clear_street.api.services.async.v1.AccountServiceAsync
-import com.clear_street.api.services.async.v1.CalendarServiceAsync
-import com.clear_street.api.services.async.v1.ClockServiceAsync
-import com.clear_street.api.services.async.v1.InstrumentServiceAsync
-import com.clear_street.api.services.async.v1.MarketDataServiceAsync
-import com.clear_street.api.services.async.v1.NewsServiceAsync
-import com.clear_street.api.services.async.v1.OmniAiServiceAsync
-import com.clear_street.api.services.async.v1.VersionServiceAsync
-import com.clear_street.api.services.async.v1.WatchlistServiceAsync
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Active Websocket. */
-interface V1ServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): V1ServiceAsync
-
- /** Manage trading accounts, balances, and portfolio history. */
- fun accounts(): AccountServiceAsync
-
- fun calendars(): CalendarServiceAsync
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- fun clock(): ClockServiceAsync
-
- /** Retrieve details and lists of tradable instruments. */
- fun instruments(): InstrumentServiceAsync
-
- fun marketData(): MarketDataServiceAsync
-
- /** Retrieve market news and related instrument metadata. */
- fun news(): NewsServiceAsync
-
- fun omniAi(): OmniAiServiceAsync
-
- /** Endpoints for API service metadata. */
- fun version(): VersionServiceAsync
-
- /** Create and manage watchlists. */
- fun watchlists(): WatchlistServiceAsync
-
- /** Upgrade the HTTP connection to a WebSocket and echo incoming messages. */
- fun websocketHandler(): CompletableFuture =
- websocketHandler(V1WebsocketHandlerParams.none())
-
- /** @see websocketHandler */
- fun websocketHandler(
- params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see websocketHandler */
- fun websocketHandler(
- params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none()
- ): CompletableFuture = websocketHandler(params, RequestOptions.none())
-
- /** @see websocketHandler */
- fun websocketHandler(requestOptions: RequestOptions): CompletableFuture =
- websocketHandler(V1WebsocketHandlerParams.none(), requestOptions)
-
- /** A view of [V1ServiceAsync] that provides access to raw HTTP responses for each method. */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): V1ServiceAsync.WithRawResponse
-
- /** Manage trading accounts, balances, and portfolio history. */
- fun accounts(): AccountServiceAsync.WithRawResponse
-
- fun calendars(): CalendarServiceAsync.WithRawResponse
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- fun clock(): ClockServiceAsync.WithRawResponse
-
- /** Retrieve details and lists of tradable instruments. */
- fun instruments(): InstrumentServiceAsync.WithRawResponse
-
- fun marketData(): MarketDataServiceAsync.WithRawResponse
-
- /** Retrieve market news and related instrument metadata. */
- fun news(): NewsServiceAsync.WithRawResponse
-
- fun omniAi(): OmniAiServiceAsync.WithRawResponse
-
- /** Endpoints for API service metadata. */
- fun version(): VersionServiceAsync.WithRawResponse
-
- /** Create and manage watchlists. */
- fun watchlists(): WatchlistServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/ws`, but is otherwise the same as
- * [V1ServiceAsync.websocketHandler].
- */
- fun websocketHandler(): CompletableFuture =
- websocketHandler(V1WebsocketHandlerParams.none())
-
- /** @see websocketHandler */
- fun websocketHandler(
- params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see websocketHandler */
- fun websocketHandler(
- params: V1WebsocketHandlerParams = V1WebsocketHandlerParams.none()
- ): CompletableFuture = websocketHandler(params, RequestOptions.none())
-
- /** @see websocketHandler */
- fun websocketHandler(requestOptions: RequestOptions): CompletableFuture =
- websocketHandler(V1WebsocketHandlerParams.none(), requestOptions)
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsyncImpl.kt
deleted file mode 100644
index bd3b66e2..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/V1ServiceAsyncImpl.kt
+++ /dev/null
@@ -1,202 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.handlers.emptyHandler
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.V1WebsocketHandlerParams
-import com.clear_street.api.services.async.v1.AccountServiceAsync
-import com.clear_street.api.services.async.v1.AccountServiceAsyncImpl
-import com.clear_street.api.services.async.v1.CalendarServiceAsync
-import com.clear_street.api.services.async.v1.CalendarServiceAsyncImpl
-import com.clear_street.api.services.async.v1.ClockServiceAsync
-import com.clear_street.api.services.async.v1.ClockServiceAsyncImpl
-import com.clear_street.api.services.async.v1.InstrumentServiceAsync
-import com.clear_street.api.services.async.v1.InstrumentServiceAsyncImpl
-import com.clear_street.api.services.async.v1.MarketDataServiceAsync
-import com.clear_street.api.services.async.v1.MarketDataServiceAsyncImpl
-import com.clear_street.api.services.async.v1.NewsServiceAsync
-import com.clear_street.api.services.async.v1.NewsServiceAsyncImpl
-import com.clear_street.api.services.async.v1.OmniAiServiceAsync
-import com.clear_street.api.services.async.v1.OmniAiServiceAsyncImpl
-import com.clear_street.api.services.async.v1.VersionServiceAsync
-import com.clear_street.api.services.async.v1.VersionServiceAsyncImpl
-import com.clear_street.api.services.async.v1.WatchlistServiceAsync
-import com.clear_street.api.services.async.v1.WatchlistServiceAsyncImpl
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Active Websocket. */
-class V1ServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- V1ServiceAsync {
-
- private val withRawResponse: V1ServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- private val accounts: AccountServiceAsync by lazy { AccountServiceAsyncImpl(clientOptions) }
-
- private val calendars: CalendarServiceAsync by lazy { CalendarServiceAsyncImpl(clientOptions) }
-
- private val clock: ClockServiceAsync by lazy { ClockServiceAsyncImpl(clientOptions) }
-
- private val instruments: InstrumentServiceAsync by lazy {
- InstrumentServiceAsyncImpl(clientOptions)
- }
-
- private val marketData: MarketDataServiceAsync by lazy {
- MarketDataServiceAsyncImpl(clientOptions)
- }
-
- private val news: NewsServiceAsync by lazy { NewsServiceAsyncImpl(clientOptions) }
-
- private val omniAi: OmniAiServiceAsync by lazy { OmniAiServiceAsyncImpl(clientOptions) }
-
- private val version: VersionServiceAsync by lazy { VersionServiceAsyncImpl(clientOptions) }
-
- private val watchlists: WatchlistServiceAsync by lazy {
- WatchlistServiceAsyncImpl(clientOptions)
- }
-
- override fun withRawResponse(): V1ServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): V1ServiceAsync =
- V1ServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- /** Manage trading accounts, balances, and portfolio history. */
- override fun accounts(): AccountServiceAsync = accounts
-
- override fun calendars(): CalendarServiceAsync = calendars
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- override fun clock(): ClockServiceAsync = clock
-
- /** Retrieve details and lists of tradable instruments. */
- override fun instruments(): InstrumentServiceAsync = instruments
-
- override fun marketData(): MarketDataServiceAsync = marketData
-
- /** Retrieve market news and related instrument metadata. */
- override fun news(): NewsServiceAsync = news
-
- override fun omniAi(): OmniAiServiceAsync = omniAi
-
- /** Endpoints for API service metadata. */
- override fun version(): VersionServiceAsync = version
-
- /** Create and manage watchlists. */
- override fun watchlists(): WatchlistServiceAsync = watchlists
-
- override fun websocketHandler(
- params: V1WebsocketHandlerParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/ws
- withRawResponse().websocketHandler(params, requestOptions).thenAccept {}
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- V1ServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- private val accounts: AccountServiceAsync.WithRawResponse by lazy {
- AccountServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val calendars: CalendarServiceAsync.WithRawResponse by lazy {
- CalendarServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val clock: ClockServiceAsync.WithRawResponse by lazy {
- ClockServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val instruments: InstrumentServiceAsync.WithRawResponse by lazy {
- InstrumentServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val marketData: MarketDataServiceAsync.WithRawResponse by lazy {
- MarketDataServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val news: NewsServiceAsync.WithRawResponse by lazy {
- NewsServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val omniAi: OmniAiServiceAsync.WithRawResponse by lazy {
- OmniAiServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val version: VersionServiceAsync.WithRawResponse by lazy {
- VersionServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val watchlists: WatchlistServiceAsync.WithRawResponse by lazy {
- WatchlistServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- override fun withOptions(
- modifier: Consumer
- ): V1ServiceAsync.WithRawResponse =
- V1ServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- /** Manage trading accounts, balances, and portfolio history. */
- override fun accounts(): AccountServiceAsync.WithRawResponse = accounts
-
- override fun calendars(): CalendarServiceAsync.WithRawResponse = calendars
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- override fun clock(): ClockServiceAsync.WithRawResponse = clock
-
- /** Retrieve details and lists of tradable instruments. */
- override fun instruments(): InstrumentServiceAsync.WithRawResponse = instruments
-
- override fun marketData(): MarketDataServiceAsync.WithRawResponse = marketData
-
- /** Retrieve market news and related instrument metadata. */
- override fun news(): NewsServiceAsync.WithRawResponse = news
-
- override fun omniAi(): OmniAiServiceAsync.WithRawResponse = omniAi
-
- /** Endpoints for API service metadata. */
- override fun version(): VersionServiceAsync.WithRawResponse = version
-
- /** Create and manage watchlists. */
- override fun watchlists(): WatchlistServiceAsync.WithRawResponse = watchlists
-
- private val websocketHandlerHandler: Handler = emptyHandler()
-
- override fun websocketHandler(
- params: V1WebsocketHandlerParams,
- requestOptions: RequestOptions,
- ): CompletableFuture {
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "ws")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response.use { websocketHandlerHandler.handle(it) }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsync.kt
deleted file mode 100644
index 99b696a8..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsync.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.services.async.v1.calendars.MarketHourServiceAsync
-import java.util.function.Consumer
-
-interface CalendarServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): CalendarServiceAsync
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- fun marketHours(): MarketHourServiceAsync
-
- /**
- * A view of [CalendarServiceAsync] that provides access to raw HTTP responses for each method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): CalendarServiceAsync.WithRawResponse
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- fun marketHours(): MarketHourServiceAsync.WithRawResponse
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncImpl.kt
deleted file mode 100644
index 89470f9c..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/CalendarServiceAsyncImpl.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.services.async.v1.calendars.MarketHourServiceAsync
-import com.clear_street.api.services.async.v1.calendars.MarketHourServiceAsyncImpl
-import java.util.function.Consumer
-
-class CalendarServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- CalendarServiceAsync {
-
- private val withRawResponse: CalendarServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- private val marketHours: MarketHourServiceAsync by lazy {
- MarketHourServiceAsyncImpl(clientOptions)
- }
-
- override fun withRawResponse(): CalendarServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): CalendarServiceAsync =
- CalendarServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- override fun marketHours(): MarketHourServiceAsync = marketHours
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- CalendarServiceAsync.WithRawResponse {
-
- private val marketHours: MarketHourServiceAsync.WithRawResponse by lazy {
- MarketHourServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- override fun withOptions(
- modifier: Consumer
- ): CalendarServiceAsync.WithRawResponse =
- CalendarServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- /** Access financial calendars for events like earnings, dividends, and splits. */
- override fun marketHours(): MarketHourServiceAsync.WithRawResponse = marketHours
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsync.kt
deleted file mode 100644
index d89785c9..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsync.kt
+++ /dev/null
@@ -1,83 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.clock.ClockGetClockParams
-import com.clear_street.api.models.v1.clock.ClockGetClockResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Access financial calendars for events like earnings, dividends, and splits. */
-interface ClockServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): ClockServiceAsync
-
- /** Returns the current server time in UTC. */
- fun getClock(): CompletableFuture = getClock(ClockGetClockParams.none())
-
- /** @see getClock */
- fun getClock(
- params: ClockGetClockParams = ClockGetClockParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getClock */
- fun getClock(
- params: ClockGetClockParams = ClockGetClockParams.none()
- ): CompletableFuture = getClock(params, RequestOptions.none())
-
- /** @see getClock */
- fun getClock(requestOptions: RequestOptions): CompletableFuture =
- getClock(ClockGetClockParams.none(), requestOptions)
-
- /** A view of [ClockServiceAsync] that provides access to raw HTTP responses for each method. */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): ClockServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/clock`, but is otherwise the same as
- * [ClockServiceAsync.getClock].
- */
- fun getClock(): CompletableFuture> =
- getClock(ClockGetClockParams.none())
-
- /** @see getClock */
- fun getClock(
- params: ClockGetClockParams = ClockGetClockParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getClock */
- fun getClock(
- params: ClockGetClockParams = ClockGetClockParams.none()
- ): CompletableFuture> =
- getClock(params, RequestOptions.none())
-
- /** @see getClock */
- fun getClock(
- requestOptions: RequestOptions
- ): CompletableFuture> =
- getClock(ClockGetClockParams.none(), requestOptions)
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncImpl.kt
deleted file mode 100644
index 18c1a65c..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/ClockServiceAsyncImpl.kt
+++ /dev/null
@@ -1,85 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.clock.ClockGetClockParams
-import com.clear_street.api.models.v1.clock.ClockGetClockResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Access financial calendars for events like earnings, dividends, and splits. */
-class ClockServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- ClockServiceAsync {
-
- private val withRawResponse: ClockServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): ClockServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): ClockServiceAsync =
- ClockServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun getClock(
- params: ClockGetClockParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/clock
- withRawResponse().getClock(params, requestOptions).thenApply { it.parse() }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- ClockServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): ClockServiceAsync.WithRawResponse =
- ClockServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val getClockHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getClock(
- params: ClockGetClockParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "clock")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getClockHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsync.kt
deleted file mode 100644
index d9b8d5b7..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsync.kt
+++ /dev/null
@@ -1,51 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.services.async.v1.marketdata.DailySummaryServiceAsync
-import com.clear_street.api.services.async.v1.marketdata.SnapshotServiceAsync
-import java.util.function.Consumer
-
-interface MarketDataServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): MarketDataServiceAsync
-
- /** Real-time market data snapshots. */
- fun dailySummary(): DailySummaryServiceAsync
-
- /** Real-time market data snapshots. */
- fun snapshot(): SnapshotServiceAsync
-
- /**
- * A view of [MarketDataServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): MarketDataServiceAsync.WithRawResponse
-
- /** Real-time market data snapshots. */
- fun dailySummary(): DailySummaryServiceAsync.WithRawResponse
-
- /** Real-time market data snapshots. */
- fun snapshot(): SnapshotServiceAsync.WithRawResponse
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsyncImpl.kt
deleted file mode 100644
index cdf2fda2..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/MarketDataServiceAsyncImpl.kt
+++ /dev/null
@@ -1,60 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.services.async.v1.marketdata.DailySummaryServiceAsync
-import com.clear_street.api.services.async.v1.marketdata.DailySummaryServiceAsyncImpl
-import com.clear_street.api.services.async.v1.marketdata.SnapshotServiceAsync
-import com.clear_street.api.services.async.v1.marketdata.SnapshotServiceAsyncImpl
-import java.util.function.Consumer
-
-class MarketDataServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- MarketDataServiceAsync {
-
- private val withRawResponse: MarketDataServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- private val dailySummary: DailySummaryServiceAsync by lazy {
- DailySummaryServiceAsyncImpl(clientOptions)
- }
-
- private val snapshot: SnapshotServiceAsync by lazy { SnapshotServiceAsyncImpl(clientOptions) }
-
- override fun withRawResponse(): MarketDataServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): MarketDataServiceAsync =
- MarketDataServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- /** Real-time market data snapshots. */
- override fun dailySummary(): DailySummaryServiceAsync = dailySummary
-
- /** Real-time market data snapshots. */
- override fun snapshot(): SnapshotServiceAsync = snapshot
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- MarketDataServiceAsync.WithRawResponse {
-
- private val dailySummary: DailySummaryServiceAsync.WithRawResponse by lazy {
- DailySummaryServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- private val snapshot: SnapshotServiceAsync.WithRawResponse by lazy {
- SnapshotServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- override fun withOptions(
- modifier: Consumer
- ): MarketDataServiceAsync.WithRawResponse =
- MarketDataServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- /** Real-time market data snapshots. */
- override fun dailySummary(): DailySummaryServiceAsync.WithRawResponse = dailySummary
-
- /** Real-time market data snapshots. */
- override fun snapshot(): SnapshotServiceAsync.WithRawResponse = snapshot
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsync.kt
deleted file mode 100644
index 11c7c979..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/VersionServiceAsync.kt
+++ /dev/null
@@ -1,86 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.version.VersionGetVersionParams
-import com.clear_street.api.models.v1.version.VersionGetVersionResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Endpoints for API service metadata. */
-interface VersionServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): VersionServiceAsync
-
- /** Returns the current version string for this API endpoint. */
- fun getVersion(): CompletableFuture =
- getVersion(VersionGetVersionParams.none())
-
- /** @see getVersion */
- fun getVersion(
- params: VersionGetVersionParams = VersionGetVersionParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getVersion */
- fun getVersion(
- params: VersionGetVersionParams = VersionGetVersionParams.none()
- ): CompletableFuture = getVersion(params, RequestOptions.none())
-
- /** @see getVersion */
- fun getVersion(requestOptions: RequestOptions): CompletableFuture =
- getVersion(VersionGetVersionParams.none(), requestOptions)
-
- /**
- * A view of [VersionServiceAsync] that provides access to raw HTTP responses for each method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): VersionServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/version`, but is otherwise the same as
- * [VersionServiceAsync.getVersion].
- */
- fun getVersion(): CompletableFuture> =
- getVersion(VersionGetVersionParams.none())
-
- /** @see getVersion */
- fun getVersion(
- params: VersionGetVersionParams = VersionGetVersionParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getVersion */
- fun getVersion(
- params: VersionGetVersionParams = VersionGetVersionParams.none()
- ): CompletableFuture> =
- getVersion(params, RequestOptions.none())
-
- /** @see getVersion */
- fun getVersion(
- requestOptions: RequestOptions
- ): CompletableFuture> =
- getVersion(VersionGetVersionParams.none(), requestOptions)
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsync.kt
deleted file mode 100644
index 7b059afe..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsync.kt
+++ /dev/null
@@ -1,123 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesParams
-import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Manage trading accounts, balances, and portfolio history. */
-interface BalanceServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): BalanceServiceAsync
-
- /** Fetch account balance information */
- fun getAccountBalances(accountId: Long): CompletableFuture =
- getAccountBalances(accountId, BalanceGetAccountBalancesParams.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(),
- ): CompletableFuture =
- getAccountBalances(accountId, params, RequestOptions.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- params: BalanceGetAccountBalancesParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- params: BalanceGetAccountBalancesParams
- ): CompletableFuture =
- getAccountBalances(params, RequestOptions.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- getAccountBalances(accountId, BalanceGetAccountBalancesParams.none(), requestOptions)
-
- /**
- * A view of [BalanceServiceAsync] that provides access to raw HTTP responses for each method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): BalanceServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/accounts/{account_id}/balances`, but is
- * otherwise the same as [BalanceServiceAsync.getAccountBalances].
- */
- fun getAccountBalances(
- accountId: Long
- ): CompletableFuture> =
- getAccountBalances(accountId, BalanceGetAccountBalancesParams.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- getAccountBalances(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- params: BalanceGetAccountBalancesParams = BalanceGetAccountBalancesParams.none(),
- ): CompletableFuture> =
- getAccountBalances(accountId, params, RequestOptions.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- params: BalanceGetAccountBalancesParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- params: BalanceGetAccountBalancesParams
- ): CompletableFuture> =
- getAccountBalances(params, RequestOptions.none())
-
- /** @see getAccountBalances */
- fun getAccountBalances(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture> =
- getAccountBalances(accountId, BalanceGetAccountBalancesParams.none(), requestOptions)
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncImpl.kt
deleted file mode 100644
index 955bb0ab..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/BalanceServiceAsyncImpl.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.checkRequired
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesParams
-import com.clear_street.api.models.v1.accounts.balances.BalanceGetAccountBalancesResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-import kotlin.jvm.optionals.getOrNull
-
-/** Manage trading accounts, balances, and portfolio history. */
-class BalanceServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- BalanceServiceAsync {
-
- private val withRawResponse: BalanceServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): BalanceServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): BalanceServiceAsync =
- BalanceServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun getAccountBalances(
- params: BalanceGetAccountBalancesParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/accounts/{account_id}/balances
- withRawResponse().getAccountBalances(params, requestOptions).thenApply { it.parse() }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- BalanceServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): BalanceServiceAsync.WithRawResponse =
- BalanceServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val getAccountBalancesHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getAccountBalances(
- params: BalanceGetAccountBalancesParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "accounts", params._pathParam(0), "balances")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getAccountBalancesHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsync.kt
deleted file mode 100644
index 9693a964..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsync.kt
+++ /dev/null
@@ -1,100 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryParams
-import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Manage trading accounts, balances, and portfolio history. */
-interface PortfolioHistoryServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): PortfolioHistoryServiceAsync
-
- /** Retrieves daily portfolio history for the specified account. */
- fun getPortfolioHistory(
- accountId: Long,
- params: PortfolioHistoryGetPortfolioHistoryParams,
- ): CompletableFuture =
- getPortfolioHistory(accountId, params, RequestOptions.none())
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- accountId: Long,
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams
- ): CompletableFuture =
- getPortfolioHistory(params, RequestOptions.none())
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /**
- * A view of [PortfolioHistoryServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): PortfolioHistoryServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/accounts/{account_id}/portfolio-history`, but is
- * otherwise the same as [PortfolioHistoryServiceAsync.getPortfolioHistory].
- */
- fun getPortfolioHistory(
- accountId: Long,
- params: PortfolioHistoryGetPortfolioHistoryParams,
- ): CompletableFuture> =
- getPortfolioHistory(accountId, params, RequestOptions.none())
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- accountId: Long,
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- getPortfolioHistory(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams
- ): CompletableFuture> =
- getPortfolioHistory(params, RequestOptions.none())
-
- /** @see getPortfolioHistory */
- fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncImpl.kt
deleted file mode 100644
index 6f6f71b8..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PortfolioHistoryServiceAsyncImpl.kt
+++ /dev/null
@@ -1,93 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.checkRequired
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryParams
-import com.clear_street.api.models.v1.accounts.portfoliohistory.PortfolioHistoryGetPortfolioHistoryResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-import kotlin.jvm.optionals.getOrNull
-
-/** Manage trading accounts, balances, and portfolio history. */
-class PortfolioHistoryServiceAsyncImpl
-internal constructor(private val clientOptions: ClientOptions) : PortfolioHistoryServiceAsync {
-
- private val withRawResponse: PortfolioHistoryServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): PortfolioHistoryServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(
- modifier: Consumer
- ): PortfolioHistoryServiceAsync =
- PortfolioHistoryServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/accounts/{account_id}/portfolio-history
- withRawResponse().getPortfolioHistory(params, requestOptions).thenApply { it.parse() }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- PortfolioHistoryServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): PortfolioHistoryServiceAsync.WithRawResponse =
- PortfolioHistoryServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val getPortfolioHistoryHandler:
- Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getPortfolioHistory(
- params: PortfolioHistoryGetPortfolioHistoryParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "accounts", params._pathParam(0), "portfolio-history")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getPortfolioHistoryHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsync.kt
deleted file mode 100644
index 4bf68a6a..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsync.kt
+++ /dev/null
@@ -1,280 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionParams
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionResponse
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsParams
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsResponse
-import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsParams
-import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsResponse
-import com.clear_street.api.services.async.v1.accounts.positions.InstructionServiceAsync
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** View account positions. */
-interface PositionServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): PositionServiceAsync
-
- /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
- fun instructions(): InstructionServiceAsync
-
- /**
- * Delete a position within an account for an instrument.
- *
- * Retrieves orders generated to close the position.
- */
- fun closePosition(
- instrumentId: String,
- params: PositionClosePositionParams,
- ): CompletableFuture =
- closePosition(instrumentId, params, RequestOptions.none())
-
- /** @see closePosition */
- fun closePosition(
- instrumentId: String,
- params: PositionClosePositionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions)
-
- /** @see closePosition */
- fun closePosition(
- params: PositionClosePositionParams
- ): CompletableFuture =
- closePosition(params, RequestOptions.none())
-
- /** @see closePosition */
- fun closePosition(
- params: PositionClosePositionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /**
- * Delete all positions within an account.
- *
- * Closes all positions for the specified trading account.
- */
- fun closePositions(accountId: Long): CompletableFuture =
- closePositions(accountId, PositionClosePositionsParams.none())
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- params: PositionClosePositionsParams = PositionClosePositionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- closePositions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- params: PositionClosePositionsParams = PositionClosePositionsParams.none(),
- ): CompletableFuture =
- closePositions(accountId, params, RequestOptions.none())
-
- /** @see closePositions */
- fun closePositions(
- params: PositionClosePositionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see closePositions */
- fun closePositions(
- params: PositionClosePositionsParams
- ): CompletableFuture =
- closePositions(params, RequestOptions.none())
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- closePositions(accountId, PositionClosePositionsParams.none(), requestOptions)
-
- /** Retrieves all positions for the specified trading account. */
- fun getPositions(accountId: Long): CompletableFuture =
- getPositions(accountId, PositionGetPositionsParams.none())
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- params: PositionGetPositionsParams = PositionGetPositionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getPositions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- params: PositionGetPositionsParams = PositionGetPositionsParams.none(),
- ): CompletableFuture =
- getPositions(accountId, params, RequestOptions.none())
-
- /** @see getPositions */
- fun getPositions(
- params: PositionGetPositionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getPositions */
- fun getPositions(
- params: PositionGetPositionsParams
- ): CompletableFuture = getPositions(params, RequestOptions.none())
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- getPositions(accountId, PositionGetPositionsParams.none(), requestOptions)
-
- /**
- * A view of [PositionServiceAsync] that provides access to raw HTTP responses for each method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): PositionServiceAsync.WithRawResponse
-
- /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
- fun instructions(): InstructionServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `delete
- * /v1/accounts/{account_id}/positions/{instrument_id}`, but is otherwise the same as
- * [PositionServiceAsync.closePosition].
- */
- fun closePosition(
- instrumentId: String,
- params: PositionClosePositionParams,
- ): CompletableFuture> =
- closePosition(instrumentId, params, RequestOptions.none())
-
- /** @see closePosition */
- fun closePosition(
- instrumentId: String,
- params: PositionClosePositionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- closePosition(params.toBuilder().instrumentId(instrumentId).build(), requestOptions)
-
- /** @see closePosition */
- fun closePosition(
- params: PositionClosePositionParams
- ): CompletableFuture> =
- closePosition(params, RequestOptions.none())
-
- /** @see closePosition */
- fun closePosition(
- params: PositionClosePositionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /**
- * Returns a raw HTTP response for `delete /v1/accounts/{account_id}/positions`, but is
- * otherwise the same as [PositionServiceAsync.closePositions].
- */
- fun closePositions(
- accountId: Long
- ): CompletableFuture> =
- closePositions(accountId, PositionClosePositionsParams.none())
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- params: PositionClosePositionsParams = PositionClosePositionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- closePositions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- params: PositionClosePositionsParams = PositionClosePositionsParams.none(),
- ): CompletableFuture> =
- closePositions(accountId, params, RequestOptions.none())
-
- /** @see closePositions */
- fun closePositions(
- params: PositionClosePositionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see closePositions */
- fun closePositions(
- params: PositionClosePositionsParams
- ): CompletableFuture> =
- closePositions(params, RequestOptions.none())
-
- /** @see closePositions */
- fun closePositions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture> =
- closePositions(accountId, PositionClosePositionsParams.none(), requestOptions)
-
- /**
- * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions`, but is
- * otherwise the same as [PositionServiceAsync.getPositions].
- */
- fun getPositions(
- accountId: Long
- ): CompletableFuture> =
- getPositions(accountId, PositionGetPositionsParams.none())
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- params: PositionGetPositionsParams = PositionGetPositionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- getPositions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- params: PositionGetPositionsParams = PositionGetPositionsParams.none(),
- ): CompletableFuture> =
- getPositions(accountId, params, RequestOptions.none())
-
- /** @see getPositions */
- fun getPositions(
- params: PositionGetPositionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getPositions */
- fun getPositions(
- params: PositionGetPositionsParams
- ): CompletableFuture> =
- getPositions(params, RequestOptions.none())
-
- /** @see getPositions */
- fun getPositions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture> =
- getPositions(accountId, PositionGetPositionsParams.none(), requestOptions)
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncImpl.kt
deleted file mode 100644
index 9784a544..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/PositionServiceAsyncImpl.kt
+++ /dev/null
@@ -1,199 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.checkRequired
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.json
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionParams
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionResponse
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsParams
-import com.clear_street.api.models.v1.accounts.positions.PositionClosePositionsResponse
-import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsParams
-import com.clear_street.api.models.v1.accounts.positions.PositionGetPositionsResponse
-import com.clear_street.api.services.async.v1.accounts.positions.InstructionServiceAsync
-import com.clear_street.api.services.async.v1.accounts.positions.InstructionServiceAsyncImpl
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-import kotlin.jvm.optionals.getOrNull
-
-/** View account positions. */
-class PositionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- PositionServiceAsync {
-
- private val withRawResponse: PositionServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- private val instructions: InstructionServiceAsync by lazy {
- InstructionServiceAsyncImpl(clientOptions)
- }
-
- override fun withRawResponse(): PositionServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): PositionServiceAsync =
- PositionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
- override fun instructions(): InstructionServiceAsync = instructions
-
- override fun closePosition(
- params: PositionClosePositionParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // delete /v1/accounts/{account_id}/positions/{instrument_id}
- withRawResponse().closePosition(params, requestOptions).thenApply { it.parse() }
-
- override fun closePositions(
- params: PositionClosePositionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // delete /v1/accounts/{account_id}/positions
- withRawResponse().closePositions(params, requestOptions).thenApply { it.parse() }
-
- override fun getPositions(
- params: PositionGetPositionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/accounts/{account_id}/positions
- withRawResponse().getPositions(params, requestOptions).thenApply { it.parse() }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- PositionServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- private val instructions: InstructionServiceAsync.WithRawResponse by lazy {
- InstructionServiceAsyncImpl.WithRawResponseImpl(clientOptions)
- }
-
- override fun withOptions(
- modifier: Consumer
- ): PositionServiceAsync.WithRawResponse =
- PositionServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- /** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
- override fun instructions(): InstructionServiceAsync.WithRawResponse = instructions
-
- private val closePositionHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun closePosition(
- params: PositionClosePositionParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("instrumentId", params.instrumentId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.DELETE)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments(
- "v1",
- "accounts",
- params._pathParam(0),
- "positions",
- params._pathParam(1),
- )
- .body(json(clientOptions.jsonMapper, params._body()))
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { closePositionHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
-
- private val closePositionsHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun closePositions(
- params: PositionClosePositionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.DELETE)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "accounts", params._pathParam(0), "positions")
- .body(json(clientOptions.jsonMapper, params._body()))
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { closePositionsHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
-
- private val getPositionsHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getPositions(
- params: PositionGetPositionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "accounts", params._pathParam(0), "positions")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getPositionsHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsync.kt
deleted file mode 100644
index 81b5d3d1..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsync.kt
+++ /dev/null
@@ -1,277 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts.positions
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionResponse
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsResponse
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
-interface InstructionServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): InstructionServiceAsync
-
- /**
- * Cancel an outstanding exercise / DNE / CEA instruction by its server- assigned `id`. Returns
- * the updated instruction with status `CANCEL_REQUESTED`; the terminal `CANCELLED` /
- * `CANCEL_FAILED` state arrives asynchronously via subsequent GETs.
- */
- fun cancelPositionInstruction(
- instructionId: String,
- params: InstructionCancelPositionInstructionParams,
- ): CompletableFuture =
- cancelPositionInstruction(instructionId, params, RequestOptions.none())
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- instructionId: String,
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- cancelPositionInstruction(
- params.toBuilder().instructionId(instructionId).build(),
- requestOptions,
- )
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams
- ): CompletableFuture =
- cancelPositionInstruction(params, RequestOptions.none())
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /**
- * Returns the current lifecycle state of exercise / DNE / CEA instructions for the account.
- * Optionally filter by a specific instrument.
- */
- fun getPositionInstructions(
- accountId: Long
- ): CompletableFuture =
- getPositionInstructions(accountId, InstructionGetPositionInstructionsParams.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- params: InstructionGetPositionInstructionsParams =
- InstructionGetPositionInstructionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- params: InstructionGetPositionInstructionsParams =
- InstructionGetPositionInstructionsParams.none(),
- ): CompletableFuture =
- getPositionInstructions(accountId, params, RequestOptions.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams
- ): CompletableFuture =
- getPositionInstructions(params, RequestOptions.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- getPositionInstructions(
- accountId,
- InstructionGetPositionInstructionsParams.none(),
- requestOptions,
- )
-
- /**
- * Submit one or more option lifecycle instructions against the account. Each row is routed to
- * `oems-csc` independently; per-row rejections are surfaced on the corresponding response entry
- * without failing the batch.
- */
- fun submitPositionInstructions(
- accountId: Long,
- params: InstructionSubmitPositionInstructionsParams,
- ): CompletableFuture =
- submitPositionInstructions(accountId, params, RequestOptions.none())
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- accountId: Long,
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- submitPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams
- ): CompletableFuture =
- submitPositionInstructions(params, RequestOptions.none())
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /**
- * A view of [InstructionServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): InstructionServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `delete
- * /v1/accounts/{account_id}/positions/instructions/{instruction_id}`, but is otherwise the
- * same as [InstructionServiceAsync.cancelPositionInstruction].
- */
- fun cancelPositionInstruction(
- instructionId: String,
- params: InstructionCancelPositionInstructionParams,
- ): CompletableFuture> =
- cancelPositionInstruction(instructionId, params, RequestOptions.none())
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- instructionId: String,
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- cancelPositionInstruction(
- params.toBuilder().instructionId(instructionId).build(),
- requestOptions,
- )
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams
- ): CompletableFuture> =
- cancelPositionInstruction(params, RequestOptions.none())
-
- /** @see cancelPositionInstruction */
- fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /**
- * Returns a raw HTTP response for `get /v1/accounts/{account_id}/positions/instructions`,
- * but is otherwise the same as [InstructionServiceAsync.getPositionInstructions].
- */
- fun getPositionInstructions(
- accountId: Long
- ): CompletableFuture> =
- getPositionInstructions(accountId, InstructionGetPositionInstructionsParams.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- params: InstructionGetPositionInstructionsParams =
- InstructionGetPositionInstructionsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- getPositionInstructions(params.toBuilder().accountId(accountId).build(), requestOptions)
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- params: InstructionGetPositionInstructionsParams =
- InstructionGetPositionInstructionsParams.none(),
- ): CompletableFuture> =
- getPositionInstructions(accountId, params, RequestOptions.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams
- ): CompletableFuture> =
- getPositionInstructions(params, RequestOptions.none())
-
- /** @see getPositionInstructions */
- fun getPositionInstructions(
- accountId: Long,
- requestOptions: RequestOptions,
- ): CompletableFuture> =
- getPositionInstructions(
- accountId,
- InstructionGetPositionInstructionsParams.none(),
- requestOptions,
- )
-
- /**
- * Returns a raw HTTP response for `post /v1/accounts/{account_id}/positions/instructions`,
- * but is otherwise the same as [InstructionServiceAsync.submitPositionInstructions].
- */
- fun submitPositionInstructions(
- accountId: Long,
- params: InstructionSubmitPositionInstructionsParams,
- ): CompletableFuture> =
- submitPositionInstructions(accountId, params, RequestOptions.none())
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- accountId: Long,
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture> =
- submitPositionInstructions(
- params.toBuilder().accountId(accountId).build(),
- requestOptions,
- )
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams
- ): CompletableFuture> =
- submitPositionInstructions(params, RequestOptions.none())
-
- /** @see submitPositionInstructions */
- fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncImpl.kt
deleted file mode 100644
index 85f27b39..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/accounts/positions/InstructionServiceAsyncImpl.kt
+++ /dev/null
@@ -1,201 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.accounts.positions
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.checkRequired
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.json
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionCancelPositionInstructionResponse
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionGetPositionInstructionsResponse
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsParams
-import com.clear_street.api.models.v1.accounts.positions.instructions.InstructionSubmitPositionInstructionsResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-import kotlin.jvm.optionals.getOrNull
-
-/** Submit and monitor option exercise, DNE, CEA, and cancel instructions. */
-class InstructionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- InstructionServiceAsync {
-
- private val withRawResponse: InstructionServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): InstructionServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): InstructionServiceAsync =
- InstructionServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // delete /v1/accounts/{account_id}/positions/instructions/{instruction_id}
- withRawResponse().cancelPositionInstruction(params, requestOptions).thenApply { it.parse() }
-
- override fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/accounts/{account_id}/positions/instructions
- withRawResponse().getPositionInstructions(params, requestOptions).thenApply { it.parse() }
-
- override fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // post /v1/accounts/{account_id}/positions/instructions
- withRawResponse().submitPositionInstructions(params, requestOptions).thenApply {
- it.parse()
- }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- InstructionServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): InstructionServiceAsync.WithRawResponse =
- InstructionServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val cancelPositionInstructionHandler:
- Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun cancelPositionInstruction(
- params: InstructionCancelPositionInstructionParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("instructionId", params.instructionId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.DELETE)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments(
- "v1",
- "accounts",
- params._pathParam(0),
- "positions",
- "instructions",
- params._pathParam(1),
- )
- .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } }
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { cancelPositionInstructionHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
-
- private val getPositionInstructionsHandler:
- Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getPositionInstructions(
- params: InstructionGetPositionInstructionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments(
- "v1",
- "accounts",
- params._pathParam(0),
- "positions",
- "instructions",
- )
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getPositionInstructionsHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
-
- private val submitPositionInstructionsHandler:
- Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun submitPositionInstructions(
- params: InstructionSubmitPositionInstructionsParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("accountId", params.accountId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.POST)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments(
- "v1",
- "accounts",
- params._pathParam(0),
- "positions",
- "instructions",
- )
- .body(json(clientOptions.jsonMapper, params._body()))
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { submitPositionInstructionsHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsync.kt
deleted file mode 100644
index 9c38850f..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsync.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.calendars
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarParams
-import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Access financial calendars for events like earnings, dividends, and splits. */
-interface MarketHourServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): MarketHourServiceAsync
-
- /**
- * Retrieves comprehensive trading hours including pre-market, regular, and after-hours
- * sessions. Returns market status, session times, and next session schedules.
- */
- fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams
- ): CompletableFuture =
- getMarketHoursCalendar(params, RequestOptions.none())
-
- /** @see getMarketHoursCalendar */
- fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /**
- * A view of [MarketHourServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): MarketHourServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/calendars/market-hours`, but is otherwise the
- * same as [MarketHourServiceAsync.getMarketHoursCalendar].
- */
- fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams
- ): CompletableFuture> =
- getMarketHoursCalendar(params, RequestOptions.none())
-
- /** @see getMarketHoursCalendar */
- fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncImpl.kt
deleted file mode 100644
index f260e3fa..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/calendars/MarketHourServiceAsyncImpl.kt
+++ /dev/null
@@ -1,86 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.calendars
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarParams
-import com.clear_street.api.models.v1.calendars.markethours.MarketHourGetMarketHoursCalendarResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Access financial calendars for events like earnings, dividends, and splits. */
-class MarketHourServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
- MarketHourServiceAsync {
-
- private val withRawResponse: MarketHourServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): MarketHourServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(modifier: Consumer): MarketHourServiceAsync =
- MarketHourServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/calendars/market-hours
- withRawResponse().getMarketHoursCalendar(params, requestOptions).thenApply { it.parse() }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- MarketHourServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): MarketHourServiceAsync.WithRawResponse =
- MarketHourServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val getMarketHoursCalendarHandler:
- Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun getMarketHoursCalendar(
- params: MarketHourGetMarketHoursCalendarParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "calendars", "market-hours")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getMarketHoursCalendarHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsync.kt
deleted file mode 100644
index 2e8928df..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsync.kt
+++ /dev/null
@@ -1,159 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.instruments
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusParams
-import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Retrieve details and lists of tradable instruments. */
-interface AnalystReportingServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): AnalystReportingServiceAsync
-
- /** Retrieves analyst ratings and price targets for an instrument. */
- fun getInstrumentAnalystConsensus(
- instrumentId: String
- ): CompletableFuture =
- getInstrumentAnalystConsensus(
- instrumentId,
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- )
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- params: AnalystReportingGetInstrumentAnalystConsensusParams =
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getInstrumentAnalystConsensus(
- params.toBuilder().instrumentId(instrumentId).build(),
- requestOptions,
- )
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- params: AnalystReportingGetInstrumentAnalystConsensusParams =
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- ): CompletableFuture =
- getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none())
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams
- ): CompletableFuture =
- getInstrumentAnalystConsensus(params, RequestOptions.none())
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- getInstrumentAnalystConsensus(
- instrumentId,
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- requestOptions,
- )
-
- /**
- * A view of [AnalystReportingServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): AnalystReportingServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/analyst-reporting`,
- * but is otherwise the same as
- * [AnalystReportingServiceAsync.getInstrumentAnalystConsensus].
- */
- fun getInstrumentAnalystConsensus(
- instrumentId: String
- ): CompletableFuture<
- HttpResponseFor
- > =
- getInstrumentAnalystConsensus(
- instrumentId,
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- )
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- params: AnalystReportingGetInstrumentAnalystConsensusParams =
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture<
- HttpResponseFor
- > =
- getInstrumentAnalystConsensus(
- params.toBuilder().instrumentId(instrumentId).build(),
- requestOptions,
- )
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- params: AnalystReportingGetInstrumentAnalystConsensusParams =
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- ): CompletableFuture<
- HttpResponseFor
- > = getInstrumentAnalystConsensus(instrumentId, params, RequestOptions.none())
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams
- ): CompletableFuture<
- HttpResponseFor
- > = getInstrumentAnalystConsensus(params, RequestOptions.none())
-
- /** @see getInstrumentAnalystConsensus */
- fun getInstrumentAnalystConsensus(
- instrumentId: String,
- requestOptions: RequestOptions,
- ): CompletableFuture<
- HttpResponseFor
- > =
- getInstrumentAnalystConsensus(
- instrumentId,
- AnalystReportingGetInstrumentAnalystConsensusParams.none(),
- requestOptions,
- )
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncImpl.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncImpl.kt
deleted file mode 100644
index 6b5b3abf..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/AnalystReportingServiceAsyncImpl.kt
+++ /dev/null
@@ -1,99 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.instruments
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.checkRequired
-import com.clear_street.api.core.handlers.errorBodyHandler
-import com.clear_street.api.core.handlers.errorHandler
-import com.clear_street.api.core.handlers.jsonHandler
-import com.clear_street.api.core.http.HttpMethod
-import com.clear_street.api.core.http.HttpRequest
-import com.clear_street.api.core.http.HttpResponse
-import com.clear_street.api.core.http.HttpResponse.Handler
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.core.http.parseable
-import com.clear_street.api.core.prepareAsync
-import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusParams
-import com.clear_street.api.models.v1.instruments.analystreporting.AnalystReportingGetInstrumentAnalystConsensusResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-import kotlin.jvm.optionals.getOrNull
-
-/** Retrieve details and lists of tradable instruments. */
-class AnalystReportingServiceAsyncImpl
-internal constructor(private val clientOptions: ClientOptions) : AnalystReportingServiceAsync {
-
- private val withRawResponse: AnalystReportingServiceAsync.WithRawResponse by lazy {
- WithRawResponseImpl(clientOptions)
- }
-
- override fun withRawResponse(): AnalystReportingServiceAsync.WithRawResponse = withRawResponse
-
- override fun withOptions(
- modifier: Consumer
- ): AnalystReportingServiceAsync =
- AnalystReportingServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
-
- override fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // get /v1/instruments/{instrument_id}/analyst-reporting
- withRawResponse().getInstrumentAnalystConsensus(params, requestOptions).thenApply {
- it.parse()
- }
-
- class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
- AnalystReportingServiceAsync.WithRawResponse {
-
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
- override fun withOptions(
- modifier: Consumer
- ): AnalystReportingServiceAsync.WithRawResponse =
- AnalystReportingServiceAsyncImpl.WithRawResponseImpl(
- clientOptions.toBuilder().apply(modifier::accept).build()
- )
-
- private val getInstrumentAnalystConsensusHandler:
- Handler =
- jsonHandler(
- clientOptions.jsonMapper
- )
-
- override fun getInstrumentAnalystConsensus(
- params: AnalystReportingGetInstrumentAnalystConsensusParams,
- requestOptions: RequestOptions,
- ): CompletableFuture<
- HttpResponseFor
- > {
- // We check here instead of in the params builder because this can be specified
- // positionally or in the params class.
- checkRequired("instrumentId", params.instrumentId().getOrNull())
- val request =
- HttpRequest.builder()
- .method(HttpMethod.GET)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v1", "instruments", params._pathParam(0), "analyst-reporting")
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { getInstrumentAnalystConsensusHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
- }
-}
diff --git a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsync.kt b/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsync.kt
deleted file mode 100644
index 7a6a1182..00000000
--- a/clear-street-java-core/src/main/kotlin/com/clear_street/api/services/async/v1/instruments/BalanceSheetServiceAsync.kt
+++ /dev/null
@@ -1,169 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.clear_street.api.services.async.v1.instruments
-
-import com.clear_street.api.core.ClientOptions
-import com.clear_street.api.core.RequestOptions
-import com.clear_street.api.core.http.HttpResponseFor
-import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsParams
-import com.clear_street.api.models.v1.instruments.balancesheets.BalanceSheetGetInstrumentBalanceSheetStatementsResponse
-import java.util.concurrent.CompletableFuture
-import java.util.function.Consumer
-
-/** Retrieve details and lists of tradable instruments. */
-interface BalanceSheetServiceAsync {
-
- /**
- * Returns a view of this service that provides access to raw HTTP responses for each method.
- */
- fun withRawResponse(): WithRawResponse
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(modifier: Consumer): BalanceSheetServiceAsync
-
- /**
- * Get balance sheet statements for an instrument.
- *
- * Retrieves quarterly balance sheet statements for a specific instrument, sorted by fiscal
- * period (most recent first).
- *
- * Date range defaults:
- * - `from_date`: None (no lower bound)
- * - `to_date`: None (no upper bound)
- */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String
- ): CompletableFuture =
- getInstrumentBalanceSheetStatements(
- instrumentId,
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- )
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String,
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams =
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture =
- getInstrumentBalanceSheetStatements(
- params.toBuilder().instrumentId(instrumentId).build(),
- requestOptions,
- )
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String,
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams =
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- ): CompletableFuture =
- getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none())
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams
- ): CompletableFuture =
- getInstrumentBalanceSheetStatements(params, RequestOptions.none())
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- getInstrumentBalanceSheetStatements(
- instrumentId,
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- requestOptions,
- )
-
- /**
- * A view of [BalanceSheetServiceAsync] that provides access to raw HTTP responses for each
- * method.
- */
- interface WithRawResponse {
-
- /**
- * Returns a view of this service with the given option modifications applied.
- *
- * The original service is not modified.
- */
- fun withOptions(
- modifier: Consumer
- ): BalanceSheetServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `get /v1/instruments/{instrument_id}/balance-sheets`, but
- * is otherwise the same as [BalanceSheetServiceAsync.getInstrumentBalanceSheetStatements].
- */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String
- ): CompletableFuture<
- HttpResponseFor
- > =
- getInstrumentBalanceSheetStatements(
- instrumentId,
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- )
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String,
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams =
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture<
- HttpResponseFor
- > =
- getInstrumentBalanceSheetStatements(
- params.toBuilder().instrumentId(instrumentId).build(),
- requestOptions,
- )
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- instrumentId: String,
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams =
- BalanceSheetGetInstrumentBalanceSheetStatementsParams.none(),
- ): CompletableFuture<
- HttpResponseFor
- > = getInstrumentBalanceSheetStatements(instrumentId, params, RequestOptions.none())
-
- /** @see getInstrumentBalanceSheetStatements */
- fun getInstrumentBalanceSheetStatements(
- params: BalanceSheetGetInstrumentBalanceSheetStatementsParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture<
- HttpResponseFor